about summary refs log tree commit diff
path: root/tests/ui/drop/tail-expr-drop-order-negative.edition2024.stderr
blob: 2c0b238eb5f20cf636bd94be3694112ed9bc16a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
error[E0716]: temporary value dropped while borrowed
  --> $DIR/tail-expr-drop-order-negative.rs:8:15
   |
LL |     x.replace(std::cell::RefCell::new(123).borrow()).is_some()
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                   - temporary value is freed at the end of this statement
   |               |
   |               creates a temporary value which is freed while still in use
LL |
LL | }
   | - borrow might be used here, when `x` is dropped and runs the destructor for type `Option<Ref<'_, i32>>`
   |
   = note: consider using a `let` binding to create a longer lived value

error: aborting due to 1 previous error

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