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 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
13 error[E0597]: `_t1` does not live long enough
14 --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
16 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } } ; // suggest `;`
17 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
19 | | | `_t1` dropped here while still borrowed
20 | | borrowed value does not live long enough
21 | a temporary with access to the borrow is created here ...
23 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
25 error[E0597]: `_t1` does not live long enough
26 --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
28 LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }; } // suggest `;`
29 | --^^^^- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
31 | | | `_t1` dropped here while still borrowed
32 | | borrowed value does not live long enough
33 | a temporary with access to the borrow is created here ...
35 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
37 error[E0597]: `_t1` does not live long enough
38 --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
40 LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // suggest `;`
41 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
43 | | | `_t1` dropped here while still borrowed
44 | | borrowed value does not live long enough
45 | a temporary with access to the borrow is created here ...
47 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
49 error[E0597]: `_t1` does not live long enough
50 --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
52 LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit() } ; // suggest `;`
53 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
55 | | | `_t1` dropped here while still borrowed
56 | | borrowed value does not live long enough
57 | a temporary with access to the borrow is created here ...
59 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
61 error[E0597]: `_t1` does not live long enough
62 --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
64 LL | let _x = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
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 = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. 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.
73 error[E0597]: `_t1` does not live long enough
74 --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
76 LL | _y = { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
77 | --^^^^- - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
79 | | | `_t1` dropped here while still borrowed
80 | | borrowed value does not live long enough
81 | a temporary with access to the borrow is created here ...
83 = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. 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.
85 error[E0597]: `_t1` does not live long enough
86 --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
88 LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit() } // suggest `;`
91 | | | `_t1` dropped here while still borrowed
92 | | | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
93 | | borrowed value does not live long enough
94 | a temporary with access to the borrow is created here ...
96 = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
98 error[E0597]: `_t1` does not live long enough
99 --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
101 LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } // `let x = ...; x`
104 | | | `_t1` dropped here while still borrowed
105 | | | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
106 | | borrowed value does not live long enough
107 | a temporary with access to the borrow is created here ...
109 = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. 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.
111 error: aborting due to 9 previous errors
113 For more information about this error, try `rustc --explain E0597`.