about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-19 08:15:05 +0100
committerGitHub <noreply@github.com>2024-01-19 08:15:05 +0100
commit332f8f73ea581fd5cb2ee94c1b9ae31dd61d4d67 (patch)
tree56a33d8bd48cb41e8ee6071ffa81c3b030da48ed /library/alloc/src
parent987445cd42f1235c7599db9752f693459de31330 (diff)
parentaeeaed9ce137d489f7157202548d2ce3d65c60ae (diff)
downloadrust-332f8f73ea581fd5cb2ee94c1b9ae31dd61d4d67.tar.gz
rust-332f8f73ea581fd5cb2ee94c1b9ae31dd61d4d67.zip
Rollup merge of #120107 - shepmaster:dead-code-repr-transparent, r=Nilstrieb
dead_code treats #[repr(transparent)] the same as #[repr(C)]

In #92972 we enabled linting on unused fields in tuple structs. In #118297 that lint was enabled by default. That exposed issues like #119659, where the fields of a struct marked `#[repr(transparent)]` were reported by the `dead_code` lint. The language team [decided](https://github.com/rust-lang/rust/issues/119659#issuecomment-1885172045) that the lint should treat `repr(transparent)` the same as `#[repr(C)]`.

Fixes #119659
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/boxed/thin.rs1
1 files changed, 0 insertions, 1 deletions
diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs
index 9463b73b574..f83c8f83cc9 100644
--- a/library/alloc/src/boxed/thin.rs
+++ b/library/alloc/src/boxed/thin.rs
@@ -171,7 +171,6 @@ struct WithHeader<H>(NonNull<u8>, PhantomData<H>);
 /// An opaque representation of `WithHeader<H>` to avoid the
 /// projection invariance of `<T as Pointee>::Metadata`.
 #[repr(transparent)]
-#[allow(dead_code)] // Field only used through `WithHeader` type above.
 struct WithOpaqueHeader(NonNull<u8>);
 
 impl WithOpaqueHeader {