]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0505.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / error-codes / E0505.rs
1 struct Value {}
2
3 fn eat(val: Value) {}
4
5 fn main() {
6     let x = Value{};
7     {
8         let _ref_to_val: &Value = &x;
9         eat(x); //~ ERROR E0505
10         _ref_to_val.use_ref();
11     }
12 }
13
14 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
15 impl<T> Fake for T { }