about summary refs log tree commit diff
path: root/tests/ui/not-panic
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-01-01 19:35:53 -0800
committerEsteban Küber <esteban@kuber.com.ar>2023-01-11 21:38:56 +0000
commitce83be4af8462d8d6fadb2829c8ca7f4353fca9e (patch)
tree0b460f1c69c465766c34a054ed2dd8e829b01f40 /tests/ui/not-panic
parent2024aa48b4e92894e6f780a13c03db7605e1a5f2 (diff)
downloadrust-ce83be4af8462d8d6fadb2829c8ca7f4353fca9e.tar.gz
rust-ce83be4af8462d8d6fadb2829c8ca7f4353fca9e.zip
Account for type params
Diffstat (limited to 'tests/ui/not-panic')
-rw-r--r--tests/ui/not-panic/not-panic-safe.rs4
-rw-r--r--tests/ui/not-panic/not-panic-safe.stderr15
2 files changed, 12 insertions, 7 deletions
diff --git a/tests/ui/not-panic/not-panic-safe.rs b/tests/ui/not-panic/not-panic-safe.rs
index 4165c5dc13a..1b3c6482ce9 100644
--- a/tests/ui/not-panic/not-panic-safe.rs
+++ b/tests/ui/not-panic/not-panic-safe.rs
@@ -5,6 +5,6 @@ use std::panic::UnwindSafe;
 fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
-    assert::<&mut i32>();
-    //~^ ERROR the type `&mut i32` may not be safely transferred across an unwind boundary
+    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
index 013c5ee7044..37a6aee3906 100644
--- a/tests/ui/not-panic/not-panic-safe.stderr
+++ b/tests/ui/not-panic/not-panic-safe.stderr
@@ -1,16 +1,21 @@
-error[E0277]: the type `&mut i32` may not be safely transferred across an unwind boundary
+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 i32>();
-   |              ^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary
+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 i32`
-   = note: `UnwindSafe` is implemented for `&i32`, but not for `&mut i32`
+   = 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