Skip to content

Commit 6a9c487

Browse files
authored
Rollup merge of rust-lang#120107 - shepmaster:dead-code-repr-transparent, r=Nilstrieb
dead_code treats #[repr(transparent)] the same as #[repr(C)] In rust-lang#92972 we enabled linting on unused fields in tuple structs. In rust-lang#118297 that lint was enabled by default. That exposed issues like rust-lang#119659, where the fields of a struct marked `#[repr(transparent)]` were reported by the `dead_code` lint. The language team [decided](rust-lang#119659 (comment)) that the lint should treat `repr(transparent)` the same as `#[repr(C)]`. Fixes rust-lang#119659
2 parents 37643b8 + b6d5f45 commit 6a9c487

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

alloc/src/boxed/thin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ struct WithHeader<H>(NonNull<u8>, PhantomData<H>);
171171
/// An opaque representation of `WithHeader<H>` to avoid the
172172
/// projection invariance of `<T as Pointee>::Metadata`.
173173
#[repr(transparent)]
174-
#[allow(dead_code)] // Field only used through `WithHeader` type above.
175174
struct WithOpaqueHeader(NonNull<u8>);
176175

177176
impl WithOpaqueHeader {

0 commit comments

Comments
 (0)