Skip to content

Commit

Permalink
Mark some more types as having insignificant dtor
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Sep 27, 2024
1 parent 58420a0 commit 3a6df29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions library/std/src/io/error/repr_bitpacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3a6df29

Please sign in to comment.