Skip to content

Commit 9fe3a19

Browse files
committed
Adjust some tests for invalid_reference_casting improvements
1 parent b63c4ab commit 9fe3a19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/cell.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,8 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
18931893
/// on an _exclusive_ `UnsafeCell<T>`. Even though `T` and `UnsafeCell<T>` have the
18941894
/// same memory layout, the following is not allowed and undefined behavior:
18951895
///
1896-
/// ```rust,no_run
1896+
#[cfg_attr(bootstrap, doc = "```rust,no_run")]
1897+
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
18971898
/// # use std::cell::UnsafeCell;
18981899
/// unsafe fn not_allowed<T>(ptr: &UnsafeCell<T>) -> &mut T {
18991900
/// let t = ptr as *const UnsafeCell<T> as *mut T;

0 commit comments

Comments
 (0)