about summary refs log tree commit diff
path: root/tests/ui/nll/sugg-mut-for-binding-issue-137486.stderr
blob: 8432725f60ad3f62cfcbb82539fd5f77bc3ff27e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
error[E0716]: temporary value dropped while borrowed
  --> $DIR/sugg-mut-for-binding-issue-137486.rs:9:18
   |
LL |     ref_s = &mut String::from("world");
   |                  ^^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
   |                  |
   |                  creates a temporary value which is freed while still in use
LL |
LL |     print!("r1 = {}", ref_s);
   |                       ----- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let mut binding = String::from("world");
LL ~     ref_s = &mut binding;
   |

error[E0716]: temporary value dropped while borrowed
  --> $DIR/sugg-mut-for-binding-issue-137486.rs:18:18
   |
LL |     ref_s = &mut Pin::new(&mut val2);
   |                  ^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
   |                  |
   |                  creates a temporary value which is freed while still in use
LL |
LL |     print!("r1 = {}", ref_s);
   |                       ----- borrow later used here
   |
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let mut binding = Pin::new(&mut val2);
LL ~     ref_s = &mut binding;
   |

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0716`.