about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-12 07:09:19 +0000
committerbors <bors@rust-lang.org>2023-12-12 07:09:19 +0000
commitfda521a988749458326ecef2e92e979077727a4e (patch)
tree73ec9f26b38eb86b5676735f79e577c12fe0024a /library/alloc
parentaaeb4dd3a93a6be4cba5eb173f35453803994773 (diff)
parent03b7ed06c88ae869daa4f2a30ef341918cc76ac7 (diff)
Auto merge of #3223 - rust-lang:rustup-2023-12-12, r=RalfJung
Automatic Rustup
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/benches/btree/map.rs1
-rw-r--r--library/alloc/benches/str.rs1
-rw-r--r--library/alloc/benches/vec_deque.rs1
-rw-r--r--library/alloc/src/collections/binary_heap/tests.rs2
-rw-r--r--library/alloc/src/collections/btree/map/tests.rs7
-rw-r--r--library/alloc/src/collections/btree/set/tests.rs3
-rw-r--r--library/alloc/src/ffi/c_str/tests.rs2
-rw-r--r--library/alloc/src/rc/tests.rs5
-rw-r--r--library/alloc/src/sync/tests.rs13
-rw-r--r--library/alloc/src/tests.rs2
-rw-r--r--library/alloc/tests/arc.rs1
-rw-r--r--library/alloc/tests/borrow.rs2
-rw-r--r--library/alloc/tests/rc.rs1
-rw-r--r--library/alloc/tests/vec.rs4
14 files changed, 5 insertions, 40 deletions
diff --git a/library/alloc/benches/btree/map.rs b/library/alloc/benches/btree/map.rs
index 7d236647750..4fe07eb0213 100644
--- a/library/alloc/benches/btree/map.rs
+++ b/library/alloc/benches/btree/map.rs
@@ -1,6 +1,5 @@
 use std::collections::BTreeMap;
 use std::ops::RangeBounds;
-use std::vec::Vec;
 
 use rand::{seq::SliceRandom, Rng};
 use test::{black_box, Bencher};
diff --git a/library/alloc/benches/str.rs b/library/alloc/benches/str.rs
index 54af389dedc..c148ab6b220 100644
--- a/library/alloc/benches/str.rs
+++ b/library/alloc/benches/str.rs
@@ -1,4 +1,3 @@
-use core::iter::Iterator;
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/alloc/benches/vec_deque.rs b/library/alloc/benches/vec_deque.rs
index 313a97ed1ff..35939f489b4 100644
--- a/library/alloc/benches/vec_deque.rs
+++ b/library/alloc/benches/vec_deque.rs
@@ -1,4 +1,3 @@
-use core::iter::Iterator;
 use std::{
     collections::{vec_deque, VecDeque},
     mem,
diff --git a/library/alloc/src/collections/binary_heap/tests.rs b/library/alloc/src/collections/binary_heap/tests.rs
index 565a7b7975f..d4bc6226a14 100644
--- a/library/alloc/src/collections/binary_heap/tests.rs
+++ b/library/alloc/src/collections/binary_heap/tests.rs
@@ -1,8 +1,6 @@
 use super::*;
 use crate::boxed::Box;
 use crate::testing::crash_test::{CrashTestDummy, Panic};
-use core::mem;
-use std::iter::TrustedLen;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
 #[test]
diff --git a/library/alloc/src/collections/btree/map/tests.rs b/library/alloc/src/collections/btree/map/tests.rs
index 8681cfcd617..a1b7cfe6b17 100644
--- a/library/alloc/src/collections/btree/map/tests.rs
+++ b/library/alloc/src/collections/btree/map/tests.rs
@@ -1,4 +1,3 @@
-use super::Entry::{Occupied, Vacant};
 use super::*;
 use crate::boxed::Box;
 use crate::fmt::Debug;
@@ -7,13 +6,9 @@ use crate::string::{String, ToString};
 use crate::testing::crash_test::{CrashTestDummy, Panic};
 use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
 use crate::testing::rng::DeterministicRng;
-use crate::vec::Vec;
 use core::assert_matches::assert_matches;
-use std::cmp::Ordering;
 use std::iter;
-use std::mem;
-use std::ops::Bound::{self, Excluded, Included, Unbounded};
-use std::ops::RangeBounds;
+use std::ops::Bound::{Excluded, Included, Unbounded};
 use std::panic::{catch_unwind, AssertUnwindSafe};
 use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
 
diff --git a/library/alloc/src/collections/btree/set/tests.rs b/library/alloc/src/collections/btree/set/tests.rs
index e05bf0e2003..8726c5bfead 100644
--- a/library/alloc/src/collections/btree/set/tests.rs
+++ b/library/alloc/src/collections/btree/set/tests.rs
@@ -1,9 +1,6 @@
 use super::*;
 use crate::testing::crash_test::{CrashTestDummy, Panic};
 use crate::testing::rng::DeterministicRng;
-use crate::vec::Vec;
-use std::cmp::Ordering;
-use std::hash::{Hash, Hasher};
 use std::ops::Bound::{Excluded, Included};
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
diff --git a/library/alloc/src/ffi/c_str/tests.rs b/library/alloc/src/ffi/c_str/tests.rs
index 0b7476d5cc7..9f51e17a427 100644
--- a/library/alloc/src/ffi/c_str/tests.rs
+++ b/library/alloc/src/ffi/c_str/tests.rs
@@ -1,6 +1,4 @@
 use super::*;
-use crate::rc::Rc;
-use crate::sync::Arc;
 use core::assert_matches::assert_matches;
 use core::ffi::FromBytesUntilNulError;
 use core::hash::{Hash, Hasher};
diff --git a/library/alloc/src/rc/tests.rs b/library/alloc/src/rc/tests.rs
index 1f221b86f12..c8a40603d9d 100644
--- a/library/alloc/src/rc/tests.rs
+++ b/library/alloc/src/rc/tests.rs
@@ -1,12 +1,7 @@
 use super::*;
 
-use std::boxed::Box;
 use std::cell::RefCell;
 use std::clone::Clone;
-use std::convert::{From, TryInto};
-use std::mem::drop;
-use std::option::Option::{self, None, Some};
-use std::result::Result::{Err, Ok};
 
 #[test]
 fn test_clone() {
diff --git a/library/alloc/src/sync/tests.rs b/library/alloc/src/sync/tests.rs
index 863d58bdf4d..d37e45569cf 100644
--- a/library/alloc/src/sync/tests.rs
+++ b/library/alloc/src/sync/tests.rs
@@ -1,21 +1,12 @@
 use super::*;
 
-use std::boxed::Box;
 use std::clone::Clone;
-use std::convert::{From, TryInto};
-use std::mem::drop;
-use std::ops::Drop;
-use std::option::Option::{self, None, Some};
-use std::sync::atomic::{
-    self,
-    Ordering::{Acquire, SeqCst},
-};
+use std::option::Option::None;
+use std::sync::atomic::Ordering::SeqCst;
 use std::sync::mpsc::channel;
 use std::sync::Mutex;
 use std::thread;
 
-use crate::vec::Vec;
-
 struct Canary(*mut atomic::AtomicUsize);
 
 impl Drop for Canary {
diff --git a/library/alloc/src/tests.rs b/library/alloc/src/tests.rs
index b1d3a9fa8ac..ab256ceaec3 100644
--- a/library/alloc/src/tests.rs
+++ b/library/alloc/src/tests.rs
@@ -1,8 +1,6 @@
 //! Test for `boxed` mod.
 
 use core::any::Any;
-use core::clone::Clone;
-use core::convert::TryInto;
 use core::ops::Deref;
 
 use std::boxed::Box;
diff --git a/library/alloc/tests/arc.rs b/library/alloc/tests/arc.rs
index ce40b5c9b0a..d564a30b103 100644
--- a/library/alloc/tests/arc.rs
+++ b/library/alloc/tests/arc.rs
@@ -1,6 +1,5 @@
 use std::any::Any;
 use std::cell::RefCell;
-use std::cmp::PartialEq;
 use std::iter::TrustedLen;
 use std::mem;
 use std::sync::{Arc, Weak};
diff --git a/library/alloc/tests/borrow.rs b/library/alloc/tests/borrow.rs
index 57976aa6cdf..af7efb7d782 100644
--- a/library/alloc/tests/borrow.rs
+++ b/library/alloc/tests/borrow.rs
@@ -1,4 +1,4 @@
-use std::borrow::{Cow, ToOwned};
+use std::borrow::Cow;
 use std::ffi::{CStr, OsStr};
 use std::path::Path;
 use std::rc::Rc;
diff --git a/library/alloc/tests/rc.rs b/library/alloc/tests/rc.rs
index efb39a60966..499740e738a 100644
--- a/library/alloc/tests/rc.rs
+++ b/library/alloc/tests/rc.rs
@@ -1,6 +1,5 @@
 use std::any::Any;
 use std::cell::RefCell;
-use std::cmp::PartialEq;
 use std::iter::TrustedLen;
 use std::mem;
 use std::rc::{Rc, Weak};
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index 3d3175ba3a9..364dc920187 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -1,7 +1,5 @@
-use alloc::vec::Vec;
 use core::alloc::{Allocator, Layout};
 use core::{assert_eq, assert_ne};
-use core::iter::{IntoIterator, Iterator};
 use core::num::NonZeroUsize;
 use core::ptr::NonNull;
 use std::alloc::System;
@@ -1982,7 +1980,7 @@ fn vec_macro_repeating_null_raw_fat_pointer() {
 
     let vec = vec![null_raw_dyn; 1];
     dbg!(ptr_metadata(vec[0]));
-    assert!(vec[0] == null_raw_dyn);
+    assert!(std::ptr::eq(vec[0], null_raw_dyn));
 
     // Polyfill for https://github.com/rust-lang/rfcs/pull/2580