about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorJake Goulding <jake.goulding@gmail.com>2023-12-27 18:03:23 -0500
committerJake Goulding <jake.goulding@gmail.com>2024-01-02 15:34:37 -0500
commit5772818dc8f4c5a0fec1f5b35b33e85764dcd4f4 (patch)
treed0df909f2e81b935d3afd06d19ac311d2a6ae665 /library/alloc/src
parent9fcf9c141068984ffcbb4cb00c83d891043761e8 (diff)
downloadrust-5772818dc8f4c5a0fec1f5b35b33e85764dcd4f4.tar.gz
rust-5772818dc8f4c5a0fec1f5b35b33e85764dcd4f4.zip
Adjust library tests for unused_tuple_struct_fields -> dead_code
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 {