diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 8a134bf7f9662..8e748aaa58b59 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -758,8 +758,7 @@ where if sess.is_nightly_build() { diag.help("add `#![feature(deprecated_suggestion)]` to the crate root"); } - // FIXME(jhpratt) change this to an actual tracking issue - diag.note("see #XXX for more details").emit(); + diag.note("see #94785 for more details").emit(); } if !get(mi, &mut suggestion) { @@ -772,10 +771,10 @@ where meta.span(), AttrError::UnknownMetaItem( pprust::path_to_string(&mi.path), - if attr.has_name(sym::deprecated) { - &["since", "note"] - } else { + if sess.features_untracked().deprecated_suggestion { &["since", "note", "suggestion"] + } else { + &["since", "note"] }, ), ); diff --git a/compiler/rustc_codegen_cranelift/patches/0022-sysroot-Disable-not-compiling-tests.patch b/compiler/rustc_codegen_cranelift/patches/0022-sysroot-Disable-not-compiling-tests.patch index 1c45c7573c813..301b3f9bde4dd 100644 --- a/compiler/rustc_codegen_cranelift/patches/0022-sysroot-Disable-not-compiling-tests.patch +++ b/compiler/rustc_codegen_cranelift/patches/0022-sysroot-Disable-not-compiling-tests.patch @@ -39,26 +39,6 @@ index a35897e..f0bf645 100644 pub fn decode_finite(v: T) -> Decoded { match decode(v).1 { -diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs -index 1a6be3a..42dbd59 100644 ---- a/library/core/tests/ptr.rs -+++ b/library/core/tests/ptr.rs -@@ -250,6 +250,7 @@ fn test_unsized_nonnull() { - }; - } - -+/* - #[test] - #[allow(warnings)] - // Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the -@@ -277,6 +277,7 @@ pub fn test_variadic_fnptr() { - let mut s = SipHasher::new(); - assert_eq!(p.hash(&mut s), q.hash(&mut s)); - } -+*/ - - #[test] - fn write_unaligned_drop() { diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs index 6609bc3..241b497 100644 --- a/library/core/tests/slice.rs diff --git a/compiler/rustc_hir/src/target.rs b/compiler/rustc_hir/src/target.rs index 29c948fe31845..70d9db4a84ba1 100644 --- a/compiler/rustc_hir/src/target.rs +++ b/compiler/rustc_hir/src/target.rs @@ -86,7 +86,11 @@ impl Display for Target { Target::Statement => "statement", Target::Arm => "match arm", Target::AssocConst => "associated const", - Target::Method(_) => "method", + Target::Method(kind) => match kind { + MethodKind::Inherent => "inherent method", + MethodKind::Trait { body: false } => "required trait method", + MethodKind::Trait { body: true } => "provided trait method", + }, Target::AssocTy => "associated type", Target::ForeignFn => "foreign function", Target::ForeignStatic => "foreign static item", diff --git a/library/core/src/async_iter/async_iter.rs b/library/core/src/async_iter/async_iter.rs index f29de31171a67..016a3685e850c 100644 --- a/library/core/src/async_iter/async_iter.rs +++ b/library/core/src/async_iter/async_iter.rs @@ -12,6 +12,7 @@ use crate::task::{Context, Poll}; /// [impl]: index.html#implementing-async-iterator #[unstable(feature = "async_iterator", issue = "79024")] #[must_use = "async iterators do nothing unless polled"] +#[doc(alias = "Stream")] pub trait AsyncIterator { /// The type of items yielded by the async iterator. type Item; diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index f5ea5f5ba50c0..e2ffc8c9121f3 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -154,7 +154,7 @@ pub const fn identity(x: T) -> T { #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "AsRef")] pub trait AsRef { - /// Performs the conversion. + /// Converts this type into a shared reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] fn as_ref(&self) -> &T; } @@ -196,7 +196,7 @@ pub trait AsRef { #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "AsMut")] pub trait AsMut { - /// Performs the conversion. + /// Converts this type into a mutable reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] fn as_mut(&mut self) -> &mut T; } @@ -272,7 +272,7 @@ pub trait AsMut { #[rustc_diagnostic_item = "Into"] #[stable(feature = "rust1", since = "1.0.0")] pub trait Into: Sized { - /// Performs the conversion. + /// Converts this type into the (usually inferred) input type. #[must_use] #[stable(feature = "rust1", since = "1.0.0")] fn into(self) -> T; @@ -367,7 +367,7 @@ pub trait Into: Sized { note = "to coerce a `{T}` into a `{Self}`, use `&*` as a prefix", ))] pub trait From: Sized { - /// Performs the conversion. + /// Converts to this type from the input type. #[lang = "from"] #[must_use] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index dc3740228274b..5c861236e86f1 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -23,6 +23,7 @@ #![feature(const_ptr_offset)] #![feature(const_trait_impl)] #![feature(const_likely)] +#![feature(core_ffi_c)] #![feature(core_intrinsics)] #![feature(core_private_bignum)] #![feature(core_private_diy_float)] diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs index af8e78f1f4e16..84d3ae03ef4a1 100644 --- a/library/core/tests/ptr.rs +++ b/library/core/tests/ptr.rs @@ -289,16 +289,18 @@ fn test_const_nonnull_new() { } #[test] -#[allow(warnings)] -// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the -// ABI, or even point to an actual executable code, because the function itself is never invoked. -#[no_mangle] +#[cfg(any(unix, windows))] // printf may not be available on other platforms +#[allow(deprecated)] // For SipHasher pub fn test_variadic_fnptr() { + use core::ffi; use core::hash::{Hash, SipHasher}; extern "C" { - fn test_variadic_fnptr(_: u64, ...) -> f64; + // This needs to use the correct function signature even though it isn't called as some + // codegen backends make it UB to declare a function with multiple conflicting signatures + // (like LLVM) while others straight up return an error (like Cranelift). + fn printf(_: *const ffi::c_char, ...) -> ffi::c_int; } - let p: unsafe extern "C" fn(u64, ...) -> f64 = test_variadic_fnptr; + let p: unsafe extern "C" fn(*const ffi::c_char, ...) -> ffi::c_int = printf; let q = p.clone(); assert_eq!(p, q); assert!(!(p < q)); diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index c99d9b279a928..d4e103ab525e8 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -2049,9 +2049,10 @@ pub fn remove_dir>(path: P) -> io::Result<()> { /// /// [changes]: io#platform-specific-behavior /// -/// On macOS before version 10.10 and REDOX this function is not protected against time-of-check to -/// time-of-use (TOCTOU) race conditions, and should not be used in security-sensitive code on -/// those platforms. All other platforms are protected. +/// On macOS before version 10.10 and REDOX, as well as when running in Miri for any target, this +/// function is not protected against time-of-check to time-of-use (TOCTOU) race conditions, and +/// should not be used in security-sensitive code on those platforms. All other platforms are +/// protected. /// /// # Errors /// diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index a3e6b081936b6..b93a3d677711f 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -1517,14 +1517,14 @@ pub fn chroot(dir: &Path) -> io::Result<()> { pub use remove_dir_impl::remove_dir_all; -// Fallback for REDOX and ESP-IDF -#[cfg(any(target_os = "redox", target_os = "espidf"))] +// Fallback for REDOX and ESP-IDF (and Miri) +#[cfg(any(target_os = "redox", target_os = "espidf", miri))] mod remove_dir_impl { pub use crate::sys_common::fs::remove_dir_all; } // Modern implementation using openat(), unlinkat() and fdopendir() -#[cfg(not(any(target_os = "redox", target_os = "espidf")))] +#[cfg(not(any(target_os = "redox", target_os = "espidf", miri)))] mod remove_dir_impl { use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir}; use crate::ffi::CStr; diff --git a/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr b/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr index 3b995fed75c8c..438ce3349d252 100644 --- a/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr +++ b/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr @@ -5,7 +5,7 @@ LL | #[deprecated(suggestion = "foo")] | ^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(deprecated_suggestion)]` to the crate root - = note: see #XXX for more details + = note: see #94785 for more details error: aborting due to previous error