fork/rust
git clone https://git.julia.blue/fork/rust
4fb7144ed15
1.43.0
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 | 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 13error[E0597]: `_t1` does not live long enough 14 --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55 15 | 16LL | { { 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 25error[E0597]: `_t1` does not live long enough 26 --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55 27 | 28LL | { { 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 37error[E0597]: `_t1` does not live long enough 38 --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55 39 | 40LL | 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 49error[E0597]: `_t1` does not live long enough 50 --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55 51 | 52LL | 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 61error[E0597]: `_t1` does not live long enough 62 --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55 63 | 64LL | 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 73error[E0597]: `_t1` does not live long enough 74 --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55 75 | 76LL | _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 85error[E0597]: `_t1` does not live long enough 86 --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55 87 | 88LL | 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 98error[E0597]: `_t1` does not live long enough 99 --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55 100 | 101LL | 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 111error: aborting due to 9 previous errors 112 113For more information about this error, try `rustc --explain E0597`.