2020-09-02 07:40:56 +00:00
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2020-04-01 01:10:13 +00:00
--> $DIR/interior-mutability.rs:5:5
2017-06-01 10:16:26 +00:00
|
2018-06-09 23:53:36 +00:00
LL | catch_unwind(|| { x.set(23); });
2020-09-02 07:40:56 +00:00
| ^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2021-06-10 11:52:00 +00:00
|
2020-09-02 07:40:56 +00:00
= help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `Cell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `&Cell<i32>`
2020-09-08 14:43:06 +00:00
= note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35]`
2021-07-31 16:26:55 +00:00
note: required by a bound in `catch_unwind`
--> $SRC_DIR/std/src/panic.rs:LL:COL
|
LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
2017-06-01 10:16:26 +00:00
2017-07-02 13:09:09 +00:00
error: aborting due to previous error
2017-06-01 10:16:26 +00:00
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0277`.