fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
11.1 KiB155 linesraw
1error[E0597]: `_t1` does not live long enough
2  --> $DIR/issue-54556-used-vs-unused-tails.rs:10:55
3   |
4LL |     {              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   |                        binding `_t1` declared here
11   |
12help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
13   |
14LL |     {              let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
15   |                                                                  +
16
17error[E0597]: `_t1` does not live long enough
18  --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
19   |
20LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }  } ; // suggest `;`
21   |                        -------                      --^^^^-       -    - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
22   |                        |                            | |           |
23   |                        |                            | |           `_t1` dropped here while still borrowed
24   |                        |                            | borrowed value does not live long enough
25   |                        |                            a temporary with access to the borrow is created here ...
26   |                        binding `_t1` declared here
27   |
28help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
29   |
30LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }  } ; // suggest `;`
31   |                                                                  +
32
33error[E0597]: `_t1` does not live long enough
34  --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
35   |
36LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }; }   // suggest `;`
37   |                        -------                      --^^^^-       -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
38   |                        |                            | |           |
39   |                        |                            | |           `_t1` dropped here while still borrowed
40   |                        |                            | borrowed value does not live long enough
41   |                        |                            a temporary with access to the borrow is created here ...
42   |                        binding `_t1` declared here
43   |
44help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
45   |
46LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; }   // suggest `;`
47   |                                                                  +
48
49error[E0597]: `_t1` does not live long enough
50  --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
51   |
52LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; // 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   |                        binding `_t1` declared here
59   |
60help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
61   |
62LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
63   |                                                                  +
64
65error[E0597]: `_t1` does not live long enough
66  --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
67   |
68LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   } ; // suggest `;`
69   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
70   |                        |                            | |              |
71   |                        |                            | |              `_t1` dropped here while still borrowed
72   |                        |                            | borrowed value does not live long enough
73   |                        |                            a temporary with access to the borrow is created here ...
74   |                        binding `_t1` declared here
75   |
76help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
77   |
78LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   } ; // suggest `;`
79   |                                                                   +
80
81error[E0597]: `_t1` does not live long enough
82  --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
83   |
84LL |     let _x =     { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; // `let x = ...; x`
85   |                        -------                      --^^^^-          - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
86   |                        |                            | |              |
87   |                        |                            | |              `_t1` dropped here while still borrowed
88   |                        |                            | borrowed value does not live long enough
89   |                        |                            a temporary with access to the borrow is created here ...
90   |                        binding `_t1` declared here
91   |
92   = note: the temporary is part of an expression at the end of a block;
93           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
94help: 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
95   |
96LL |     let _x =     { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x    } ; // `let x = ...; x`
97   |                                                     +++++++              +++
98
99error[E0597]: `_t1` does not live long enough
100  --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
101   |
102LL |     _y =         { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `let x = ...; x`
103   |                        -------                      --^^^^-       - - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
104   |                        |                            | |           |
105   |                        |                            | |           `_t1` dropped here while still borrowed
106   |                        |                            | borrowed value does not live long enough
107   |                        |                            a temporary with access to the borrow is created here ...
108   |                        binding `_t1` declared here
109   |
110   = note: the temporary is part of an expression at the end of a block;
111           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
112help: 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
113   |
114LL |     _y =         { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
115   |                                                     +++++++              +++
116
117error[E0597]: `_t1` does not live long enough
118  --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
119   |
120LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   }  // suggest `;`
121   |                        -------                      --^^^^-          -
122   |                        |                            | |              |
123   |                        |                            | |              `_t1` dropped here while still borrowed
124   |                        |                            | |              ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
125   |                        |                            | borrowed value does not live long enough
126   |                        |                            a temporary with access to the borrow is created here ...
127   |                        binding `_t1` declared here
128   |
129help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
130   |
131LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   }  // suggest `;`
132   |                                                                   +
133
134error[E0597]: `_t1` does not live long enough
135  --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
136   |
137LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end()   }   // `let x = ...; x`
138   |                        -------                      --^^^^-         -
139   |                        |                            | |             |
140   |                        |                            | |             `_t1` dropped here while still borrowed
141   |                        |                            | |             ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
142   |                        |                            | borrowed value does not live long enough
143   |                        |                            a temporary with access to the borrow is created here ...
144   |                        binding `_t1` declared here
145   |
146   = note: the temporary is part of an expression at the end of a block;
147           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
148help: 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
149   |
150LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x   }   // `let x = ...; x`
151   |                                                     +++++++              +++
152
153error: aborting due to 9 previous errors
154
155For more information about this error, try `rustc --explain E0597`.