diff options
| author | Jake Goulding <jake.goulding@gmail.com> | 2023-12-27 17:11:58 -0500 |
|---|---|---|
| committer | Jake Goulding <jake.goulding@gmail.com> | 2024-01-02 15:34:37 -0500 |
| commit | 53eca9fa877460973f29aca24e6636a4175df469 (patch) | |
| tree | b574f39908fef034b675c7e6da5be4a72ec6ab5f /tests/ui | |
| parent | 5772818dc8f4c5a0fec1f5b35b33e85764dcd4f4 (diff) | |
| download | rust-53eca9fa877460973f29aca24e6636a4175df469.tar.gz rust-53eca9fa877460973f29aca24e6636a4175df469.zip | |
Adjust compiler tests for unused_tuple_struct_fields -> dead_code
Diffstat (limited to 'tests/ui')
163 files changed, 215 insertions, 201 deletions
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs index 28926243390..2323cf46d6f 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs @@ -74,7 +74,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! { extern "C" fn rust_eh_personality() {} #[derive(Default, Debug)] -struct Page(#[allow(unused_tuple_struct_fields)] [[u64; 32]; 16]); +struct Page(#[allow(dead_code)] [[u64; 32]; 16]); #[no_mangle] fn main(_argc: i32, _argv: *const *const u8) -> isize { diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs index 56409e71339..488434a9a72 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs @@ -61,7 +61,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! { extern "C" fn rust_eh_personality() {} #[derive(Default, Debug)] -struct Page(#[allow(unused_tuple_struct_fields)] [[u64; 32]; 16]); +struct Page(#[allow(dead_code)] [[u64; 32]; 16]); #[no_mangle] fn main(_argc: i32, _argv: *const *const u8) -> isize { diff --git a/tests/ui/array-slice-vec/show-boxed-slice.rs b/tests/ui/array-slice-vec/show-boxed-slice.rs index c10f779b1f6..3ae3686e423 100644 --- a/tests/ui/array-slice-vec/show-boxed-slice.rs +++ b/tests/ui/array-slice-vec/show-boxed-slice.rs @@ -1,7 +1,7 @@ // run-pass #[derive(Debug)] -struct Foo(#[allow(unused_tuple_struct_fields)] Box<[u8]>); +struct Foo(#[allow(dead_code)] Box<[u8]>); pub fn main() { println!("{:?}", Foo(Box::new([0, 1, 2]))); diff --git a/tests/ui/associated-consts/associated-const-type-parameters.rs b/tests/ui/associated-consts/associated-const-type-parameters.rs index e7ead1045e6..b62d47458be 100644 --- a/tests/ui/associated-consts/associated-const-type-parameters.rs +++ b/tests/ui/associated-consts/associated-const-type-parameters.rs @@ -17,7 +17,7 @@ impl Foo for Def { const X: i32 = 97; } -struct Proxy<T>(#[allow(unused_tuple_struct_fields)] T); +struct Proxy<T>(#[allow(dead_code)] T); impl<T: Foo> Foo for Proxy<T> { const X: i32 = T::X; diff --git a/tests/ui/associated-types/associated-types-method.rs b/tests/ui/associated-types/associated-types-method.rs index 45df3ac20c2..6a6456cbbec 100644 --- a/tests/ui/associated-types/associated-types-method.rs +++ b/tests/ui/associated-types/associated-types-method.rs @@ -5,7 +5,7 @@ trait Device { type Resources; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Foo<D, R>(D, R); trait Tr { diff --git a/tests/ui/associated-types/associated-types-struct-field-numbered.rs b/tests/ui/associated-types/associated-types-struct-field-numbered.rs index 8612911d8f8..b71b71b25f5 100644 --- a/tests/ui/associated-types/associated-types-struct-field-numbered.rs +++ b/tests/ui/associated-types/associated-types-struct-field-numbered.rs @@ -9,7 +9,7 @@ pub trait UnifyKey { fn dummy(&self) { } } -pub struct Node<K:UnifyKey>(#[allow(unused_tuple_struct_fields)] K, K::Value); +pub struct Node<K:UnifyKey>(#[allow(dead_code)] K, K::Value); fn foo<K : UnifyKey<Value=Option<V>>,V : Clone>(node: &Node<K>) -> Option<V> { node.1.clone() diff --git a/tests/ui/associated-types/issue-25700-1.rs b/tests/ui/associated-types/issue-25700-1.rs index 5e71a52ba4e..79652dc882b 100644 --- a/tests/ui/associated-types/issue-25700-1.rs +++ b/tests/ui/associated-types/issue-25700-1.rs @@ -1,5 +1,5 @@ // run-pass -struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] Option<&'static T>); +struct S<T: 'static>(#[allow(dead_code)] Option<&'static T>); trait Tr { type Out; } impl<T> Tr for T { type Out = T; } diff --git a/tests/ui/associated-types/issue-25700-2.rs b/tests/ui/associated-types/issue-25700-2.rs index 89b1db496f9..f745da4a5cb 100644 --- a/tests/ui/associated-types/issue-25700-2.rs +++ b/tests/ui/associated-types/issue-25700-2.rs @@ -3,9 +3,9 @@ pub trait Parser { type Input; } -pub struct Iter<P: Parser>(#[allow(unused_tuple_struct_fields)] P, P::Input); +pub struct Iter<P: Parser>(#[allow(dead_code)] P, P::Input); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] pub struct Map<P, F>(P, F); impl<P, F> Parser for Map<P, F> where F: FnMut(P) { type Input = u8; diff --git a/tests/ui/associated-types/issue-25700.rs b/tests/ui/associated-types/issue-25700.rs index e5b9a97523d..a377e37349d 100644 --- a/tests/ui/associated-types/issue-25700.rs +++ b/tests/ui/associated-types/issue-25700.rs @@ -1,4 +1,4 @@ -struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] Option<&'static T>); +struct S<T: 'static>(#[allow(dead_code)] Option<&'static T>); trait Tr { type Out; } impl<T> Tr for T { type Out = T; } diff --git a/tests/ui/async-await/async-fn-size-moved-locals.rs b/tests/ui/async-await/async-fn-size-moved-locals.rs index 79b7239f359..fb64bb6db63 100644 --- a/tests/ui/async-await/async-fn-size-moved-locals.rs +++ b/tests/ui/async-await/async-fn-size-moved-locals.rs @@ -17,7 +17,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; const BIG_FUT_SIZE: usize = 1024; -struct BigFut(#[allow(unused_tuple_struct_fields)] [u8; BIG_FUT_SIZE]); +struct BigFut(#[allow(dead_code)] [u8; BIG_FUT_SIZE]); impl BigFut { fn new() -> Self { diff --git a/tests/ui/async-await/async-fn-size-uninit-locals.rs b/tests/ui/async-await/async-fn-size-uninit-locals.rs index 54617269354..fee3e27cfb8 100644 --- a/tests/ui/async-await/async-fn-size-uninit-locals.rs +++ b/tests/ui/async-await/async-fn-size-uninit-locals.rs @@ -17,7 +17,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; const BIG_FUT_SIZE: usize = 1024; -struct Big(#[allow(unused_tuple_struct_fields)] [u8; BIG_FUT_SIZE]); +struct Big(#[allow(dead_code)] [u8; BIG_FUT_SIZE]); impl Big { fn new() -> Self { diff --git a/tests/ui/auto-traits/auto-traits.rs b/tests/ui/auto-traits/auto-traits.rs index 7b52d9c176e..6d8e1a52ec1 100644 --- a/tests/ui/auto-traits/auto-traits.rs +++ b/tests/ui/auto-traits/auto-traits.rs @@ -9,7 +9,7 @@ unsafe auto trait AutoUnsafe {} impl !Auto for bool {} impl !AutoUnsafe for bool {} -struct AutoBool(#[allow(unused_tuple_struct_fields)] bool); +struct AutoBool(#[allow(dead_code)] bool); impl Auto for AutoBool {} unsafe impl AutoUnsafe for AutoBool {} diff --git a/tests/ui/bench/issue-32062.rs b/tests/ui/bench/issue-32062.rs index 7eb52196e16..99b8b7c6012 100644 --- a/tests/ui/bench/issue-32062.rs +++ b/tests/ui/bench/issue-32062.rs @@ -15,7 +15,7 @@ trait Parser { } } -struct Token<T>(#[allow(unused_tuple_struct_fields)] T::Item) where T: Iterator; +struct Token<T>(#[allow(dead_code)] T::Item) where T: Iterator; impl<T> Parser for Token<T> where T: Iterator { type Input = T; @@ -25,7 +25,7 @@ impl<T> Parser for Token<T> where T: Iterator { } } -struct Chain<L, R>(#[allow(unused_tuple_struct_fields)] L, #[allow(unused_tuple_struct_fields)] R); +struct Chain<L, R>(#[allow(dead_code)] L, #[allow(dead_code)] R); impl<L, R> Parser for Chain<L, R> where L: Parser, R: Parser<Input = L::Input> { type Input = L::Input; diff --git a/tests/ui/binding/match-tag.rs b/tests/ui/binding/match-tag.rs index 407716aa28a..6914a1c6b6d 100644 --- a/tests/ui/binding/match-tag.rs +++ b/tests/ui/binding/match-tag.rs @@ -3,7 +3,7 @@ #![allow(non_camel_case_types)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), diff --git a/tests/ui/binding/or-pattern.rs b/tests/ui/binding/or-pattern.rs index 47623a3d722..07559e414dc 100644 --- a/tests/ui/binding/or-pattern.rs +++ b/tests/ui/binding/or-pattern.rs @@ -1,7 +1,7 @@ // run-pass #![allow(non_camel_case_types)] -enum blah { a(isize, isize, #[allow(unused_tuple_struct_fields)] usize), b(isize, isize), c, } +enum blah { a(isize, isize, #[allow(dead_code)] usize), b(isize, isize), c, } fn or_alt(q: blah) -> isize { match q { blah::a(x, y, _) | blah::b(x, y) => { return x + y; } blah::c => { return 0; } } diff --git a/tests/ui/binding/simple-generic-match.rs b/tests/ui/binding/simple-generic-match.rs index 2cf050d011d..acac32b8231 100644 --- a/tests/ui/binding/simple-generic-match.rs +++ b/tests/ui/binding/simple-generic-match.rs @@ -3,6 +3,6 @@ // pretty-expanded FIXME #23616 -enum clam<T> { a(#[allow(unused_tuple_struct_fields)] T), } +enum clam<T> { a(#[allow(dead_code)] T), } pub fn main() { let c = clam::a(2); match c { clam::a::<isize>(_) => { } } } diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs b/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs index cdde48871ea..2edc52c6f55 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs @@ -12,7 +12,7 @@ use trait_superkinds_in_metadata::RequiresCopy; use std::marker; #[derive(Copy, Clone)] -struct X<T>(#[allow(unused_tuple_struct_fields)] T); +struct X<T>(#[allow(dead_code)] T); impl<T:Sync> RequiresShare for X<T> { } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed index b74b5e94e2b..e8ca5ccdc54 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed @@ -51,10 +51,10 @@ fn test_sync_trait() { } /* Test Clone Trait Migration */ -struct S(Foo); +struct S(#[allow(dead_code)] Foo); struct T(i32); -struct U(S, T); +struct U(#[allow(dead_code)] S, T); impl Clone for U { fn clone(&self) -> Self { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs index e4965e33cc1..fb464b7f1e1 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs @@ -51,10 +51,10 @@ fn test_sync_trait() { } /* Test Clone Trait Migration */ -struct S(Foo); +struct S(#[allow(dead_code)] Foo); struct T(i32); -struct U(S, T); +struct U(#[allow(dead_code)] S, T); impl Clone for U { fn clone(&self) -> Self { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed index bde8c749731..7c4e5c0f9a5 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed @@ -18,10 +18,10 @@ impl Foo { } } -struct S(#[allow(unused_tuple_struct_fields)] Foo); +struct S(#[allow(dead_code)] Foo); #[derive(Clone)] -struct T(#[allow(unused_tuple_struct_fields)] i32); +struct T(#[allow(dead_code)] i32); struct U(S, T); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs index 584c52ea134..f979db11b7e 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs @@ -18,10 +18,10 @@ impl Foo { } } -struct S(#[allow(unused_tuple_struct_fields)] Foo); +struct S(#[allow(dead_code)] Foo); #[derive(Clone)] -struct T(#[allow(unused_tuple_struct_fields)] i32); +struct T(#[allow(dead_code)] i32); struct U(S, T); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed index e99dbb5ab3a..672aa4be686 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed @@ -13,7 +13,7 @@ impl Drop for Foo { } #[derive(Debug)] -struct ConstainsDropField(Foo, #[allow(unused_tuple_struct_fields)] Foo); +struct ConstainsDropField(Foo, #[allow(dead_code)] Foo); // `t` needs Drop because one of its elements needs drop, // therefore precise capture might affect drop ordering diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs index 62a984c9eeb..9c751064688 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs @@ -13,7 +13,7 @@ impl Drop for Foo { } #[derive(Debug)] -struct ConstainsDropField(Foo, #[allow(unused_tuple_struct_fields)] Foo); +struct ConstainsDropField(Foo, #[allow(dead_code)] Foo); // `t` needs Drop because one of its elements needs drop, // therefore precise capture might affect drop ordering diff --git a/tests/ui/codegen/issue-16602-3.rs b/tests/ui/codegen/issue-16602-3.rs index ca1ab3cc7fe..2307cfb81c7 100644 --- a/tests/ui/codegen/issue-16602-3.rs +++ b/tests/ui/codegen/issue-16602-3.rs @@ -2,7 +2,7 @@ #![allow(unused_variables)] #![allow(unused_assignments)] #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum Foo { Bar(u32, u32), Baz(&'static u32, &'static u32) diff --git a/tests/ui/coercion/issue-14589.rs b/tests/ui/coercion/issue-14589.rs index d35ee5c731e..f92385f8d72 100644 --- a/tests/ui/coercion/issue-14589.rs +++ b/tests/ui/coercion/issue-14589.rs @@ -20,5 +20,5 @@ impl<T> Test<T> { } trait Foo { fn dummy(&self) { }} -struct Output(#[allow(unused_tuple_struct_fields)] isize); +struct Output(#[allow(dead_code)] isize); impl Foo for Output {} diff --git a/tests/ui/const-generics/const-argument-cross-crate.rs b/tests/ui/const-generics/const-argument-cross-crate.rs index 5693409e992..ff9cebdf7ec 100644 --- a/tests/ui/const-generics/const-argument-cross-crate.rs +++ b/tests/ui/const-generics/const-argument-cross-crate.rs @@ -4,7 +4,7 @@ extern crate const_generic_lib; -struct Container(#[allow(unused_tuple_struct_fields)] const_generic_lib::Alias); +struct Container(#[allow(dead_code)] const_generic_lib::Alias); fn main() { let res = const_generic_lib::function(const_generic_lib::Struct([14u8, 1u8, 2u8])); diff --git a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs index b839008d424..3bc72fe7faa 100644 --- a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs +++ b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs @@ -16,7 +16,7 @@ impl BlockCipher for BarCipher { const BLOCK_SIZE: usize = 32; } -pub struct Block<C>(#[allow(unused_tuple_struct_fields)] C); +pub struct Block<C>(#[allow(dead_code)] C); pub fn test<C: BlockCipher, const M: usize>() where diff --git a/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs b/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs index b385406b020..b4f44dac62d 100644 --- a/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs +++ b/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs @@ -9,7 +9,7 @@ trait Foo { const ASSOC: usize = 1; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Iced<T: Foo>(T, [(); T::ASSOC]) where [(); T::ASSOC]: ; diff --git a/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs b/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs index 216d29c7cd4..d6d0a80ab11 100644 --- a/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs +++ b/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs @@ -9,7 +9,7 @@ trait Foo { const ASSOC: usize = 1; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Iced<T: Foo>(T, [(); T::ASSOC]) where [(); T::ASSOC]: ; diff --git a/tests/ui/consts/assoc-const.rs b/tests/ui/consts/assoc-const.rs index f542f2dcb52..021bcb40102 100644 --- a/tests/ui/consts/assoc-const.rs +++ b/tests/ui/consts/assoc-const.rs @@ -6,7 +6,7 @@ trait Nat { } struct Zero; -struct Succ<N>(#[allow(unused_tuple_struct_fields)] N); +struct Succ<N>(#[allow(dead_code)] N); impl Nat for Zero { const VALUE: usize = 0; diff --git a/tests/ui/consts/const-needs_drop.rs b/tests/ui/consts/const-needs_drop.rs index 11ee7084ce8..bf622e38939 100644 --- a/tests/ui/consts/const-needs_drop.rs +++ b/tests/ui/consts/const-needs_drop.rs @@ -2,10 +2,10 @@ use std::mem; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Trivial(u8, f32); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct NonTrivial(u8, String); const CONST_U8: bool = mem::needs_drop::<u8>(); diff --git a/tests/ui/consts/const-size_of_val-align_of_val.rs b/tests/ui/consts/const-size_of_val-align_of_val.rs index e8323e4ae60..cd678176761 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val.rs +++ b/tests/ui/consts/const-size_of_val-align_of_val.rs @@ -5,7 +5,7 @@ use std::{mem, ptr}; -struct Foo(#[allow(unused_tuple_struct_fields)] u32); +struct Foo(#[allow(dead_code)] u32); #[derive(Clone, Copy)] struct Bar { diff --git a/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs b/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs index 03e91f2b3b1..436a2d0de74 100644 --- a/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs +++ b/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs @@ -1,7 +1,7 @@ // run-pass // Eventually this will be rejected (when the future-compat lints are turned into hard errors), and // then this test can be removed. But meanwhile we should ensure that this works and does not ICE. -struct NoDerive(i32); +struct NoDerive(#[allow(dead_code)] i32); #[derive(PartialEq)] struct WrapEmbedded(*const NoDerive); diff --git a/tests/ui/consts/const_in_pattern/warn_corner_cases.rs b/tests/ui/consts/const_in_pattern/warn_corner_cases.rs index 15cf3c84d85..d23d85335f8 100644 --- a/tests/ui/consts/const_in_pattern/warn_corner_cases.rs +++ b/tests/ui/consts/const_in_pattern/warn_corner_cases.rs @@ -15,7 +15,7 @@ #![warn(indirect_structural_match)] #[derive(Copy, Clone, Debug)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] u32); +struct NoDerive(#[allow(dead_code)] u32); // This impl makes `NoDerive` irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs b/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs index dd56faa3185..f82ec005a01 100644 --- a/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs +++ b/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs @@ -1,7 +1,7 @@ // run-pass const HASH_LEN: usize = 20; -struct Hash(#[allow(unused_tuple_struct_fields)] [u8; HASH_LEN]); +struct Hash(#[allow(dead_code)] [u8; HASH_LEN]); fn init_hash(_: &mut [u8; HASH_LEN]) {} fn foo<'a>() -> &'a () { diff --git a/tests/ui/consts/promoted_const_call4.rs b/tests/ui/consts/promoted_const_call4.rs index 82a17b7bf86..bb97957179f 100644 --- a/tests/ui/consts/promoted_const_call4.rs +++ b/tests/ui/consts/promoted_const_call4.rs @@ -4,7 +4,7 @@ use std::sync::atomic::*; static FLAG: AtomicBool = AtomicBool::new(false); -struct NoisyDrop(&'static str); +struct NoisyDrop(#[allow(dead_code)] &'static str); impl Drop for NoisyDrop { fn drop(&mut self) { FLAG.store(true, Ordering::SeqCst); diff --git a/tests/ui/consts/rvalue-static-promotion.rs b/tests/ui/consts/rvalue-static-promotion.rs index c48d9eae928..f42e8b70593 100644 --- a/tests/ui/consts/rvalue-static-promotion.rs +++ b/tests/ui/consts/rvalue-static-promotion.rs @@ -4,7 +4,7 @@ use std::cell::Cell; const NONE_CELL_STRING: Option<Cell<String>> = None; -struct Foo<T>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T>(#[allow(dead_code)] T); impl<T> Foo<T> { const FOO: Option<Box<T>> = None; } diff --git a/tests/ui/consts/transmute-const.rs b/tests/ui/consts/transmute-const.rs index c5c3dfc4cc7..65e5700d083 100644 --- a/tests/ui/consts/transmute-const.rs +++ b/tests/ui/consts/transmute-const.rs @@ -3,7 +3,7 @@ use std::mem; #[repr(transparent)] -struct Foo(#[allow(unused_tuple_struct_fields)] u32); +struct Foo(#[allow(dead_code)] u32); const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) }; diff --git a/tests/ui/coroutine/size-moved-locals.rs b/tests/ui/coroutine/size-moved-locals.rs index 10f988cc066..fa657e3b275 100644 --- a/tests/ui/coroutine/size-moved-locals.rs +++ b/tests/ui/coroutine/size-moved-locals.rs @@ -18,7 +18,7 @@ use std::ops::Coroutine; const FOO_SIZE: usize = 1024; -struct Foo(#[allow(unused_tuple_struct_fields)] [u8; FOO_SIZE]); +struct Foo(#[allow(dead_code)] [u8; FOO_SIZE]); impl Drop for Foo { fn drop(&mut self) {} diff --git a/tests/ui/derive-uninhabited-enum-38885.rs b/tests/ui/derive-uninhabited-enum-38885.rs index 0089453ef0f..c11df030025 100644 --- a/tests/ui/derive-uninhabited-enum-38885.rs +++ b/tests/ui/derive-uninhabited-enum-38885.rs @@ -9,7 +9,7 @@ enum Void {} #[derive(Debug)] enum Foo { - Bar(u8), + Bar(#[allow(dead_code)] u8), Void(Void), //~ WARN variant `Void` is never constructed } diff --git a/tests/ui/derive-uninhabited-enum-38885.stderr b/tests/ui/derive-uninhabited-enum-38885.stderr index 3fabf446dc3..bcd8f6b7b53 100644 --- a/tests/ui/derive-uninhabited-enum-38885.stderr +++ b/tests/ui/derive-uninhabited-enum-38885.stderr @@ -3,7 +3,7 @@ warning: variant `Void` is never constructed | LL | enum Foo { | --- variant in this enum -LL | Bar(u8), +LL | Bar(#[allow(dead_code)] u8), LL | Void(Void), | ^^^^ | diff --git a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs index 3480ccc1089..331d7298216 100644 --- a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs +++ b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs @@ -2,7 +2,7 @@ // pretty-expanded FIXME #23616 #[derive(Clone)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T>(T, ()); pub fn main() { diff --git a/tests/ui/deriving/deriving-copyclone.rs b/tests/ui/deriving/deriving-copyclone.rs index f8403b1feac..099feceae81 100644 --- a/tests/ui/deriving/deriving-copyclone.rs +++ b/tests/ui/deriving/deriving-copyclone.rs @@ -23,7 +23,7 @@ impl Clone for Liar { /// This struct is actually Copy... at least, it thinks it is! #[derive(Copy, Clone)] -struct Innocent(#[allow(unused_tuple_struct_fields)] Liar); +struct Innocent(#[allow(dead_code)] Liar); impl Innocent { fn new() -> Self { diff --git a/tests/ui/deriving/issue-58319.rs b/tests/ui/deriving/issue-58319.rs index 8041bd5bb3c..754f5032d16 100644 --- a/tests/ui/deriving/issue-58319.rs +++ b/tests/ui/deriving/issue-58319.rs @@ -3,7 +3,7 @@ fn main() {} #[derive(Clone)] pub struct Little; #[derive(Clone)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] pub struct Big( Little, Little, diff --git a/tests/ui/drop/dropck-eyepatch-reorder.rs b/tests/ui/drop/dropck-eyepatch-reorder.rs index 0d7af3d4f61..4a56c45aa92 100644 --- a/tests/ui/drop/dropck-eyepatch-reorder.rs +++ b/tests/ui/drop/dropck-eyepatch-reorder.rs @@ -12,10 +12,10 @@ trait Foo { fn foo(&self, _: &str); } struct Dt<A: Foo>(&'static str, A); struct Dr<'a, B:'a+Foo>(&'static str, &'a B); -struct Pt<A: Foo, B: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A, B); -struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B, &'b B); -struct St<A: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A); -struct Sr<'a, B:'a+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B); +struct Pt<A: Foo, B: Foo>(&'static str, #[allow(dead_code)] A, B); +struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(dead_code)] &'a B, &'b B); +struct St<A: Foo>(&'static str, #[allow(dead_code)] A); +struct Sr<'a, B:'a+Foo>(&'static str, #[allow(dead_code)] &'a B); impl<A: Foo> Drop for Dt<A> { fn drop(&mut self) { println!("drop {}", self.0); self.1.foo(self.0); } diff --git a/tests/ui/drop/dropck-eyepatch.rs b/tests/ui/drop/dropck-eyepatch.rs index 3c4840d5c7a..ff5a52b906b 100644 --- a/tests/ui/drop/dropck-eyepatch.rs +++ b/tests/ui/drop/dropck-eyepatch.rs @@ -35,10 +35,10 @@ trait Foo { fn foo(&self, _: &str); } struct Dt<A: Foo>(&'static str, A); struct Dr<'a, B:'a+Foo>(&'static str, &'a B); -struct Pt<A,B: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A, B); -struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B, &'b B); -struct St<A: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A); -struct Sr<'a, B:'a+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B); +struct Pt<A,B: Foo>(&'static str, #[allow(dead_code)] A, B); +struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(dead_code)] &'a B, &'b B); +struct St<A: Foo>(&'static str, #[allow(dead_code)] A); +struct Sr<'a, B:'a+Foo>(&'static str, #[allow(dead_code)] &'a B); impl<A: Foo> Drop for Dt<A> { fn drop(&mut self) { println!("drop {}", self.0); self.1.foo(self.0); } diff --git a/tests/ui/drop/dynamic-drop.rs b/tests/ui/drop/dynamic-drop.rs index d35913ed641..4745cceb516 100644 --- a/tests/ui/drop/dynamic-drop.rs +++ b/tests/ui/drop/dynamic-drop.rs @@ -103,7 +103,7 @@ fn dynamic_drop(a: &Allocator, c: bool) { }; } -struct TwoPtrs<'a>(Ptr<'a>, #[allow(unused_tuple_struct_fields)] Ptr<'a>); +struct TwoPtrs<'a>(Ptr<'a>, #[allow(dead_code)] Ptr<'a>); fn struct_dynamic_drop(a: &Allocator, c0: bool, c1: bool, c: bool) { for i in 0..2 { let x; diff --git a/tests/ui/dropck/issue-24805-dropck-itemless.rs b/tests/ui/dropck/issue-24805-dropck-itemless.rs index 45761b61c3e..4d71389351b 100644 --- a/tests/ui/dropck/issue-24805-dropck-itemless.rs +++ b/tests/ui/dropck/issue-24805-dropck-itemless.rs @@ -19,7 +19,7 @@ impl<'a, T> UserDefined for &'a T { } // ``` macro_rules! impl_drop { ($Bound:ident, $Id:ident) => { - struct $Id<T: $Bound>(#[allow(unused_tuple_struct_fields)] T); + struct $Id<T: $Bound>(#[allow(dead_code)] T); unsafe impl <#[may_dangle] T: $Bound> Drop for $Id<T> { fn drop(&mut self) { } } diff --git a/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs b/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs index 04d0d32033a..d2b620f6940 100644 --- a/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs +++ b/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs @@ -21,7 +21,7 @@ impl Drop for ScribbleOnDrop { } } -struct Foo<T>(u32, T, #[allow(unused_tuple_struct_fields)] Box<for <'r> fn(&'r T) -> String>); +struct Foo<T>(u32, T, #[allow(dead_code)] Box<for <'r> fn(&'r T) -> String>); unsafe impl<#[may_dangle] T> Drop for Foo<T> { fn drop(&mut self) { diff --git a/tests/ui/dyn-star/drop.rs b/tests/ui/dyn-star/drop.rs index 1478498c0a9..1acfe2f2d1c 100644 --- a/tests/ui/dyn-star/drop.rs +++ b/tests/ui/dyn-star/drop.rs @@ -6,7 +6,7 @@ use std::fmt::Debug; #[derive(Debug)] -struct Foo(usize); +struct Foo(#[allow(dead_code)] usize); impl Drop for Foo { fn drop(&mut self) { diff --git a/tests/ui/enum-discriminant/discriminant_value-wrapper.rs b/tests/ui/enum-discriminant/discriminant_value-wrapper.rs index 8e162d5c455..1f6bb0cdc3a 100644 --- a/tests/ui/enum-discriminant/discriminant_value-wrapper.rs +++ b/tests/ui/enum-discriminant/discriminant_value-wrapper.rs @@ -4,7 +4,7 @@ use std::mem; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum ADT { First(u32, u32), Second(u64) diff --git a/tests/ui/enum-discriminant/discriminant_value.rs b/tests/ui/enum-discriminant/discriminant_value.rs index f3dfac298ad..2864cd40da0 100644 --- a/tests/ui/enum-discriminant/discriminant_value.rs +++ b/tests/ui/enum-discriminant/discriminant_value.rs @@ -27,14 +27,14 @@ enum CLike3 { D } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum ADT { First(u32, u32), Second(u64) } enum NullablePointer { - Something(#[allow(unused_tuple_struct_fields)] &'static u32), + Something(#[allow(dead_code)] &'static u32), Nothing } diff --git a/tests/ui/generics/generic-default-type-params-cross-crate.rs b/tests/ui/generics/generic-default-type-params-cross-crate.rs index 834b15be1c5..f798901132b 100644 --- a/tests/ui/generics/generic-default-type-params-cross-crate.rs +++ b/tests/ui/generics/generic-default-type-params-cross-crate.rs @@ -5,7 +5,7 @@ extern crate default_type_params_xc; -struct Vec<T, A = default_type_params_xc::Heap>(#[allow(unused_tuple_struct_fields)] Option<(T,A)>); +struct Vec<T, A = default_type_params_xc::Heap>(#[allow(dead_code)] Option<(T,A)>); struct Foo; diff --git a/tests/ui/generics/generic-ivec-leak.rs b/tests/ui/generics/generic-ivec-leak.rs index 9610bdcb338..7a1d10a646d 100644 --- a/tests/ui/generics/generic-ivec-leak.rs +++ b/tests/ui/generics/generic-ivec-leak.rs @@ -1,5 +1,5 @@ // run-pass #![allow(non_camel_case_types)] -enum wrapper<T> { wrapped(#[allow(unused_tuple_struct_fields)] T), } +enum wrapper<T> { wrapped(#[allow(dead_code)] T), } pub fn main() { let _w = wrapper::wrapped(vec![1, 2, 3, 4, 5]); } diff --git a/tests/ui/generics/generic-newtype-struct.rs b/tests/ui/generics/generic-newtype-struct.rs index aa879f01a58..92523b76f98 100644 --- a/tests/ui/generics/generic-newtype-struct.rs +++ b/tests/ui/generics/generic-newtype-struct.rs @@ -1,7 +1,7 @@ // run-pass // pretty-expanded FIXME #23616 -struct S<T>(#[allow(unused_tuple_struct_fields)] T); +struct S<T>(#[allow(dead_code)] T); pub fn main() { let _s = S(2); diff --git a/tests/ui/generics/generic-no-mangle.fixed b/tests/ui/generics/generic-no-mangle.fixed index 501acb6e163..aa6d6310f5f 100644 --- a/tests/ui/generics/generic-no-mangle.fixed +++ b/tests/ui/generics/generic-no-mangle.fixed @@ -76,7 +76,7 @@ impl<T> Trait2<T> for Foo { fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled } -pub struct Bar<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Bar<T>(#[allow(dead_code)] T); impl<T> Bar<T> { @@ -111,7 +111,7 @@ impl<T> Trait3 for Bar<T> { fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled } -pub struct Baz<'a>(#[allow(unused_tuple_struct_fields)] &'a i32); +pub struct Baz<'a>(#[allow(dead_code)] &'a i32); impl<'a> Baz<'a> { #[no_mangle] diff --git a/tests/ui/generics/generic-no-mangle.rs b/tests/ui/generics/generic-no-mangle.rs index 74e407078e8..8a59ca75aaf 100644 --- a/tests/ui/generics/generic-no-mangle.rs +++ b/tests/ui/generics/generic-no-mangle.rs @@ -76,7 +76,7 @@ impl<T> Trait2<T> for Foo { fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled } -pub struct Bar<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Bar<T>(#[allow(dead_code)] T); impl<T> Bar<T> { #[no_mangle] @@ -111,7 +111,7 @@ impl<T> Trait3 for Bar<T> { fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled } -pub struct Baz<'a>(#[allow(unused_tuple_struct_fields)] &'a i32); +pub struct Baz<'a>(#[allow(dead_code)] &'a i32); impl<'a> Baz<'a> { #[no_mangle] diff --git a/tests/ui/generics/generic-recursive-tag.rs b/tests/ui/generics/generic-recursive-tag.rs index b344da1c7dd..5490822975a 100644 --- a/tests/ui/generics/generic-recursive-tag.rs +++ b/tests/ui/generics/generic-recursive-tag.rs @@ -1,7 +1,7 @@ // run-pass #![allow(non_camel_case_types)] -enum list<T> { #[allow(unused_tuple_struct_fields)] cons(Box<T>, Box<list<T>>), nil, } +enum list<T> { #[allow(dead_code)] cons(Box<T>, Box<list<T>>), nil, } pub fn main() { let _a: list<isize> = diff --git a/tests/ui/generics/generic-tag-corruption.rs b/tests/ui/generics/generic-tag-corruption.rs index 35de3c1f712..ae20a94d9fd 100644 --- a/tests/ui/generics/generic-tag-corruption.rs +++ b/tests/ui/generics/generic-tag-corruption.rs @@ -5,6 +5,6 @@ // This used to cause memory corruption in stage 0. // pretty-expanded FIXME #23616 -enum thing<K> { some(#[allow(unused_tuple_struct_fields)] K), } +enum thing<K> { some(#[allow(dead_code)] K), } pub fn main() { let _x = thing::some("hi".to_string()); } diff --git a/tests/ui/generics/generic-tag-local.rs b/tests/ui/generics/generic-tag-local.rs index c5772e84193..121ec74f8b7 100644 --- a/tests/ui/generics/generic-tag-local.rs +++ b/tests/ui/generics/generic-tag-local.rs @@ -3,6 +3,6 @@ // pretty-expanded FIXME #23616 -enum clam<T> { a(#[allow(unused_tuple_struct_fields)] T), } +enum clam<T> { a(#[allow(dead_code)] T), } pub fn main() { let _c = clam::a(3); } diff --git a/tests/ui/generics/generic-tag.rs b/tests/ui/generics/generic-tag.rs index 31fc2178d6d..9e844c72552 100644 --- a/tests/ui/generics/generic-tag.rs +++ b/tests/ui/generics/generic-tag.rs @@ -6,7 +6,7 @@ #![allow(unused_variables)] -enum option<T> { some(#[allow(unused_tuple_struct_fields)] Box<T>), none, } +enum option<T> { some(#[allow(dead_code)] Box<T>), none, } pub fn main() { let mut a: option<isize> = option::some::<isize>(Box::new(10)); diff --git a/tests/ui/impl-trait/bounds_regression.rs b/tests/ui/impl-trait/bounds_regression.rs index f32d83c0c40..89b0e3c55f9 100644 --- a/tests/ui/impl-trait/bounds_regression.rs +++ b/tests/ui/impl-trait/bounds_regression.rs @@ -15,7 +15,7 @@ pub fn future_from_coroutine< GenFuture(x) } -struct GenFuture<T: FakeCoroutine<Yield = ()>>(#[allow(unused_tuple_struct_fields)] T); +struct GenFuture<T: FakeCoroutine<Yield = ()>>(#[allow(dead_code)] T); impl<T: FakeCoroutine<Yield = ()>> FakeFuture for GenFuture<T> { type Output = T::Return; diff --git a/tests/ui/inference/issue-36053.rs b/tests/ui/inference/issue-36053.rs index 5c6d0780416..8eee1c33b0e 100644 --- a/tests/ui/inference/issue-36053.rs +++ b/tests/ui/inference/issue-36053.rs @@ -7,7 +7,7 @@ use std::iter::FusedIterator; -struct Thing<'a>(#[allow(unused_tuple_struct_fields)] &'a str); +struct Thing<'a>(#[allow(dead_code)] &'a str); impl<'a> Iterator for Thing<'a> { type Item = &'a str; fn next(&mut self) -> Option<&'a str> { diff --git a/tests/ui/issues/issue-13027.rs b/tests/ui/issues/issue-13027.rs index 64bf2a11d0e..ac0d1f11bd7 100644 --- a/tests/ui/issues/issue-13027.rs +++ b/tests/ui/issues/issue-13027.rs @@ -164,7 +164,7 @@ fn range_shadow_multi_pats() { fn misc() { enum Foo { - Bar(#[allow(unused_tuple_struct_fields)] usize, bool) + Bar(#[allow(dead_code)] usize, bool) } // This test basically mimics how trace_macros! macro is implemented, // which is a rare combination of vector patterns, multiple wild-card diff --git a/tests/ui/issues/issue-14382.rs b/tests/ui/issues/issue-14382.rs index dca24d0be8a..b5c2362f05c 100644 --- a/tests/ui/issues/issue-14382.rs +++ b/tests/ui/issues/issue-14382.rs @@ -1,6 +1,6 @@ // run-pass #[derive(Debug)] -struct Matrix4<S>(#[allow(unused_tuple_struct_fields)] S); +struct Matrix4<S>(#[allow(dead_code)] S); trait POrd<S> {} fn translate<S: POrd<S>>(s: S) -> Matrix4<S> { Matrix4(s) } diff --git a/tests/ui/issues/issue-15858.rs b/tests/ui/issues/issue-15858.rs index 8d65afc4883..77941c07671 100644 --- a/tests/ui/issues/issue-15858.rs +++ b/tests/ui/issues/issue-15858.rs @@ -12,7 +12,7 @@ impl Bar for BarImpl { } -struct Foo<B: Bar>(#[allow(unused_tuple_struct_fields)] B); +struct Foo<B: Bar>(#[allow(dead_code)] B); impl<B: Bar> Drop for Foo<B> { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-17905.rs b/tests/ui/issues/issue-17905.rs index dae9648b917..83cea8b4395 100644 --- a/tests/ui/issues/issue-17905.rs +++ b/tests/ui/issues/issue-17905.rs @@ -1,7 +1,7 @@ // run-pass #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Pair<T, V> (T, V); impl Pair< diff --git a/tests/ui/issues/issue-23491.rs b/tests/ui/issues/issue-23491.rs index e5f9dd3efbd..efd83112353 100644 --- a/tests/ui/issues/issue-23491.rs +++ b/tests/ui/issues/issue-23491.rs @@ -1,7 +1,7 @@ // run-pass #![allow(unused_variables)] -struct Node<T: ?Sized>(#[allow(unused_tuple_struct_fields)] T); +struct Node<T: ?Sized>(#[allow(dead_code)] T); fn main() { let x: Box<Node<[isize]>> = Box::new(Node([])); diff --git a/tests/ui/issues/issue-24308.rs b/tests/ui/issues/issue-24308.rs index 4a582c68efc..40950938fc7 100644 --- a/tests/ui/issues/issue-24308.rs +++ b/tests/ui/issues/issue-24308.rs @@ -4,7 +4,7 @@ pub trait Foo { fn method2(); } -struct Slice<'a, T: 'a>(#[allow(unused_tuple_struct_fields)] &'a [T]); +struct Slice<'a, T: 'a>(#[allow(dead_code)] &'a [T]); impl<'a, T: 'a> Foo for Slice<'a, T> { fn method2() { diff --git a/tests/ui/issues/issue-25089.rs b/tests/ui/issues/issue-25089.rs index c988f8f55fa..c7063b24608 100644 --- a/tests/ui/issues/issue-25089.rs +++ b/tests/ui/issues/issue-25089.rs @@ -4,7 +4,7 @@ use std::thread; -struct Foo(#[allow(unused_tuple_struct_fields)] i32); +struct Foo(#[allow(dead_code)] i32); impl Drop for Foo { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-25679.rs b/tests/ui/issues/issue-25679.rs index b548da98888..8415eba887b 100644 --- a/tests/ui/issues/issue-25679.rs +++ b/tests/ui/issues/issue-25679.rs @@ -2,7 +2,7 @@ trait Device { type Resources; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Foo<D, R>(D, R); impl<D: Device> Foo<D, D::Resources> { diff --git a/tests/ui/issues/issue-26127.rs b/tests/ui/issues/issue-26127.rs index f3f9c1d9ae8..b76f1ba51a4 100644 --- a/tests/ui/issues/issue-26127.rs +++ b/tests/ui/issues/issue-26127.rs @@ -1,7 +1,7 @@ // run-pass trait Tr { type T; } impl Tr for u8 { type T=(); } -struct S<I: Tr>(#[allow(unused_tuple_struct_fields)] I::T); +struct S<I: Tr>(#[allow(dead_code)] I::T); fn foo<I: Tr>(i: I::T) { S::<I>(i); diff --git a/tests/ui/issues/issue-26641.rs b/tests/ui/issues/issue-26641.rs index e08edd0b5cb..3256b71660f 100644 --- a/tests/ui/issues/issue-26641.rs +++ b/tests/ui/issues/issue-26641.rs @@ -1,5 +1,5 @@ // run-pass -struct Parser<'a>(#[allow(unused_tuple_struct_fields)] Box<dyn FnMut(Parser) + 'a>); +struct Parser<'a>(#[allow(dead_code)] Box<dyn FnMut(Parser) + 'a>); fn main() { let _x = Parser(Box::new(|_|{})); diff --git a/tests/ui/issues/issue-26709.rs b/tests/ui/issues/issue-26709.rs index 1bd2651dd6c..8a8186de5cc 100644 --- a/tests/ui/issues/issue-26709.rs +++ b/tests/ui/issues/issue-26709.rs @@ -1,5 +1,5 @@ // run-pass -struct Wrapper<'a, T: ?Sized>(&'a mut i32, #[allow(unused_tuple_struct_fields)] T); +struct Wrapper<'a, T: ?Sized>(&'a mut i32, #[allow(dead_code)] T); impl<'a, T: ?Sized> Drop for Wrapper<'a, T> { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-27240.rs b/tests/ui/issues/issue-27240.rs index eaf254f3361..b518e58d194 100644 --- a/tests/ui/issues/issue-27240.rs +++ b/tests/ui/issues/issue-27240.rs @@ -2,12 +2,12 @@ #![allow(unused_assignments)] #![allow(unused_variables)] use std::fmt; -struct NoisyDrop<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] T); +struct NoisyDrop<T: fmt::Debug>(#[allow(dead_code)] T); impl<T: fmt::Debug> Drop for NoisyDrop<T> { fn drop(&mut self) {} } -struct Bar<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] [*const NoisyDrop<T>; 2]); +struct Bar<T: fmt::Debug>(#[allow(dead_code)] [*const NoisyDrop<T>; 2]); fn fine() { let (u,b); @@ -15,7 +15,7 @@ fn fine() { b = Bar([&NoisyDrop(&u), &NoisyDrop(&u)]); } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Bar2<T: fmt::Debug>(*const NoisyDrop<T>, *const NoisyDrop<T>); fn lolwut() { diff --git a/tests/ui/issues/issue-28498-must-work-ex1.rs b/tests/ui/issues/issue-28498-must-work-ex1.rs index ab6d190e0a1..37234699893 100644 --- a/tests/ui/issues/issue-28498-must-work-ex1.rs +++ b/tests/ui/issues/issue-28498-must-work-ex1.rs @@ -6,7 +6,7 @@ use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); fn main() { let mut data = Vec::new(); diff --git a/tests/ui/issues/issue-28498-must-work-ex2.rs b/tests/ui/issues/issue-28498-must-work-ex2.rs index 378d736ee3d..ab0b7196082 100644 --- a/tests/ui/issues/issue-28498-must-work-ex2.rs +++ b/tests/ui/issues/issue-28498-must-work-ex2.rs @@ -6,7 +6,7 @@ use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); struct Foo<T> { data: Vec<T> } diff --git a/tests/ui/issues/issue-28498-ugeh-ex1.rs b/tests/ui/issues/issue-28498-ugeh-ex1.rs index 24bf706cef9..ce49cf1ff99 100644 --- a/tests/ui/issues/issue-28498-ugeh-ex1.rs +++ b/tests/ui/issues/issue-28498-ugeh-ex1.rs @@ -8,7 +8,7 @@ #![feature(dropck_eyepatch)] use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); struct Foo<T> { data: Vec<T> } diff --git a/tests/ui/issues/issue-31267-additional.rs b/tests/ui/issues/issue-31267-additional.rs index 7f0cbd658f1..c6e93533e7c 100644 --- a/tests/ui/issues/issue-31267-additional.rs +++ b/tests/ui/issues/issue-31267-additional.rs @@ -6,7 +6,7 @@ struct Bar; const BAZ: Bar = Bar; #[derive(Debug)] -struct Foo(#[allow(unused_tuple_struct_fields)] [Bar; 1]); +struct Foo(#[allow(dead_code)] [Bar; 1]); struct Biz; diff --git a/tests/ui/issues/issue-31299.rs b/tests/ui/issues/issue-31299.rs index 78c3252d32e..e3c422cb97c 100644 --- a/tests/ui/issues/issue-31299.rs +++ b/tests/ui/issues/issue-31299.rs @@ -25,9 +25,9 @@ impl<T> Front for Vec<T> { type Back = Vec<T>; } -struct PtrBack<T: Front>(#[allow(unused_tuple_struct_fields)] Vec<T::Back>); +struct PtrBack<T: Front>(#[allow(dead_code)] Vec<T::Back>); -struct M(#[allow(unused_tuple_struct_fields)] PtrBack<Vec<M>>); +struct M(#[allow(dead_code)] PtrBack<Vec<M>>); #[allow(unused_must_use)] fn main() { diff --git a/tests/ui/issues/issue-34571.rs b/tests/ui/issues/issue-34571.rs index 5498091da58..c392f59d8da 100644 --- a/tests/ui/issues/issue-34571.rs +++ b/tests/ui/issues/issue-34571.rs @@ -1,7 +1,7 @@ // run-pass #[repr(u8)] enum Foo { - Foo(#[allow(unused_tuple_struct_fields)] u8), + Foo(#[allow(dead_code)] u8), } fn main() { diff --git a/tests/ui/issues/issue-36278-prefix-nesting.rs b/tests/ui/issues/issue-36278-prefix-nesting.rs index a809f7f1329..5f476932018 100644 --- a/tests/ui/issues/issue-36278-prefix-nesting.rs +++ b/tests/ui/issues/issue-36278-prefix-nesting.rs @@ -5,7 +5,7 @@ use std::mem; const SZ: usize = 100; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct P<T: ?Sized>([u8; SZ], T); type Ack<T> = P<P<T>>; diff --git a/tests/ui/issues/issue-4252.rs b/tests/ui/issues/issue-4252.rs index 0d47a7f0c16..9b82121baa2 100644 --- a/tests/ui/issues/issue-4252.rs +++ b/tests/ui/issues/issue-4252.rs @@ -7,7 +7,7 @@ trait X { } #[derive(Debug)] -struct Y(#[allow(unused_tuple_struct_fields)] isize); +struct Y(#[allow(dead_code)] isize); #[derive(Debug)] struct Z<T: X+std::fmt::Debug> { diff --git a/tests/ui/issues/issue-46069.rs b/tests/ui/issues/issue-46069.rs index c418128c186..f80ea932001 100644 --- a/tests/ui/issues/issue-46069.rs +++ b/tests/ui/issues/issue-46069.rs @@ -2,7 +2,7 @@ use std::iter::{Fuse, Cloned}; use std::slice::Iter; -struct Foo<'a, T: 'a>(#[allow(unused_tuple_struct_fields)] &'a T); +struct Foo<'a, T: 'a>(#[allow(dead_code)] &'a T); impl<'a, T: 'a> Copy for Foo<'a, T> {} impl<'a, T: 'a> Clone for Foo<'a, T> { fn clone(&self) -> Self { *self } diff --git a/tests/ui/issues/issue-5315.rs b/tests/ui/issues/issue-5315.rs index 0c121a5eee6..81d075a98a9 100644 --- a/tests/ui/issues/issue-5315.rs +++ b/tests/ui/issues/issue-5315.rs @@ -1,7 +1,7 @@ // run-pass // pretty-expanded FIXME #23616 -struct A(#[allow(unused_tuple_struct_fields)] bool); +struct A(#[allow(dead_code)] bool); pub fn main() { let f = A; diff --git a/tests/ui/issues/issue-61894.rs b/tests/ui/issues/issue-61894.rs index 776fdbb7466..fe934bdeb60 100644 --- a/tests/ui/issues/issue-61894.rs +++ b/tests/ui/issues/issue-61894.rs @@ -4,7 +4,7 @@ use std::any::type_name; -struct Bar<M>(#[allow(unused_tuple_struct_fields)] M); +struct Bar<M>(#[allow(dead_code)] M); impl<M> Bar<M> { fn foo(&self) -> &'static str { diff --git a/tests/ui/issues/issue-7911.rs b/tests/ui/issues/issue-7911.rs index f64887136ca..d4db3b0776b 100644 --- a/tests/ui/issues/issue-7911.rs +++ b/tests/ui/issues/issue-7911.rs @@ -6,7 +6,7 @@ trait FooBar { fn dummy(&self) { } } -struct Bar(#[allow(unused_tuple_struct_fields)] i32); +struct Bar(#[allow(dead_code)] i32); struct Foo { bar: Bar } impl FooBar for Bar {} diff --git a/tests/ui/issues/issue-99838.rs b/tests/ui/issues/issue-99838.rs index 2e81d5e8221..3bddca43daa 100644 --- a/tests/ui/issues/issue-99838.rs +++ b/tests/ui/issues/issue-99838.rs @@ -2,7 +2,7 @@ use std::hint; -struct U16(u16); +struct U16(#[allow(dead_code)] u16); impl Drop for U16 { fn drop(&mut self) { @@ -23,7 +23,7 @@ struct Wrapper { } #[repr(packed)] -struct Misalign(u8, Wrapper); +struct Misalign(#[allow(dead_code)] u8, Wrapper); fn main() { let m = Misalign( diff --git a/tests/ui/layout/unsafe-cell-hides-niche.rs b/tests/ui/layout/unsafe-cell-hides-niche.rs index 68bcc3c1aff..8d6cea10933 100644 --- a/tests/ui/layout/unsafe-cell-hides-niche.rs +++ b/tests/ui/layout/unsafe-cell-hides-niche.rs @@ -14,10 +14,10 @@ use std::mem::size_of; use std::num::NonZeroU32 as N32; use std::sync::{Mutex, RwLock}; -struct Wrapper<T>(#[allow(unused_tuple_struct_fields)] T); +struct Wrapper<T>(#[allow(dead_code)] T); #[repr(transparent)] -struct Transparent<T>(#[allow(unused_tuple_struct_fields)] T); +struct Transparent<T>(#[allow(dead_code)] T); struct NoNiche<T>(UnsafeCell<T>); diff --git a/tests/ui/lint/dead-code/lint-dead-code-1.rs b/tests/ui/lint/dead-code/lint-dead-code-1.rs index 8f5a4c41ef2..ddcafedf7bc 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-1.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-1.rs @@ -37,7 +37,7 @@ struct UsedStruct1 { #[allow(dead_code)] x: isize } -struct UsedStruct2(isize); +struct UsedStruct2(#[allow(dead_code)] isize); struct UsedStruct3; pub struct UsedStruct4; // this struct is never used directly, but its method is, so we don't want diff --git a/tests/ui/lint/dead-code/lint-dead-code-5.rs b/tests/ui/lint/dead-code/lint-dead-code-5.rs index ed90fb46429..76067d114a1 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-5.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-5.rs @@ -2,12 +2,12 @@ #![deny(dead_code)] enum Enum1 { - Variant1(isize), + Variant1(#[allow(dead_code)] isize), Variant2 //~ ERROR: variant `Variant2` is never constructed } enum Enum2 { - Variant3(bool), + Variant3(#[allow(dead_code)] bool), #[allow(dead_code)] Variant4(isize), Variant5 { _x: isize }, //~ ERROR: variants `Variant5` and `Variant6` are never constructed @@ -15,7 +15,7 @@ enum Enum2 { _Variant7, Variant8 { _field: bool }, Variant9, - Variant10(usize) + Variant10(#[allow(dead_code)] usize) } impl Enum2 { diff --git a/tests/ui/lint/dead-code/lint-dead-code-5.stderr b/tests/ui/lint/dead-code/lint-dead-code-5.stderr index eaf43e45361..a583f234a3d 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-5.stderr +++ b/tests/ui/lint/dead-code/lint-dead-code-5.stderr @@ -3,7 +3,7 @@ error: variant `Variant2` is never constructed | LL | enum Enum1 { | ----- variant in this enum -LL | Variant1(isize), +LL | Variant1(#[allow(dead_code)] isize), LL | Variant2 | ^^^^^^^^ | diff --git a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs index a478153b3f4..942c5516500 100644 --- a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs +++ b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs @@ -17,7 +17,7 @@ struct Bar { // Issue 119267: this should not ICE. #[derive(Debug)] -struct Foo(usize, #[allow(unused)] usize); +struct Foo(usize, #[allow(unused)] usize); //~ WARN field `0` is never read fn main() { Bar { diff --git a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr index 0e5c78a7167..06f9b229c18 100644 --- a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr +++ b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr @@ -51,5 +51,19 @@ note: the lint level is defined here LL | #[forbid(dead_code)] | ^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +warning: field `0` is never read + --> $DIR/multiple-dead-codes-in-the-same-struct.rs:20:12 + | +LL | struct Foo(usize, #[allow(unused)] usize); + | --- ^^^^^ + | | + | field in this struct + | + = note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis +help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field + | +LL | struct Foo((), #[allow(unused)] usize); + | ~~ + +error: aborting due to 2 previous errors; 2 warnings emitted diff --git a/tests/ui/lint/dead-code/tuple-struct-field.rs b/tests/ui/lint/dead-code/tuple-struct-field.rs index 14fb30be949..d13fe029289 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.rs +++ b/tests/ui/lint/dead-code/tuple-struct-field.rs @@ -1,4 +1,4 @@ -#![deny(unused_tuple_struct_fields)] +#![deny(dead_code)] //~^ NOTE: the lint level is defined here use std::marker::PhantomData; diff --git a/tests/ui/lint/dead-code/tuple-struct-field.stderr b/tests/ui/lint/dead-code/tuple-struct-field.stderr index b8ad5cbe4e9..0154d5489f9 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.stderr +++ b/tests/ui/lint/dead-code/tuple-struct-field.stderr @@ -9,8 +9,8 @@ LL | struct SingleUnused(i32, [u8; LEN], String); note: the lint level is defined here --> $DIR/tuple-struct-field.rs:1:9 | -LL | #![deny(unused_tuple_struct_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(dead_code)] + | ^^^^^^^^^ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | LL | struct SingleUnused(i32, (), String); diff --git a/tests/ui/lint/dead-code/with-impl.rs b/tests/ui/lint/dead-code/with-impl.rs index 812fcdd09b6..147ec7b9e2e 100644 --- a/tests/ui/lint/dead-code/with-impl.rs +++ b/tests/ui/lint/dead-code/with-impl.rs @@ -2,7 +2,7 @@ #![deny(dead_code)] -pub struct GenericFoo<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct GenericFoo<T>(#[allow(dead_code)] T); type Foo = GenericFoo<u32>; diff --git a/tests/ui/lint/unused/issue-104397.rs b/tests/ui/lint/unused/issue-104397.rs index 94e15cd96bc..c17e532c17f 100644 --- a/tests/ui/lint/unused/issue-104397.rs +++ b/tests/ui/lint/unused/issue-104397.rs @@ -3,7 +3,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait {} impl Trait for for<'a> fn(Inv<'a>) {} diff --git a/tests/ui/lint/unused/issue-105061-should-lint.rs b/tests/ui/lint/unused/issue-105061-should-lint.rs index 7e4e0947349..433c2882089 100644 --- a/tests/ui/lint/unused/issue-105061-should-lint.rs +++ b/tests/ui/lint/unused/issue-105061-should-lint.rs @@ -1,7 +1,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait<'a> {} impl<'b> Trait<'b> for for<'a> fn(Inv<'a>) {} diff --git a/tests/ui/lint/unused/issue-105061.rs b/tests/ui/lint/unused/issue-105061.rs index 92d636d0ac6..6043daf209d 100644 --- a/tests/ui/lint/unused/issue-105061.rs +++ b/tests/ui/lint/unused/issue-105061.rs @@ -1,7 +1,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait {} impl Trait for (for<'a> fn(Inv<'a>),) {} diff --git a/tests/ui/list.rs b/tests/ui/list.rs index ffe9f93860a..e44c94b3219 100644 --- a/tests/ui/list.rs +++ b/tests/ui/list.rs @@ -3,7 +3,7 @@ #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 -enum list { #[allow(unused_tuple_struct_fields)] cons(isize, Box<list>), nil, } +enum list { #[allow(dead_code)] cons(isize, Box<list>), nil, } pub fn main() { list::cons(10, Box::new(list::cons(11, Box::new(list::cons(12, Box::new(list::nil)))))); diff --git a/tests/ui/macros/html-literals.rs b/tests/ui/macros/html-literals.rs index 26f00fed9c4..e5ff425041a 100644 --- a/tests/ui/macros/html-literals.rs +++ b/tests/ui/macros/html-literals.rs @@ -88,7 +88,7 @@ pub fn main() { ); } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum HTMLFragment { tag(String, Vec<HTMLFragment> ), text(String), diff --git a/tests/ui/macros/macro-tt-followed-by-seq.rs b/tests/ui/macros/macro-tt-followed-by-seq.rs index 080dbcfdd41..67238df8524 100644 --- a/tests/ui/macros/macro-tt-followed-by-seq.rs +++ b/tests/ui/macros/macro-tt-followed-by-seq.rs @@ -5,7 +5,7 @@ use self::Join::*; #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum Join<A,B> { Keep(A,B), Skip(A,B), diff --git a/tests/ui/methods/method-argument-inference-associated-type.rs b/tests/ui/methods/method-argument-inference-associated-type.rs index a3c31fab1c2..852747d06b5 100644 --- a/tests/ui/methods/method-argument-inference-associated-type.rs +++ b/tests/ui/methods/method-argument-inference-associated-type.rs @@ -7,7 +7,7 @@ pub trait Service { fn call(&self, _req: Self::Request); } -pub struct S<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct S<T>(#[allow(dead_code)] T); impl Service for ClientMap { type Request = S<Box<dyn Fn(i32)>>; diff --git a/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs b/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs index ec41b711709..787191a26fb 100644 --- a/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs +++ b/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs @@ -15,7 +15,7 @@ trait MyTrait1 { impl MyTrait1 for Foo<u32> {} -struct Foo<T>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T>(#[allow(dead_code)] T); impl Deref for Foo<()> { type Target = dyn MyTrait1 + 'static; @@ -33,7 +33,7 @@ trait MyTrait2 { } impl MyTrait2 for u32 {} -struct Bar<T>(#[allow(unused_tuple_struct_fields)] T, u32); +struct Bar<T>(#[allow(dead_code)] T, u32); impl Deref for Bar<u8> { type Target = dyn MyTrait2 + 'static; fn deref(&self) -> &(dyn MyTrait2 + 'static) { diff --git a/tests/ui/mir/mir_codegen_switch.rs b/tests/ui/mir/mir_codegen_switch.rs index 9c93499d948..afdcd36f4bc 100644 --- a/tests/ui/mir/mir_codegen_switch.rs +++ b/tests/ui/mir/mir_codegen_switch.rs @@ -1,7 +1,7 @@ // run-pass enum Abc { - A(#[allow(unused_tuple_struct_fields)] u8), - B(#[allow(unused_tuple_struct_fields)] i8), + A(#[allow(dead_code)] u8), + B(#[allow(dead_code)] i8), C, D, } diff --git a/tests/ui/mir/mir_fat_ptr.rs b/tests/ui/mir/mir_fat_ptr.rs index 7c3e07c9e34..0c07fba6e94 100644 --- a/tests/ui/mir/mir_fat_ptr.rs +++ b/tests/ui/mir/mir_fat_ptr.rs @@ -1,7 +1,7 @@ // run-pass // test that ordinary fat pointer operations work. -struct Wrapper<T: ?Sized>(#[allow(unused_tuple_struct_fields)] u32, T); +struct Wrapper<T: ?Sized>(#[allow(dead_code)] u32, T); struct FatPtrContainer<'a> { ptr: &'a [u8] diff --git a/tests/ui/mir/mir_raw_fat_ptr.rs b/tests/ui/mir/mir_raw_fat_ptr.rs index f4a9afd2308..8e5a2043dc6 100644 --- a/tests/ui/mir/mir_raw_fat_ptr.rs +++ b/tests/ui/mir/mir_raw_fat_ptr.rs @@ -105,7 +105,7 @@ impl<T> Foo for T { } } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T:?Sized>(u32, T); fn main_ref() { diff --git a/tests/ui/mir/mir_refs_correct.rs b/tests/ui/mir/mir_refs_correct.rs index 6cd9526b749..c5b57f52743 100644 --- a/tests/ui/mir/mir_refs_correct.rs +++ b/tests/ui/mir/mir_refs_correct.rs @@ -3,7 +3,7 @@ extern crate mir_external_refs as ext; -struct S(#[allow(unused_tuple_struct_fields)] u8); +struct S(#[allow(dead_code)] u8); #[derive(Debug, PartialEq, Eq)] struct Unit; @@ -46,7 +46,7 @@ impl<I, O> T<I, O> for O {} impl X for S {} enum E { - U(#[allow(unused_tuple_struct_fields)] u8) + U(#[allow(dead_code)] u8) } #[derive(PartialEq, Debug, Eq)] diff --git a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed index 63b65ab20fe..b8eeb3d5cae 100644 --- a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed +++ b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed @@ -4,7 +4,7 @@ macro_rules! my_wrapper { ($expr:expr) => { MyWrapper($expr) } } -pub struct MyWrapper(u32); +pub struct MyWrapper(#[allow(dead_code)] u32); fn main() { let value = MyWrapper(123); diff --git a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs index 2ab4e3955f3..54a13c67350 100644 --- a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs +++ b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs @@ -4,7 +4,7 @@ macro_rules! my_wrapper { ($expr:expr) => { MyWrapper($expr) } } -pub struct MyWrapper(u32); +pub struct MyWrapper(#[allow(dead_code)] u32); fn main() { let value = MyWrapper(123); diff --git a/tests/ui/nullable-pointer-iotareduction.rs b/tests/ui/nullable-pointer-iotareduction.rs index d345fec8118..3f3a962664e 100644 --- a/tests/ui/nullable-pointer-iotareduction.rs +++ b/tests/ui/nullable-pointer-iotareduction.rs @@ -8,7 +8,7 @@ // trying to get assert failure messages that at least identify which case // failed. -enum E<T> { Thing(isize, T), #[allow(unused_tuple_struct_fields)] Nothing((), ((), ()), [i8; 0]) } +enum E<T> { Thing(isize, T), #[allow(dead_code)] Nothing((), ((), ()), [i8; 0]) } impl<T> E<T> { fn is_none(&self) -> bool { match *self { diff --git a/tests/ui/optimization-fuel-0.rs b/tests/ui/optimization-fuel-0.rs index 2643dbea1c4..77c727ad0f7 100644 --- a/tests/ui/optimization-fuel-0.rs +++ b/tests/ui/optimization-fuel-0.rs @@ -6,9 +6,9 @@ use std::mem::size_of; // compile-flags: -Z fuel=foo=0 -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S1(u8, u16, u8); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S2(u8, u16, u8); fn main() { diff --git a/tests/ui/optimization-fuel-1.rs b/tests/ui/optimization-fuel-1.rs index d5e2255d9f0..8b3d139201e 100644 --- a/tests/ui/optimization-fuel-1.rs +++ b/tests/ui/optimization-fuel-1.rs @@ -6,9 +6,9 @@ use std::mem::size_of; // compile-flags: -Z fuel=foo=1 -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S1(u8, u16, u8); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S2(u8, u16, u8); fn main() { diff --git a/tests/ui/packed/issue-118537-field-offset-ice.rs b/tests/ui/packed/issue-118537-field-offset-ice.rs index 657aec64003..679d9d754e3 100644 --- a/tests/ui/packed/issue-118537-field-offset-ice.rs +++ b/tests/ui/packed/issue-118537-field-offset-ice.rs @@ -3,7 +3,7 @@ use std::mem; #[repr(packed(4))] -struct Slice([u32]); +struct Slice(#[allow(dead_code)] [u32]); #[repr(packed(2), C)] struct PackedSized { diff --git a/tests/ui/packed/packed-struct-drop-aligned.rs b/tests/ui/packed/packed-struct-drop-aligned.rs index 4fec72763a4..6c2907c86e9 100644 --- a/tests/ui/packed/packed-struct-drop-aligned.rs +++ b/tests/ui/packed/packed-struct-drop-aligned.rs @@ -24,7 +24,7 @@ impl<'a> Drop for Aligned<'a> { } #[repr(transparent)] -struct NotCopy(#[allow(unused_tuple_struct_fields)] u8); +struct NotCopy(#[allow(dead_code)] u8); #[repr(packed)] struct Packed<'a>(NotCopy, Aligned<'a>); diff --git a/tests/ui/packed/packed-struct-optimized-enum.rs b/tests/ui/packed/packed-struct-optimized-enum.rs index 5e1a1f518c5..c3540f7619b 100644 --- a/tests/ui/packed/packed-struct-optimized-enum.rs +++ b/tests/ui/packed/packed-struct-optimized-enum.rs @@ -1,6 +1,6 @@ // run-pass #[repr(packed)] -struct Packed<T: Copy>(#[allow(unused_tuple_struct_fields)] T); +struct Packed<T: Copy>(#[allow(dead_code)] T); impl<T: Copy> Copy for Packed<T> {} impl<T: Copy> Clone for Packed<T> { diff --git a/tests/ui/packed/packed-tuple-struct-layout.rs b/tests/ui/packed/packed-tuple-struct-layout.rs index 931be5b9414..879553142da 100644 --- a/tests/ui/packed/packed-tuple-struct-layout.rs +++ b/tests/ui/packed/packed-tuple-struct-layout.rs @@ -2,11 +2,11 @@ use std::mem; #[repr(packed)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S4(u8,[u8; 3]); #[repr(packed)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S5(u8,u32); pub fn main() { diff --git a/tests/ui/parser/issues/issue-70388-without-witness.fixed b/tests/ui/parser/issues/issue-70388-without-witness.fixed index 8d981405ea1..58721495dcd 100644 --- a/tests/ui/parser/issues/issue-70388-without-witness.fixed +++ b/tests/ui/parser/issues/issue-70388-without-witness.fixed @@ -1,7 +1,7 @@ // run-rustfix // This is for checking if we can apply suggestions as-is. -pub struct Foo(#[allow(unused_tuple_struct_fields)] i32); +pub struct Foo(#[allow(dead_code)] i32); fn main() { let Foo(..) = Foo(0); //~ ERROR unexpected `...` diff --git a/tests/ui/parser/issues/issue-70388-without-witness.rs b/tests/ui/parser/issues/issue-70388-without-witness.rs index bf36073083a..2e679db5464 100644 --- a/tests/ui/parser/issues/issue-70388-without-witness.rs +++ b/tests/ui/parser/issues/issue-70388-without-witness.rs @@ -1,7 +1,7 @@ // run-rustfix // This is for checking if we can apply suggestions as-is. -pub struct Foo(#[allow(unused_tuple_struct_fields)] i32); +pub struct Foo(#[allow(dead_code)] i32); fn main() { let Foo(...) = Foo(0); //~ ERROR unexpected `...` diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed index 227c40e97c0..a09ff3e5417 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed @@ -1,7 +1,7 @@ // Regression test for issues #100790 and #106439. // run-rustfix -pub struct Example(usize) +pub struct Example(#[allow(dead_code)] usize) where (): Sized; //~^^^ ERROR where clauses are not allowed before tuple struct bodies diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs index 3699e6fe572..e86f2a8acb8 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs @@ -4,7 +4,7 @@ pub struct Example where (): Sized, -(usize); +(#[allow(dead_code)] usize); //~^^^ ERROR where clauses are not allowed before tuple struct bodies struct _Demo diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr index 18aa5fadb6b..ddbf237e866 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr @@ -6,12 +6,12 @@ LL | pub struct Example LL | / where LL | | (): Sized, | |______________^ unexpected where clause -LL | (usize); - | ------- the struct body +LL | (#[allow(dead_code)] usize); + | --------------------------- the struct body | help: move the body before the where clause | -LL ~ pub struct Example(usize) +LL ~ pub struct Example(#[allow(dead_code)] usize) LL | where LL ~ (): Sized; | diff --git a/tests/ui/pub/pub-ident-struct-4.fixed b/tests/ui/pub/pub-ident-struct-4.fixed index b49fa678e1b..71c6f0a6994 100644 --- a/tests/ui/pub/pub-ident-struct-4.fixed +++ b/tests/ui/pub/pub-ident-struct-4.fixed @@ -1,6 +1,6 @@ // run-rustfix -pub struct T(String); +pub struct T(#[allow(dead_code)] String); //~^ ERROR missing `struct` for struct definition fn main() {} diff --git a/tests/ui/pub/pub-ident-struct-4.rs b/tests/ui/pub/pub-ident-struct-4.rs index 20bc94b0acb..971f39a8ce1 100644 --- a/tests/ui/pub/pub-ident-struct-4.rs +++ b/tests/ui/pub/pub-ident-struct-4.rs @@ -1,6 +1,6 @@ // run-rustfix -pub T(String); +pub T(#[allow(dead_code)] String); //~^ ERROR missing `struct` for struct definition fn main() {} diff --git a/tests/ui/pub/pub-ident-struct-4.stderr b/tests/ui/pub/pub-ident-struct-4.stderr index 470874e0637..5fbb02c8673 100644 --- a/tests/ui/pub/pub-ident-struct-4.stderr +++ b/tests/ui/pub/pub-ident-struct-4.stderr @@ -1,12 +1,12 @@ error: missing `struct` for struct definition --> $DIR/pub-ident-struct-4.rs:3:4 | -LL | pub T(String); +LL | pub T(#[allow(dead_code)] String); | ^ | help: add `struct` here to parse `T` as a public struct | -LL | pub struct T(String); +LL | pub struct T(#[allow(dead_code)] String); | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/range_inclusive.rs b/tests/ui/range_inclusive.rs index c9107d24ed0..2425113b904 100644 --- a/tests/ui/range_inclusive.rs +++ b/tests/ui/range_inclusive.rs @@ -11,7 +11,7 @@ fn foo() -> isize { 42 } pub fn return_range_to() -> RangeToInclusive<i32> { return ..=1; } #[derive(Debug)] -struct P(#[allow(unused_tuple_struct_fields)] u8); +struct P(#[allow(dead_code)] u8); pub fn main() { let mut count = 0; diff --git a/tests/ui/recursion_limit/issue-40003.rs b/tests/ui/recursion_limit/issue-40003.rs index 5e61361f987..01a2aaffb9e 100644 --- a/tests/ui/recursion_limit/issue-40003.rs +++ b/tests/ui/recursion_limit/issue-40003.rs @@ -153,7 +153,7 @@ mod stream { } enum Slot<T> { - Next(#[allow(unused_tuple_struct_fields)] usize), + Next(#[allow(dead_code)] usize), _Data { _a: T }, } diff --git a/tests/ui/repr/align-with-extern-c-fn.rs b/tests/ui/repr/align-with-extern-c-fn.rs index 9e490e27ad1..659ef88fce6 100644 --- a/tests/ui/repr/align-with-extern-c-fn.rs +++ b/tests/ui/repr/align-with-extern-c-fn.rs @@ -8,7 +8,7 @@ #![feature(repr_align)] #[repr(align(16))] -pub struct A(#[allow(unused_tuple_struct_fields)] i64); +pub struct A(#[allow(dead_code)] i64); #[allow(improper_ctypes_definitions)] pub extern "C" fn foo(x: A) {} diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs index 1914e155493..c95777b0ef1 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs index e713b003b00..3f663fd09f8 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs index 04da14c5419..56b7988e0e4 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs index 8313c25e753..3ebe3225437 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs index 7623839fdd1..bb5e243d934 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs @@ -5,7 +5,7 @@ // // See discussion on rust-lang/rust#62307 and rust-lang/rust#62339 -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs index 894739ff705..e3abb47cf73 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs index 1699dae4624..2d3788eea8a 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs index 2672bdd9e56..65df7788d90 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs index 3489995ae71..88260fd1081 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs b/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs index d359067f627..0deb8c7f119 100644 --- a/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs +++ b/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs @@ -7,7 +7,7 @@ struct Test { } #[r#derive(r#Debug)] -struct Test2(#[allow(unused_tuple_struct_fields)] u32); +struct Test2(#[allow(dead_code)] u32); pub fn main() { assert_eq!(mem::size_of::<Test>(), 9); diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs index 4836d2b02ce..75797b1cbfe 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs @@ -100,7 +100,7 @@ implements_const_drop! { } fn main() { - struct HasDropGlue(#[allow(unused_tuple_struct_fields)] Box<u8>); + struct HasDropGlue(#[allow(dead_code)] Box<u8>); struct HasDropImpl; impl Drop for HasDropImpl { fn drop(&mut self) { diff --git a/tests/ui/specialization/specialization-cross-crate.rs b/tests/ui/specialization/specialization-cross-crate.rs index d9381d66152..4b2ac07378d 100644 --- a/tests/ui/specialization/specialization-cross-crate.rs +++ b/tests/ui/specialization/specialization-cross-crate.rs @@ -14,7 +14,7 @@ struct NotClone; struct MarkedAndClone; impl MyMarker for MarkedAndClone {} -struct MyType<T>(#[allow(unused_tuple_struct_fields)] T); +struct MyType<T>(#[allow(dead_code)] T); impl<T> Foo for MyType<T> { default fn foo(&self) -> &'static str { "generic MyType" diff --git a/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs b/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs index 904aeaa088b..f06afc8ba41 100644 --- a/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs +++ b/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs @@ -14,7 +14,7 @@ impl<'a> WithAssoc for &'a () { type Item = &'a u32; } -struct Cloned<I>(#[allow(unused_tuple_struct_fields)] I); +struct Cloned<I>(#[allow(dead_code)] I); impl<'a, I, T: 'a> Iterator for Cloned<I> where I: WithAssoc<Item=&'a T>, T: Clone diff --git a/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs b/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs index 6b0b09c9894..0f535523dcc 100644 --- a/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs +++ b/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs @@ -39,7 +39,7 @@ impl<T> Foo for T { } } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T:?Sized>(u32, T); fn main() { diff --git a/tests/ui/struct-ctor-mangling.rs b/tests/ui/struct-ctor-mangling.rs index ba6abbf03a5..159e21d2863 100644 --- a/tests/ui/struct-ctor-mangling.rs +++ b/tests/ui/struct-ctor-mangling.rs @@ -4,7 +4,7 @@ fn size_of_val<T>(_: &T) -> usize { std::mem::size_of::<T>() } -struct Foo(#[allow(unused_tuple_struct_fields)] i64); +struct Foo(#[allow(dead_code)] i64); // Test that the (symbol) mangling of `Foo` (the `struct` type) and that of // `typeof Foo` (the function type of the `struct` constructor) don't collide. diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.rs b/tests/ui/structs-enums/enum-null-pointer-opt.rs index 85fa1eac2e2..356f8a6dd36 100644 --- a/tests/ui/structs-enums/enum-null-pointer-opt.rs +++ b/tests/ui/structs-enums/enum-null-pointer-opt.rs @@ -10,8 +10,8 @@ use std::sync::Arc; trait Trait { fn dummy(&self) { } } trait Mirror { type Image; } impl<T> Mirror for T { type Image = T; } -struct ParamTypeStruct<T>(#[allow(unused_tuple_struct_fields)] T); -struct AssocTypeStruct<T>(#[allow(unused_tuple_struct_fields)] <T as Mirror>::Image); +struct ParamTypeStruct<T>(#[allow(dead_code)] T); +struct AssocTypeStruct<T>(#[allow(dead_code)] <T as Mirror>::Image); #[repr(transparent)] union MaybeUninitUnion<T: Copy> { _value: T, @@ -46,7 +46,7 @@ fn main() { struct Foo { _a: Box<isize> } - struct Bar(#[allow(unused_tuple_struct_fields)] Box<isize>); + struct Bar(#[allow(dead_code)] Box<isize>); // Should apply through structs assert_eq!(size_of::<Foo>(), size_of::<Option<Foo>>()); diff --git a/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs b/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs index a05cf8b93d5..4bd7ee45dfe 100644 --- a/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs +++ b/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs @@ -6,7 +6,7 @@ * represented with nullable pointers could be misoptimized in some cases. */ -enum List<X> { Nil, Cons(X, #[allow(unused_tuple_struct_fields)] Box<List<X>>) } +enum List<X> { Nil, Cons(X, #[allow(dead_code)] Box<List<X>>) } pub fn main() { match List::Cons(10, Box::new(List::Nil)) { List::Cons(10, _) => {} diff --git a/tests/ui/structs-enums/resource-in-struct.rs b/tests/ui/structs-enums/resource-in-struct.rs index 9613ca62a49..267ad6b4a86 100644 --- a/tests/ui/structs-enums/resource-in-struct.rs +++ b/tests/ui/structs-enums/resource-in-struct.rs @@ -25,7 +25,7 @@ fn close_res(i: closable) -> close_res { } } -enum option<T> { none, some(#[allow(unused_tuple_struct_fields)] T), } +enum option<T> { none, some(#[allow(dead_code)] T), } fn sink(_res: option<close_res>) { } diff --git a/tests/ui/structs-enums/tuple-struct-construct.rs b/tests/ui/structs-enums/tuple-struct-construct.rs index fbf97e6b225..dc7cbaffddb 100644 --- a/tests/ui/structs-enums/tuple-struct-construct.rs +++ b/tests/ui/structs-enums/tuple-struct-construct.rs @@ -1,5 +1,5 @@ // run-pass -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] #[derive(Debug)] struct Foo(isize, isize); diff --git a/tests/ui/structs-enums/uninstantiable-struct.rs b/tests/ui/structs-enums/uninstantiable-struct.rs index b24effe5a9c..15f2fc424bb 100644 --- a/tests/ui/structs-enums/uninstantiable-struct.rs +++ b/tests/ui/structs-enums/uninstantiable-struct.rs @@ -1,4 +1,4 @@ // run-pass -pub struct Z(#[allow(unused_tuple_struct_fields)] &'static Z); +pub struct Z(#[allow(dead_code)] &'static Z); pub fn main() {} diff --git a/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed b/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed index 470cc67b973..3257ea04c69 100644 --- a/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed +++ b/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed @@ -2,7 +2,7 @@ // trait, impl or associated fn. // run-rustfix -struct Inv<'a>(Option<*mut &'a u8>); +struct Inv<'a>(#[allow(dead_code)] Option<*mut &'a u8>); fn check_bound<'a, A: 'a>(_: A, _: Inv<'a>) {} diff --git a/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs b/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs index 874788e13ef..fcc13aad996 100644 --- a/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs +++ b/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs @@ -2,7 +2,7 @@ // trait, impl or associated fn. // run-rustfix -struct Inv<'a>(Option<*mut &'a u8>); +struct Inv<'a>(#[allow(dead_code)] Option<*mut &'a u8>); fn check_bound<'a, A: 'a>(_: A, _: Inv<'a>) {} diff --git a/tests/ui/trailing-comma.rs b/tests/ui/trailing-comma.rs index 90adba99e54..31091398508 100644 --- a/tests/ui/trailing-comma.rs +++ b/tests/ui/trailing-comma.rs @@ -3,7 +3,7 @@ fn f<T,>(_: T,) {} -struct Foo<T,>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T,>(#[allow(dead_code)] T); struct Bar; @@ -14,7 +14,7 @@ impl Bar { } enum Baz { - Qux(#[allow(unused_tuple_struct_fields)] isize,), + Qux(#[allow(dead_code)] isize,), } #[allow(unused,)] diff --git a/tests/ui/traits/augmented-assignments-trait.rs b/tests/ui/traits/augmented-assignments-trait.rs index 747a5393f12..75168c4f1e5 100644 --- a/tests/ui/traits/augmented-assignments-trait.rs +++ b/tests/ui/traits/augmented-assignments-trait.rs @@ -1,7 +1,7 @@ // run-pass use std::ops::AddAssign; -struct Int(#[allow(unused_tuple_struct_fields)] i32); +struct Int(#[allow(dead_code)] i32); impl AddAssign for Int { fn add_assign(&mut self, _: Int) { diff --git a/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs b/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs index 0bc611c26ca..05345d3432b 100644 --- a/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs +++ b/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs @@ -5,7 +5,7 @@ pub struct WaitToken; impl !Send for WaitToken {} -pub struct Test<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Test<T>(#[allow(dead_code)] T); unsafe impl<T: 'static> Send for Test<T> {} pub fn spawn<F>(_: F) -> () where F: FnOnce(), F: Send + 'static {} diff --git a/tests/ui/traits/object/exclusion.rs b/tests/ui/traits/object/exclusion.rs index 766dceeaffe..3abd3bbfccf 100644 --- a/tests/ui/traits/object/exclusion.rs +++ b/tests/ui/traits/object/exclusion.rs @@ -8,7 +8,7 @@ trait Future: 'static { } } -struct Map<A>(#[allow(unused_tuple_struct_fields)] A); +struct Map<A>(#[allow(dead_code)] A); impl<A: Future> Future for Map<A> {} pub struct Promise; diff --git a/tests/ui/traits/object/generics.rs b/tests/ui/traits/object/generics.rs index 5a4a6aecc6b..e2e70d43ab8 100644 --- a/tests/ui/traits/object/generics.rs +++ b/tests/ui/traits/object/generics.rs @@ -25,7 +25,7 @@ impl<A1, A2, A3> Impl<A1, A2, A3> { // test for #8601 -enum Type<T> { Constant(#[allow(unused_tuple_struct_fields)] T) } +enum Type<T> { Constant(#[allow(dead_code)] T) } trait Trait<K,V> { fn method(&self, _: Type<(K,V)>) -> isize; diff --git a/tests/ui/traits/pointee-deduction.rs b/tests/ui/traits/pointee-deduction.rs index c333b0129c8..82e3aa1ae89 100644 --- a/tests/ui/traits/pointee-deduction.rs +++ b/tests/ui/traits/pointee-deduction.rs @@ -13,8 +13,8 @@ impl Foo for () { type Bar = (); } -struct Wrapper1<T: Foo>(#[allow(unused_tuple_struct_fields)] <T as Foo>::Bar); -struct Wrapper2<T: Foo>(#[allow(unused_tuple_struct_fields)] <Wrapper1<T> as Pointee>::Metadata); +struct Wrapper1<T: Foo>(#[allow(dead_code)] <T as Foo>::Bar); +struct Wrapper2<T: Foo>(#[allow(dead_code)] <Wrapper1<T> as Pointee>::Metadata); fn main() { let _: Wrapper2<()> = Wrapper2(()); diff --git a/tests/ui/traits/principal-less-objects.rs b/tests/ui/traits/principal-less-objects.rs index 62bad0d7d77..5fe01efa4f8 100644 --- a/tests/ui/traits/principal-less-objects.rs +++ b/tests/ui/traits/principal-less-objects.rs @@ -7,7 +7,7 @@ use std::mem; // Array is to make sure the size is not exactly pointer-size, so // we can be sure we are measuring the right size in the // `size_of_val` test. -struct SetOnDrop<'a>(&'a AtomicUsize, #[allow(unused_tuple_struct_fields)] [u8; 64]); +struct SetOnDrop<'a>(&'a AtomicUsize, #[allow(dead_code)] [u8; 64]); impl<'a> Drop for SetOnDrop<'a> { fn drop(&mut self) { self.0.store(self.0.load(Ordering::Relaxed) + 1, Ordering::Relaxed); diff --git a/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs b/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs index 0aa644db052..d869794ec0a 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs +++ b/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs @@ -9,7 +9,7 @@ #![allow(irrefutable_let_patterns)] -enum Enum<T> { TSVariant(#[allow(unused_tuple_struct_fields)] T), SVariant { _v: T }, UVariant } +enum Enum<T> { TSVariant(#[allow(dead_code)] T), SVariant { _v: T }, UVariant } type Alias<T> = Enum<T>; type AliasFixed = Enum<()>; diff --git a/tests/ui/typeck/issue-2063.rs b/tests/ui/typeck/issue-2063.rs index f08f9d4cfe4..b00bbc082af 100644 --- a/tests/ui/typeck/issue-2063.rs +++ b/tests/ui/typeck/issue-2063.rs @@ -3,7 +3,7 @@ // cause compiler to loop. Note that no instances // of such a type could ever be constructed. -struct T(#[allow(unused_tuple_struct_fields)] Box<T>); +struct T(#[allow(dead_code)] Box<T>); trait ToStr2 { fn my_to_string(&self) -> String; diff --git a/tests/ui/unboxed-closures/type-id-higher-rank.rs b/tests/ui/unboxed-closures/type-id-higher-rank.rs index 1f8aec205fb..a9db71a0399 100644 --- a/tests/ui/unboxed-closures/type-id-higher-rank.rs +++ b/tests/ui/unboxed-closures/type-id-higher-rank.rs @@ -4,7 +4,7 @@ use std::any::{Any, TypeId}; -struct Struct<'a>(#[allow(unused_tuple_struct_fields)] &'a ()); +struct Struct<'a>(#[allow(dead_code)] &'a ()); trait Trait<'a> {} fn main() { diff --git a/tests/ui/unsized-locals/unsized-exprs-rpass.rs b/tests/ui/unsized-locals/unsized-exprs-rpass.rs index 175b02fcb81..83d3680f72f 100644 --- a/tests/ui/unsized-locals/unsized-exprs-rpass.rs +++ b/tests/ui/unsized-locals/unsized-exprs-rpass.rs @@ -2,7 +2,7 @@ #![allow(incomplete_features, unused_braces, unused_parens)] #![feature(unsized_tuple_coercion, unsized_locals, unsized_fn_params)] -struct A<X: ?Sized>(#[allow(unused_tuple_struct_fields)] X); +struct A<X: ?Sized>(#[allow(dead_code)] X); fn udrop<T: ?Sized>(_x: T) {} fn foo() -> Box<[u8]> { diff --git a/tests/ui/unsized/unchanged-param.rs b/tests/ui/unsized/unchanged-param.rs index 6bdc89310eb..8aa2ed15344 100644 --- a/tests/ui/unsized/unchanged-param.rs +++ b/tests/ui/unsized/unchanged-param.rs @@ -1,8 +1,8 @@ // run-pass // Test that we allow unsizing even if there is an unchanged param in the // field getting unsized. -struct A<T, U: ?Sized + 'static>(#[allow(unused_tuple_struct_fields)] T, B<T, U>); -struct B<T, U: ?Sized>(#[allow(unused_tuple_struct_fields)] T, U); +struct A<T, U: ?Sized + 'static>(#[allow(dead_code)] T, B<T, U>); +struct B<T, U: ?Sized>(#[allow(dead_code)] T, U); fn main() { let x: A<[u32; 1], [u32; 1]> = A([0; 1], B([0; 1], [0; 1])); |
