Skip to content

Commit 417d387

Browse files
author
Ype Kingma
committed
Need unsafe block in unsafe block
1 parent 9a8d09c commit 417d387

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/ui/lifetimes_bound_nested_ref_expl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'a, 'b> Extend1<'a, 'b> for <&'b &'a () as Trait1>::Type1 {
4949
unsafe fn deinit_slice_mut<'a, 'b, T>(s: &'a mut &'b mut [T]) -> &'a mut &'b mut [MaybeUninit<T>] {
5050
let s: *mut &mut [T] = s;
5151
let s = s as *mut &mut [MaybeUninit<T>];
52-
&mut *s
52+
unsafe {&mut *s}
5353
}
5454

5555
// test case for unnamed references.

tests/ui/lifetimes_bound_nested_ref_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a: 'b, 'b> Extend1<'a, 'b> for <&'b &'a () as Trait1>::Type1 {
5151
unsafe fn deinit_slice_mut<'a, 'b: 'a, T>(s: &'a mut &'b mut [T]) -> &'a mut &'b mut [MaybeUninit<T>] {
5252
let s: *mut &mut [T] = s;
5353
let s = s as *mut &mut [MaybeUninit<T>];
54-
&mut *s
54+
unsafe {&mut *s}
5555
}
5656

5757
// test case for unnamed references.

0 commit comments

Comments
 (0)