summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-54556-used-vs-unused-tails.stderr
blob: a2a7a8486545cb0b0ab8f36764f49d870af666a5 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:10:55
   |
LL |     {              let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; // suggest `;`
   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |              |
   |                        |                            | |              `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     {              let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
   |                                                                  +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
   |
LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }  } ; // suggest `;`
   |                        -------                      --^^^^-       -    - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |           |
   |                        |                            | |           `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }  } ; // suggest `;`
   |                                                                  +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
   |
LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }; }   // suggest `;`
   |                        -------                      --^^^^-       -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |           |
   |                        |                            | |           `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; }   // suggest `;`
   |                                                                  +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
   |
LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; // suggest `;`
   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |              |
   |                        |                            | |              `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
   |                                                                  +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
   |
LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   } ; // suggest `;`
   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |              |
   |                        |                            | |              `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   } ; // suggest `;`
   |                                                                   +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
   |
LL |     let _x =     { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; // `let x = ...; x`
   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |              |
   |                        |                            | |              `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
   = 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
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
   |
LL |     let _x =     { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x    } ; // `let x = ...; x`
   |                                                     +++++++              +++

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
   |
LL |     _y =         { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
   |                        -------                      --^^^^-       - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | |           |
   |                        |                            | |           `_t1` dropped here while still borrowed
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
   = 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
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
   |
LL |     _y =         { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
   |                                                     +++++++              +++

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
   |
LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   }  // suggest `;`
   |                        -------                      --^^^^-          -
   |                        |                            | |              |
   |                        |                            | |              `_t1` dropped here while still borrowed
   |                        |                            | |              ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   }  // suggest `;`
   |                                                                   +

error[E0597]: `_t1` does not live long enough
  --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
   |
LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end()   }   // `let x = ...; x`
   |                        -------                      --^^^^-         -
   |                        |                            | |             |
   |                        |                            | |             `_t1` dropped here while still borrowed
   |                        |                            | |             ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                        |                            | borrowed value does not live long enough
   |                        |                            a temporary with access to the borrow is created here ...
   |                        binding `_t1` declared here
   |
   = 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
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
   |
LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x   }   // `let x = ...; x`
   |                                                     +++++++              +++

error: aborting due to 9 previous errors

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