]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-adjusted-lvalue-op.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-adjusted-lvalue-op.rs
1 // check that we link regions in mutable place ops correctly - issue #41774
2
3 struct Data(i32);
4
5 trait OhNo {
6     fn oh_no(&mut self, other: &Vec<Data>) { loop {} }
7 }
8
9 impl OhNo for Data {}
10 impl OhNo for [Data] {}
11
12 fn main() {
13     let mut v = vec![Data(0)];
14     v[0].oh_no(&v); //~ ERROR cannot borrow `v` as immutable because
15     (*v).oh_no(&v); //~ ERROR cannot borrow `v` as immutable because
16 }