diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-2.rs (renamed from src/test/ui/not-panic/not-panic-safe-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-2.stderr (renamed from src/test/ui/not-panic/not-panic-safe-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-3.rs (renamed from src/test/ui/not-panic/not-panic-safe-3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-3.stderr (renamed from src/test/ui/not-panic/not-panic-safe-3.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-4.rs (renamed from src/test/ui/not-panic/not-panic-safe-4.rs) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-4.stderr (renamed from src/test/ui/not-panic/not-panic-safe-4.stderr) | 10 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-5.rs (renamed from src/test/ui/not-panic/not-panic-safe-5.rs) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-5.stderr (renamed from src/test/ui/not-panic/not-panic-safe-5.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-6.rs (renamed from src/test/ui/not-panic/not-panic-safe-6.rs) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe-6.stderr (renamed from src/test/ui/not-panic/not-panic-safe-6.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe.rs | 10 | ||||
-rw-r--r-- | tests/ui/not-panic/not-panic-safe.stderr | 22 |
12 files changed, 42 insertions, 0 deletions
diff --git a/src/test/ui/not-panic/not-panic-safe-2.rs b/tests/ui/not-panic/not-panic-safe-2.rs index f3faa7043..f3faa7043 100644 --- a/src/test/ui/not-panic/not-panic-safe-2.rs +++ b/tests/ui/not-panic/not-panic-safe-2.rs diff --git a/src/test/ui/not-panic/not-panic-safe-2.stderr b/tests/ui/not-panic/not-panic-safe-2.stderr index 3b0f83b3b..3b0f83b3b 100644 --- a/src/test/ui/not-panic/not-panic-safe-2.stderr +++ b/tests/ui/not-panic/not-panic-safe-2.stderr diff --git a/src/test/ui/not-panic/not-panic-safe-3.rs b/tests/ui/not-panic/not-panic-safe-3.rs index 21f0c0993..21f0c0993 100644 --- a/src/test/ui/not-panic/not-panic-safe-3.rs +++ b/tests/ui/not-panic/not-panic-safe-3.rs diff --git a/src/test/ui/not-panic/not-panic-safe-3.stderr b/tests/ui/not-panic/not-panic-safe-3.stderr index 9e9a12764..9e9a12764 100644 --- a/src/test/ui/not-panic/not-panic-safe-3.stderr +++ b/tests/ui/not-panic/not-panic-safe-3.stderr diff --git a/src/test/ui/not-panic/not-panic-safe-4.rs b/tests/ui/not-panic/not-panic-safe-4.rs index ba93af5c0..ba93af5c0 100644 --- a/src/test/ui/not-panic/not-panic-safe-4.rs +++ b/tests/ui/not-panic/not-panic-safe-4.rs diff --git a/src/test/ui/not-panic/not-panic-safe-4.stderr b/tests/ui/not-panic/not-panic-safe-4.stderr index fc1c594d0..9428c1256 100644 --- a/src/test/ui/not-panic/not-panic-safe-4.stderr +++ b/tests/ui/not-panic/not-panic-safe-4.stderr @@ -12,6 +12,11 @@ note: required by a bound in `assert` | LL | fn assert<T: UnwindSafe + ?Sized>() {} | ^^^^^^^^^^ required by this bound in `assert` +help: consider removing the leading `&`-reference + | +LL - assert::<&RefCell<i32>>(); +LL + assert::<RefCell<i32>>(); + | error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary --> $DIR/not-panic-safe-4.rs:9:14 @@ -28,6 +33,11 @@ note: required by a bound in `assert` | LL | fn assert<T: UnwindSafe + ?Sized>() {} | ^^^^^^^^^^ required by this bound in `assert` +help: consider removing the leading `&`-reference + | +LL - assert::<&RefCell<i32>>(); +LL + assert::<RefCell<i32>>(); + | error: aborting due to 2 previous errors diff --git a/src/test/ui/not-panic/not-panic-safe-5.rs b/tests/ui/not-panic/not-panic-safe-5.rs index e0d37517d..e0d37517d 100644 --- a/src/test/ui/not-panic/not-panic-safe-5.rs +++ b/tests/ui/not-panic/not-panic-safe-5.rs diff --git a/src/test/ui/not-panic/not-panic-safe-5.stderr b/tests/ui/not-panic/not-panic-safe-5.stderr index cb78370b4..cb78370b4 100644 --- a/src/test/ui/not-panic/not-panic-safe-5.stderr +++ b/tests/ui/not-panic/not-panic-safe-5.stderr diff --git a/src/test/ui/not-panic/not-panic-safe-6.rs b/tests/ui/not-panic/not-panic-safe-6.rs index 4915096dc..4915096dc 100644 --- a/src/test/ui/not-panic/not-panic-safe-6.rs +++ b/tests/ui/not-panic/not-panic-safe-6.rs diff --git a/src/test/ui/not-panic/not-panic-safe-6.stderr b/tests/ui/not-panic/not-panic-safe-6.stderr index 7986e341e..7986e341e 100644 --- a/src/test/ui/not-panic/not-panic-safe-6.stderr +++ b/tests/ui/not-panic/not-panic-safe-6.stderr diff --git a/tests/ui/not-panic/not-panic-safe.rs b/tests/ui/not-panic/not-panic-safe.rs new file mode 100644 index 000000000..1b3c6482c --- /dev/null +++ b/tests/ui/not-panic/not-panic-safe.rs @@ -0,0 +1,10 @@ +#![allow(dead_code)] + +use std::panic::UnwindSafe; + +fn assert<T: UnwindSafe + ?Sized>() {} + +fn main() { + assert::<&mut &mut &i32>(); + //~^ ERROR the type `&mut &mut &i32` may not be safely transferred across an unwind boundary +} diff --git a/tests/ui/not-panic/not-panic-safe.stderr b/tests/ui/not-panic/not-panic-safe.stderr new file mode 100644 index 000000000..37a6aee39 --- /dev/null +++ b/tests/ui/not-panic/not-panic-safe.stderr @@ -0,0 +1,22 @@ +error[E0277]: the type `&mut &mut &i32` may not be safely transferred across an unwind boundary + --> $DIR/not-panic-safe.rs:8:14 + | +LL | assert::<&mut &mut &i32>(); + | ^^^^^^^^^^^^^^ `&mut &mut &i32` may not be safely transferred across an unwind boundary + | + = help: the trait `UnwindSafe` is not implemented for `&mut &mut &i32` + = note: `UnwindSafe` is implemented for `&&mut &i32`, but not for `&mut &mut &i32` +note: required by a bound in `assert` + --> $DIR/not-panic-safe.rs:5:14 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^ required by this bound in `assert` +help: consider removing 2 leading `&`-references + | +LL - assert::<&mut &mut &i32>(); +LL + assert::<&i32>(); + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. |