1 error[E0597]: `_t1` does not live long enough
2 --> $DIR/issue-54556-used-vs-unused-tails.rs:10:55
4 LL | { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // suggest `;`
5 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
7 | | | `_t1` dropped here while still borrowed
8 | | borrowed value does not live long enough
9 | a temporary with access to the borrow is created here ...
11 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
13 LL | { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
16 error[E0597]: `_t1` does not live long enough
17 --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
19 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } } ; // suggest `;`
20 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
22 | | | `_t1` dropped here while still borrowed
23 | | borrowed value does not live long enough
24 | a temporary with access to the borrow is created here ...
26 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
28 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } } ; // suggest `;`
31 error[E0597]: `_t1` does not live long enough
32 --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
34 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }; } // suggest `;`
35 | --^^^^- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
37 | | | `_t1` dropped here while still borrowed
38 | | borrowed value does not live long enough
39 | a temporary with access to the borrow is created here ...
41 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
43 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; } // suggest `;`
46 error[E0597]: `_t1` does not live long enough
47 --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
49 LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // suggest `;`
50 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
52 | | | `_t1` dropped here while still borrowed
53 | | borrowed value does not live long enough
54 | a temporary with access to the borrow is created here ...
56 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
58 LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
61 error[E0597]: `_t1` does not live long enough
62 --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
64 LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit() } ; // suggest `;`
65 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
67 | | | `_t1` dropped here while still borrowed
68 | | borrowed value does not live long enough
69 | a temporary with access to the borrow is created here ...
71 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
73 LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } ; // suggest `;`
76 error[E0597]: `_t1` does not live long enough
77 --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
79 LL | let _x = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
80 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
82 | | | `_t1` dropped here while still borrowed
83 | | borrowed value does not live long enough
84 | a temporary with access to the borrow is created here ...
86 = note: the temporary is part of an expression at the end of a block;
87 consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
88 help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
90 LL | let _x = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
93 error[E0597]: `_t1` does not live long enough
94 --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
96 LL | _y = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
97 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
99 | | | `_t1` dropped here while still borrowed
100 | | borrowed value does not live long enough
101 | a temporary with access to the borrow is created here ...
103 = note: the temporary is part of an expression at the end of a block;
104 consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
105 help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
107 LL | _y = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
110 error[E0597]: `_t1` does not live long enough
111 --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
113 LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit() } // suggest `;`
116 | | | `_t1` dropped here while still borrowed
117 | | | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
118 | | borrowed value does not live long enough
119 | a temporary with access to the borrow is created here ...
121 help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
123 LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } // suggest `;`
126 error[E0597]: `_t1` does not live long enough
127 --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
129 LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } // `let x = ...; x`
132 | | | `_t1` dropped here while still borrowed
133 | | | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
134 | | borrowed value does not live long enough
135 | a temporary with access to the borrow is created here ...
137 = note: the temporary is part of an expression at the end of a block;
138 consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
139 help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
141 LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } // `let x = ...; x`
144 error: aborting due to 9 previous errors
146 For more information about this error, try `rustc --explain E0597`.