Mark some more types as having insignificant dtor

This commit is contained in:
Michael Goulet 2024-09-26 22:10:04 -04:00
parent a3f76a26e0
commit 7033468a67
2 changed files with 2 additions and 0 deletions

View File

@ -696,6 +696,7 @@ impl CString {
// memory-unsafe code from working by accident. Inline
// to prevent LLVM from optimizing it away in debug builds.
#[stable(feature = "cstring_drop", since = "1.13.0")]
#[rustc_insignificant_dtor]
impl Drop for CString {
#[inline]
fn drop(&mut self) {

View File

@ -124,6 +124,7 @@ const TAG_SIMPLE: usize = 0b11;
/// is_unwind_safe::<std::io::Error>();
/// ```
#[repr(transparent)]
#[rustc_insignificant_dtor]
pub(super) struct Repr(NonNull<()>, PhantomData<ErrorData<Box<Custom>>>);
// All the types `Repr` stores internally are Send + Sync, and so is it.