diff options
| author | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2022-07-25 22:36:03 +0200 |
|---|---|---|
| committer | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2022-08-03 12:17:23 +0200 |
| commit | e3c7e04a4430942205872a8ed3c67531f22985bc (patch) | |
| tree | 895cfbea996b14bae6ceb61d30e55d1c539cdc0c /src/test/codegen-units | |
| parent | e141246cbbce2a6001f3181d3d0f661bbfd9c7ea (diff) | |
| download | rust-e3c7e04a4430942205872a8ed3c67531f22985bc.tar.gz rust-e3c7e04a4430942205872a8ed3c67531f22985bc.zip | |
Warn about dead tuple struct fields
Diffstat (limited to 'src/test/codegen-units')
3 files changed, 8 insertions, 8 deletions
diff --git a/src/test/codegen-units/item-collection/generic-drop-glue.rs b/src/test/codegen-units/item-collection/generic-drop-glue.rs index 25cf5dad614..6df4ff7e58b 100644 --- a/src/test/codegen-units/item-collection/generic-drop-glue.rs +++ b/src/test/codegen-units/item-collection/generic-drop-glue.rs @@ -34,9 +34,9 @@ enum EnumNoDrop<T1, T2> { } -struct NonGenericNoDrop(i32); +struct NonGenericNoDrop(#[allow(unused_tuple_struct_fields)] i32); -struct NonGenericWithDrop(i32); +struct NonGenericWithDrop(#[allow(unused_tuple_struct_fields)] i32); //~ MONO_ITEM fn std::ptr::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal] impl Drop for NonGenericWithDrop { diff --git a/src/test/codegen-units/item-collection/transitive-drop-glue.rs b/src/test/codegen-units/item-collection/transitive-drop-glue.rs index 8249e7cba94..e286c800b7c 100644 --- a/src/test/codegen-units/item-collection/transitive-drop-glue.rs +++ b/src/test/codegen-units/item-collection/transitive-drop-glue.rs @@ -6,9 +6,9 @@ #![feature(start)] //~ MONO_ITEM fn std::ptr::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal] -struct Root(Intermediate); +struct Root(#[allow(unused_tuple_struct_fields)] Intermediate); //~ MONO_ITEM fn std::ptr::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal] -struct Intermediate(Leaf); +struct Intermediate(#[allow(unused_tuple_struct_fields)] Leaf); //~ MONO_ITEM fn std::ptr::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal] struct Leaf; @@ -17,9 +17,9 @@ impl Drop for Leaf { fn drop(&mut self) {} } -struct RootGen<T>(IntermediateGen<T>); -struct IntermediateGen<T>(LeafGen<T>); -struct LeafGen<T>(T); +struct RootGen<T>(#[allow(unused_tuple_struct_fields)] IntermediateGen<T>); +struct IntermediateGen<T>(#[allow(unused_tuple_struct_fields)] LeafGen<T>); +struct LeafGen<T>(#[allow(unused_tuple_struct_fields)] T); impl<T> Drop for LeafGen<T> { fn drop(&mut self) {} diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/src/test/codegen-units/item-collection/unsizing.rs index 81675377941..111a7231209 100644 --- a/src/test/codegen-units/item-collection/unsizing.rs +++ b/src/test/codegen-units/item-collection/unsizing.rs @@ -40,7 +40,7 @@ impl Trait for u32 { } #[derive(Clone, Copy)] -struct Wrapper<T: ?Sized>(*const T); +struct Wrapper<T: ?Sized>(#[allow(unused_tuple_struct_fields)] *const T); impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Wrapper<U>> for Wrapper<T> {} |
