]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-42106.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-42106.rs
1 fn do_something<T>(collection: &mut Vec<T>) {
2 let _a = &collection;
3 collection.swap(1, 2); //~ ERROR also borrowed as immutable
4 _a.use_ref();
5 }
6
7 fn main() { }
8
9 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
10 impl<T> Fake for T { }