diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index cb3e9c80a131d..92f1bd8ab7367 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -82,7 +82,7 @@ fn current_dll_path() -> Result { let fname_ptr = info.dli_fname.as_ptr(); #[cfg(not(target_os = "cygwin"))] let fname_ptr = { - assert!(!info.dli_fname.is_null(), "the docs do not allow dladdr to be null"); + assert!(!info.dli_fname.is_null(), "dli_fname cannot be null"); info.dli_fname }; let bytes = CStr::from_ptr(fname_ptr).to_bytes(); diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 11f439b9996de..509e673bdb8b9 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -285,8 +285,7 @@ pub fn read>(path: P) -> io::Result> { fn inner(path: &Path) -> io::Result> { let mut file = File::open(path)?; let size = file.metadata().map(|m| m.len() as usize).ok(); - let mut bytes = Vec::new(); - bytes.try_reserve_exact(size.unwrap_or(0))?; + let mut bytes = Vec::try_with_capacity(size.unwrap_or(0))?; io::default_read_to_end(&mut file, &mut bytes, size)?; Ok(bytes) } diff --git a/src/bootstrap/src/utils/cache.rs b/src/bootstrap/src/utils/cache.rs index 1c8cc4025df11..46eeffad88c38 100644 --- a/src/bootstrap/src/utils/cache.rs +++ b/src/bootstrap/src/utils/cache.rs @@ -20,7 +20,6 @@ use std::collections::HashMap; use std::hash::{Hash, Hasher}; use std::marker::PhantomData; use std::ops::Deref; -use std::path::PathBuf; use std::sync::{LazyLock, Mutex}; use std::{fmt, mem}; @@ -51,26 +50,11 @@ impl PartialEq for Interned { } impl Eq for Interned {} -impl PartialEq for Interned { - fn eq(&self, other: &str) -> bool { - *self == other - } -} impl PartialEq<&str> for Interned { fn eq(&self, other: &&str) -> bool { **self == **other } } -impl PartialEq<&Interned> for Interned { - fn eq(&self, other: &&Self) -> bool { - self.0 == other.0 - } -} -impl PartialEq> for &Interned { - fn eq(&self, other: &Interned) -> bool { - self.0 == other.0 - } -} unsafe impl Send for Interned {} unsafe impl Sync for Interned {} @@ -188,8 +172,6 @@ impl TyIntern { #[derive(Default)] pub struct Interner { strs: Mutex>, - paths: Mutex>, - lists: Mutex>>, } /// Defines the behavior required for a type to be internable. @@ -210,18 +192,6 @@ impl Internable for String { } } -impl Internable for PathBuf { - fn intern_cache() -> &'static Mutex> { - &INTERNER.paths - } -} - -impl Internable for Vec { - fn intern_cache() -> &'static Mutex> { - &INTERNER.lists - } -} - impl Interner { /// Interns a string reference, ensuring it is stored uniquely. /// diff --git a/src/bootstrap/src/utils/cache/tests.rs b/src/bootstrap/src/utils/cache/tests.rs index 28f5563a589b1..8562a35b3e06b 100644 --- a/src/bootstrap/src/utils/cache/tests.rs +++ b/src/bootstrap/src/utils/cache/tests.rs @@ -12,26 +12,6 @@ fn test_string_interning() { assert_ne!(s1, s3, "Different strings should have different interned values"); } -#[test] -fn test_path_interning() { - let p1 = PathBuf::from("/tmp/file").intern(); - let p2 = PathBuf::from("/tmp/file").intern(); - let p3 = PathBuf::from("/tmp/other").intern(); - - assert_eq!(p1, p2); - assert_ne!(p1, p3); -} - -#[test] -fn test_vec_interning() { - let v1 = vec!["a".to_string(), "b".to_string()].intern(); - let v2 = vec!["a".to_string(), "b".to_string()].intern(); - let v3 = vec!["c".to_string()].intern(); - - assert_eq!(v1, v2); - assert_ne!(v1, v3); -} - #[test] fn test_interned_equality() { let s1 = INTERNER.intern_str("test"); diff --git a/src/doc/book b/src/doc/book index d33916341d480..230c68bc1e08f 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit d33916341d480caede1d0ae57cbeae23aab23e88 +Subproject commit 230c68bc1e08f5f3228384a28cc228c81dfbd10d diff --git a/src/doc/reference b/src/doc/reference index 387392674d746..acd0231ebc748 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 387392674d74656f7cb437c05a96f0c52ea8e601 +Subproject commit acd0231ebc74849f6a8907b5e646ce86721aad76 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 8a8918c698534..c9d151f9147c4 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 8a8918c698534547fa8a1a693cb3e7277f0bfb2f +Subproject commit c9d151f9147c4808c77f0375ba3fa5d54443cb9e diff --git a/triagebot.toml b/triagebot.toml index 3afa2d364109e..e62e49b90fbbb 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -1171,7 +1171,6 @@ contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html" users_on_vacation = [ "fmease", "jyn514", - "Noratrieb", "spastorino", ] @@ -1198,7 +1197,6 @@ compiler = [ "@lcnr", "@Nadrieril", "@nnethercote", - "@Noratrieb", "@oli-obk", "@petrochenkov", "@SparrowLii", @@ -1206,7 +1204,6 @@ compiler = [ ] libs = [ "@Mark-Simulacrum", - "@Noratrieb", "@workingjubilee", "@joboet", "@jhpratt",