]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-codes/E0505.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / 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 { }