mirror of https://github.com/rust-lang/rust.git
281 lines
9.9 KiB
Plaintext
281 lines
9.9 KiB
Plaintext
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:40:15
|
|
|
|
|
LL | let x = LoudDropper;
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | x.get() + LoudDropper.get()
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
note: `x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
note: the lint level is defined here
|
|
--> $DIR/lint-tail-expr-drop-order.rs:6:9
|
|
|
|
|
LL | #![deny(tail_expr_drop_order)]
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:65:19
|
|
|
|
|
LL | let x = LoudDropper;
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | x.get() + LoudDropper.get()
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
note: `x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:92:7
|
|
|
|
|
LL | let x = LoudDropper;
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | { LoudDropper.get() }
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
note: `x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:145:5
|
|
|
|
|
LL | let future = f();
|
|
| ------
|
|
| |
|
|
| `future` calls a custom destructor
|
|
| `future` will be dropped later as of Edition 2024
|
|
...
|
|
LL | LoudDropper.get()
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:162:14
|
|
|
|
|
LL | let x = T::default();
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | extract(&T::default())
|
|
| ^^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:176:5
|
|
|
|
|
LL | let x: Result<LoudDropper, ()> = Ok(LoudDropper);
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | LoudDropper.get()
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
note: `x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:220:5
|
|
|
|
|
LL | let x = LoudDropper2;
|
|
| -
|
|
| |
|
|
| `x` calls a custom destructor
|
|
| `x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | LoudDropper3.get()
|
|
| ^^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | }
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:193:5
|
|
|
|
|
LL | / impl Drop for LoudDropper3 {
|
|
LL | |
|
|
LL | | fn drop(&mut self) {
|
|
LL | | println!("loud drop");
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
note: `x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:205:5
|
|
|
|
|
LL | / impl Drop for LoudDropper2 {
|
|
LL | |
|
|
LL | | fn drop(&mut self) {
|
|
LL | | println!("loud drop");
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: relative drop order changing in Rust 2024
|
|
--> $DIR/lint-tail-expr-drop-order.rs:233:13
|
|
|
|
|
LL | LoudDropper.get()
|
|
| ^^^^^^^^^^^
|
|
| |
|
|
| this value will be stored in a temporary; let us call it `#1`
|
|
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
|
|
...
|
|
LL | let _x = LoudDropper;
|
|
| --
|
|
| |
|
|
| `_x` calls a custom destructor
|
|
| `_x` will be dropped later as of Edition 2024
|
|
...
|
|
LL | ));
|
|
| - now the temporary value is dropped here, before the local variables in the block or statement
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
|
|
note: `#1` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
note: `_x` invokes this custom destructor
|
|
--> $DIR/lint-tail-expr-drop-order.rs:10:1
|
|
|
|
|
LL | / impl Drop for LoudDropper {
|
|
... |
|
|
LL | | }
|
|
| |_^
|
|
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages
|
|
|
|
error: aborting due to 8 previous errors
|
|
|