Skip to content

Commit

Permalink
Oh, yeah, #[cfg(bootstrap)] exists
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Aug 23, 2024
1 parent 408681b commit 56036ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 1 addition & 6 deletions library/alloc/tests/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ use core::mem::MaybeUninit;
use core::ptr::NonNull;

#[test]
// FIXME(GrigorenkoPV)
#[allow(
unknown_lints,
reason = "`dangling_pointers_from_temporaries` does not exist at stage 0 yet"
)]
#[allow(dangling_pointers_from_temporaries)]
#[cfg_attr(not(bootstrap), expect(dangling_pointers_from_temporaries))]
fn uninitialized_zero_size_box() {
assert_eq!(
&*Box::<()>::new_uninit() as *const _,
Expand Down
4 changes: 3 additions & 1 deletion library/core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ impl CStr {
/// behavior when `ptr` is used inside the `unsafe` block:
///
/// ```no_run
/// # #![allow(unused_must_use)] #![allow(dangling_pointers_from_temporaries)]
/// # #![allow(unused_must_use)]
/// # #![cfg_attr(bootstrap, expect(temporary_cstring_as_ptr))]
/// # #![cfg_attr(not(bootstrap), expect(dangling_pointers_from_temporaries))]
/// use std::ffi::CString;
///
/// // Do not do this:
Expand Down

0 comments on commit 56036ea

Please sign in to comment.