New lint: dangling_pointers_from_temporaries
This commit is contained in:
@@ -304,6 +304,7 @@ pub use once::OnceCell;
|
||||
/// ```
|
||||
///
|
||||
/// See the [module-level documentation](self) for more.
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "Cell")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[repr(transparent)]
|
||||
#[rustc_pub_transparent]
|
||||
|
||||
@@ -464,7 +464,9 @@ impl CStr {
|
||||
/// behavior when `ptr` is used inside the `unsafe` block:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![allow(unused_must_use)] #![allow(temporary_cstring_as_ptr)]
|
||||
/// # #![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:
|
||||
|
||||
Reference in New Issue
Block a user