summary refs log tree commit diff stats
path: root/tests/ui/no_uaf_2.stderr
blob: 5b9fa552a27f54ce00bd957527241f945e8ec723 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
error[E0716]: temporary value dropped while borrowed
  --> tests/ui/no_uaf_2.rs:27:21
   |
26 |     s.as_ref().operate_in(|r| {
   |                            - has type `OperateIn<'1, MyStructKey>`
27 |         r.cell.set(&String::from("hello world")); // temporary dropped at end of this statement
   |         ------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-- temporary value is freed at the end of this statement
   |         |           |
   |         |           creates a temporary which is freed while still in use
   |         argument requires that borrow lasts for `'1`