File tree 3 files changed +5
-1
lines changed
3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use core::mem::MaybeUninit;
4
4
use core:: ptr:: NonNull ;
5
5
6
6
#[ test]
7
+ #[ cfg_attr( not( bootstrap) , expect( dangling_pointers_from_temporaries) ) ]
7
8
fn uninitialized_zero_size_box ( ) {
8
9
assert_eq ! (
9
10
& * Box :: <( ) >:: new_uninit( ) as * const _,
Original file line number Diff line number Diff line change @@ -304,6 +304,7 @@ pub use once::OnceCell;
304
304
/// ```
305
305
///
306
306
/// See the [module-level documentation](self) for more.
307
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "Cell" ) ]
307
308
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
308
309
#[ repr( transparent) ]
309
310
#[ rustc_pub_transparent]
Original file line number Diff line number Diff line change @@ -464,7 +464,9 @@ impl CStr {
464
464
/// behavior when `ptr` is used inside the `unsafe` block:
465
465
///
466
466
/// ```no_run
467
- /// # #![allow(unused_must_use)] #![allow(temporary_cstring_as_ptr)]
467
+ /// # #![allow(unused_must_use)]
468
+ /// # #![cfg_attr(bootstrap, expect(temporary_cstring_as_ptr))]
469
+ /// # #![cfg_attr(not(bootstrap), expect(dangling_pointers_from_temporaries))]
468
470
/// use std::ffi::CString;
469
471
///
470
472
/// // Do not do this:
You can’t perform that action at this time.
0 commit comments