diff options
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/boxed.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/boxed/thin.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/set/tests.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/collections/vec_deque/tests.rs | 2 | ||||
| -rw-r--r-- | library/alloc/tests/autotraits.rs | 2 | ||||
| -rw-r--r-- | library/alloc/tests/vec.rs | 6 |
6 files changed, 8 insertions, 7 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 { diff --git a/library/alloc/tests/autotraits.rs b/library/alloc/tests/autotraits.rs index b41e457614e..ba5e28f7293 100644 --- a/library/alloc/tests/autotraits.rs +++ b/library/alloc/tests/autotraits.rs @@ -1,7 +1,7 @@ fn require_sync<T: Sync>(_: T) {} fn require_send_sync<T: Send + Sync>(_: T) {} -struct NotSend(*const ()); +struct NotSend(#[allow(dead_code)] *const ()); unsafe impl Sync for NotSend {} #[test] diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs index 364dc920187..9ec6f6ae1ac 100644 --- a/library/alloc/tests/vec.rs +++ b/library/alloc/tests/vec.rs @@ -547,7 +547,7 @@ fn test_cmp() { #[test] fn test_vec_truncate_drop() { static mut DROPS: u32 = 0; - struct Elem(i32); + struct Elem(#[allow(dead_code)] i32); impl Drop for Elem { fn drop(&mut self) { unsafe { @@ -1089,7 +1089,7 @@ fn test_into_iter_advance_by() { #[test] fn test_into_iter_drop_allocator() { - struct ReferenceCountedAllocator<'a>(DropCounter<'a>); + struct ReferenceCountedAllocator<'a>(#[allow(dead_code)] DropCounter<'a>); unsafe impl Allocator for ReferenceCountedAllocator<'_> { fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, core::alloc::AllocError> { @@ -2407,7 +2407,7 @@ fn test_vec_dedup_multiple_ident() { #[test] fn test_vec_dedup_partialeq() { #[derive(Debug)] - struct Foo(i32, i32); + struct Foo(i32, #[allow(dead_code)] i32); impl PartialEq for Foo { fn eq(&self, other: &Foo) -> bool { |
