File: tail_expr_drop_order-on-coroutine-unwind.stderr

package info (click to toggle)
rustc 1.89.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 906,624 kB
  • sloc: xml: 158,148; python: 34,888; javascript: 19,595; sh: 19,221; ansic: 13,046; cpp: 7,144; asm: 4,376; makefile: 692; lisp: 174; sql: 15
file content (50 lines) | stat: -rw-r--r-- 2,280 bytes parent folder | download | duplicates (5)
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
error: relative drop order changing in Rust 2024
  --> $DIR/tail_expr_drop_order-on-coroutine-unwind.rs:19:15
   |
LL |         match func().await {
   |               ^^^^^^^-----
   |               |      |
   |               |      this value will be stored in a temporary; let us call it `#3`
   |               |      up until Edition 2021 `#3` is dropped last but will be dropped earlier in Edition 2024
   |               |      this value will be stored in a temporary; let us call it `#1`
   |               |      `#1` will be dropped later as of Edition 2024
   |               this value will be stored in a temporary; let us call it `#2`
   |               up until Edition 2021 `#2` is dropped last but will be dropped earlier in Edition 2024
   |               `__awaitee` calls a custom destructor
   |               `__awaitee` will be dropped later as of Edition 2024
...
LL |             Err(e) => {}
   |                 -
   |                 |
   |                 `e` calls a custom destructor
   |                 `e` will be dropped later as of Edition 2024
LL |         }
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: `#2` invokes this custom destructor
  --> $DIR/tail_expr_drop_order-on-coroutine-unwind.rs:9:1
   |
LL | impl std::ops::Drop for Drop {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `#1` invokes this custom destructor
  --> $DIR/tail_expr_drop_order-on-coroutine-unwind.rs:9:1
   |
LL | impl std::ops::Drop for Drop {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `e` invokes this custom destructor
  --> $DIR/tail_expr_drop_order-on-coroutine-unwind.rs:9:1
   |
LL | impl std::ops::Drop for Drop {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = 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/tail_expr_drop_order-on-coroutine-unwind.rs:6:9
   |
LL | #![deny(tail_expr_drop_order)]
   |         ^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error