]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr
Rollup merge of #60220 - euclio:rustdoc-test-fatal-parsing-errors, r=QuietMisdreavus
[rust.git] / src / test / ui / nll / issue-54556-used-vs-unused-tails.stderr
1 error[E0597]: `_t1` does not live long enough
2   --> $DIR/issue-54556-used-vs-unused-tails.rs:10:55
3    |
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`
6    |                                                     | |              |
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 ...
10    |
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.
12
13 error[E0597]: `_t1` does not live long enough
14   --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
15    |
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`
18    |                                                     | |           |
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 ...
22    |
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.
24
25 error[E0597]: `_t1` does not live long enough
26   --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
27    |
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`
30    |                                                     | |           |
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 ...
34    |
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.
36
37 error[E0597]: `_t1` does not live long enough
38   --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
39    |
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`
42    |                                                     | |              |
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 ...
46    |
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.
48
49 error[E0597]: `_t1` does not live long enough
50   --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
51    |
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`
54    |                                                     | |              |
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 ...
58    |
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.
60
61 error[E0597]: `_t1` does not live long enough
62   --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
63    |
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`
66    |                                                     | |              |
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 ...
70    |
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.
72
73 error[E0597]: `_t1` does not live long enough
74   --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
75    |
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`
78    |                                                     | |           |
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 ...
82    |
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.
84
85 error[E0597]: `_t1` does not live long enough
86   --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
87    |
88 LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   }  // suggest `;`
89    |                                                     --^^^^-          -
90    |                                                     | |              |
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 ...
95    |
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.
97
98 error[E0597]: `_t1` does not live long enough
99   --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
100    |
101 LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end()   }   // `let x = ...; x`
102    |                                                     --^^^^-         -
103    |                                                     | |             |
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 ...
108    |
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.
110
111 error: aborting due to 9 previous errors
112
113 For more information about this error, try `rustc --explain E0597`.