diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/const-generics/issues/issue-100313.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/lint/reference_casting.rs (renamed from tests/ui/lint/cast_ref_to_mut.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/lint/reference_casting.stderr (renamed from tests/ui/lint/cast_ref_to_mut.stderr) | 22 |
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/ui/const-generics/issues/issue-100313.stderr b/tests/ui/const-generics/issues/issue-100313.stderr index ffc34a3a41e..17e4850bd12 100644 --- a/tests/ui/const-generics/issues/issue-100313.stderr +++ b/tests/ui/const-generics/issues/issue-100313.stderr @@ -4,7 +4,7 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is LL | *(B as *const bool as *mut bool) = false; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[deny(cast_ref_to_mut)]` on by default + = note: `#[deny(invalid_reference_casting)]` on by default error[E0080]: evaluation of constant value failed --> $DIR/issue-100313.rs:10:13 diff --git a/tests/ui/lint/cast_ref_to_mut.rs b/tests/ui/lint/reference_casting.rs index 745d7070143..745d7070143 100644 --- a/tests/ui/lint/cast_ref_to_mut.rs +++ b/tests/ui/lint/reference_casting.rs diff --git a/tests/ui/lint/cast_ref_to_mut.stderr b/tests/ui/lint/reference_casting.stderr index baff00d6c04..d1dd1b32ff4 100644 --- a/tests/ui/lint/cast_ref_to_mut.stderr +++ b/tests/ui/lint/reference_casting.stderr @@ -1,61 +1,61 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:19:9 + --> $DIR/reference_casting.rs:19:9 | LL | (*(a as *const _ as *mut String)).push_str(" world"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[deny(cast_ref_to_mut)]` on by default + = note: `#[deny(invalid_reference_casting)]` on by default error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:21:9 + --> $DIR/reference_casting.rs:21:9 | LL | *(a as *const _ as *mut _) = String::from("Replaced"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:23:9 + --> $DIR/reference_casting.rs:23:9 | LL | *(a as *const _ as *mut String) += " world"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:25:25 + --> $DIR/reference_casting.rs:25:25 | LL | let _num = &mut *(num as *const i32 as *mut i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:27:25 + --> $DIR/reference_casting.rs:27:25 | LL | let _num = &mut *(num as *const i32).cast_mut(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:29:20 + --> $DIR/reference_casting.rs:29:20 | LL | let _num = *{ num as *const i32 }.cast_mut(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:31:9 + --> $DIR/reference_casting.rs:31:9 | LL | *std::ptr::from_ref(num).cast_mut() += 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:33:9 + --> $DIR/reference_casting.rs:33:9 | LL | *std::ptr::from_ref({ num }).cast_mut() += 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:35:9 + --> $DIR/reference_casting.rs:35:9 | LL | *{ std::ptr::from_ref(num) }.cast_mut() += 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell` - --> $DIR/cast_ref_to_mut.rs:37:9 + --> $DIR/reference_casting.rs:37:9 | LL | *(std::ptr::from_ref({ num }) as *mut i32) += 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
