summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-05 04:51:55 +0000
committerbors <bors@rust-lang.org>2024-01-05 04:51:55 +0000
commit5113ed28ea1451a13eae3a05dca0dbabfd56f587 (patch)
treec4edb2a07b2023ac8e393e3c4ce3b30657d5dd05 /library/alloc/src
parenta59a98024e3fe317e37e218392f5c34e932b2394 (diff)
parent26194a3ffaf14b86e78ddcd0f2f88c609624d14b (diff)
downloadrust-5113ed28ea1451a13eae3a05dca0dbabfd56f587.tar.gz
rust-5113ed28ea1451a13eae3a05dca0dbabfd56f587.zip
Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkin
Merge `unused_tuple_struct_fields` into `dead_code`

This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group.

[Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/boxed.rs1
-rw-r--r--library/alloc/src/boxed/thin.rs2
-rw-r--r--library/alloc/src/collections/btree/set/tests.rs2
-rw-r--r--library/alloc/src/collections/vec_deque/tests.rs2
4 files changed, 4 insertions, 3 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index fdf5e134f4d..6977681e5a3 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -24,6 +24,7 @@
 //! Creating a recursive data structure:
 //!
 //! ```
+//! ##[allow(dead_code)]
 //! #[derive(Debug)]
 //! enum List<T> {
 //!     Cons(T, Box<List<T>>),
diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs
index a8005b7067d..9463b73b574 100644
--- a/library/alloc/src/boxed/thin.rs
+++ b/library/alloc/src/boxed/thin.rs
@@ -171,7 +171,7 @@ 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(unused_tuple_struct_fields)] // Field only used through `WithHeader` type above.
+#[allow(dead_code)] // Field only used through `WithHeader` type above.
 struct WithOpaqueHeader(NonNull<u8>);
 
 impl WithOpaqueHeader {
diff --git a/library/alloc/src/collections/btree/set/tests.rs b/library/alloc/src/collections/btree/set/tests.rs
index 8726c5bfead..688ce57e9da 100644
--- a/library/alloc/src/collections/btree/set/tests.rs
+++ b/library/alloc/src/collections/btree/set/tests.rs
@@ -524,7 +524,7 @@ fn test_extend_ref() {
 #[test]
 fn test_recovery() {
     #[derive(Debug)]
-    struct Foo(&'static str, i32);
+    struct Foo(&'static str, #[allow(dead_code)] i32);
 
     impl PartialEq for Foo {
         fn eq(&self, other: &Self) -> bool {
diff --git a/library/alloc/src/collections/vec_deque/tests.rs b/library/alloc/src/collections/vec_deque/tests.rs
index b7fdebfa60b..f8ce4ca9788 100644
--- a/library/alloc/src/collections/vec_deque/tests.rs
+++ b/library/alloc/src/collections/vec_deque/tests.rs
@@ -1085,7 +1085,7 @@ fn test_clone_from() {
 fn test_vec_deque_truncate_drop() {
     static mut DROPS: u32 = 0;
     #[derive(Clone)]
-    struct Elem(i32);
+    struct Elem(#[allow(dead_code)] i32);
     impl Drop for Elem {
         fn drop(&mut self) {
             unsafe {