about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-09-30 19:18:50 -0400
committerGitHub <noreply@github.com>2024-09-30 19:18:50 -0400
commit2fe41869c9eea690d3bd94e3de094282ccb7645c (patch)
tree87487a5b996befc18e8b1fbe58b2fab2a5804e23 /library/std/src
parentacaa6cee0754b9a8134e6aa1aa2b28c2670eb20e (diff)
parent24290efafffb83514da4e37f5f42a962d0e9bb1f (diff)
downloadrust-2fe41869c9eea690d3bd94e3de094282ccb7645c.tar.gz
rust-2fe41869c9eea690d3bd94e3de094282ccb7645c.zip
Rollup merge of #130914 - compiler-errors:insignificant-dtor, r=Amanieu
Mark some more types as having insignificant dtor

These were caught by https://github.com/rust-lang/rust/pull/129864#issuecomment-2376658407, which is implementing a lint for some changes in drop order for temporaries in tail expressions.

Specifically, the destructors of `CString` and the bitpacked repr for `std::io::Error` are insignificant insofar as they don't have side-effects on things like locking or synchronization; they just free memory.

See some discussion on #89144 for what makes a drop impl "significant"
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/io/error/repr_bitpacked.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/io/error/repr_bitpacked.rs b/library/std/src/io/error/repr_bitpacked.rs
index 80ba8455df3..a839a2fbac1 100644
--- a/library/std/src/io/error/repr_bitpacked.rs
+++ b/library/std/src/io/error/repr_bitpacked.rs
@@ -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.