Skip to content

Commit 3b84829

Browse files
committed
Auto merge of #95133 - matthiaskrgr:rollup-4q0u804, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #94749 (remove_dir_all: use fallback implementation on Miri) - #94948 (Fix diagnostics for `#![feature(deprecated_suggestion)]`) - #94989 (Add Stream alias for AsyncIterator) - #95108 (Give more details in `Display` for `hir::Target`) - #95110 (Provide more useful documentation of conversion methods) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 499d4a5 + 9725caf commit 3b84829

File tree

7 files changed

+22
-17
lines changed

7 files changed

+22
-17
lines changed

compiler/rustc_attr/src/builtin.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ where
758758
if sess.is_nightly_build() {
759759
diag.help("add `#![feature(deprecated_suggestion)]` to the crate root");
760760
}
761-
// FIXME(jhpratt) change this to an actual tracking issue
762-
diag.note("see #XXX for more details").emit();
761+
diag.note("see #94785 for more details").emit();
763762
}
764763

765764
if !get(mi, &mut suggestion) {
@@ -772,10 +771,10 @@ where
772771
meta.span(),
773772
AttrError::UnknownMetaItem(
774773
pprust::path_to_string(&mi.path),
775-
if attr.has_name(sym::deprecated) {
776-
&["since", "note"]
777-
} else {
774+
if sess.features_untracked().deprecated_suggestion {
778775
&["since", "note", "suggestion"]
776+
} else {
777+
&["since", "note"]
779778
},
780779
),
781780
);

compiler/rustc_hir/src/target.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ impl Display for Target {
8686
Target::Statement => "statement",
8787
Target::Arm => "match arm",
8888
Target::AssocConst => "associated const",
89-
Target::Method(_) => "method",
89+
Target::Method(kind) => match kind {
90+
MethodKind::Inherent => "inherent method",
91+
MethodKind::Trait { body: false } => "required trait method",
92+
MethodKind::Trait { body: true } => "provided trait method",
93+
},
9094
Target::AssocTy => "associated type",
9195
Target::ForeignFn => "foreign function",
9296
Target::ForeignStatic => "foreign static item",

library/core/src/async_iter/async_iter.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::task::{Context, Poll};
1212
/// [impl]: index.html#implementing-async-iterator
1313
#[unstable(feature = "async_iterator", issue = "79024")]
1414
#[must_use = "async iterators do nothing unless polled"]
15+
#[doc(alias = "Stream")]
1516
pub trait AsyncIterator {
1617
/// The type of items yielded by the async iterator.
1718
type Item;

library/core/src/convert/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub const fn identity<T>(x: T) -> T {
154154
#[stable(feature = "rust1", since = "1.0.0")]
155155
#[cfg_attr(not(test), rustc_diagnostic_item = "AsRef")]
156156
pub trait AsRef<T: ?Sized> {
157-
/// Performs the conversion.
157+
/// Converts this type into a shared reference of the (usually inferred) input type.
158158
#[stable(feature = "rust1", since = "1.0.0")]
159159
fn as_ref(&self) -> &T;
160160
}
@@ -196,7 +196,7 @@ pub trait AsRef<T: ?Sized> {
196196
#[stable(feature = "rust1", since = "1.0.0")]
197197
#[cfg_attr(not(test), rustc_diagnostic_item = "AsMut")]
198198
pub trait AsMut<T: ?Sized> {
199-
/// Performs the conversion.
199+
/// Converts this type into a mutable reference of the (usually inferred) input type.
200200
#[stable(feature = "rust1", since = "1.0.0")]
201201
fn as_mut(&mut self) -> &mut T;
202202
}
@@ -272,7 +272,7 @@ pub trait AsMut<T: ?Sized> {
272272
#[rustc_diagnostic_item = "Into"]
273273
#[stable(feature = "rust1", since = "1.0.0")]
274274
pub trait Into<T>: Sized {
275-
/// Performs the conversion.
275+
/// Converts this type into the (usually inferred) input type.
276276
#[must_use]
277277
#[stable(feature = "rust1", since = "1.0.0")]
278278
fn into(self) -> T;
@@ -367,7 +367,7 @@ pub trait Into<T>: Sized {
367367
note = "to coerce a `{T}` into a `{Self}`, use `&*` as a prefix",
368368
))]
369369
pub trait From<T>: Sized {
370-
/// Performs the conversion.
370+
/// Converts to this type from the input type.
371371
#[lang = "from"]
372372
#[must_use]
373373
#[stable(feature = "rust1", since = "1.0.0")]

library/std/src/fs.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2049,9 +2049,10 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
20492049
///
20502050
/// [changes]: io#platform-specific-behavior
20512051
///
2052-
/// On macOS before version 10.10 and REDOX this function is not protected against time-of-check to
2053-
/// time-of-use (TOCTOU) race conditions, and should not be used in security-sensitive code on
2054-
/// those platforms. All other platforms are protected.
2052+
/// On macOS before version 10.10 and REDOX, as well as when running in Miri for any target, this
2053+
/// function is not protected against time-of-check to time-of-use (TOCTOU) race conditions, and
2054+
/// should not be used in security-sensitive code on those platforms. All other platforms are
2055+
/// protected.
20552056
///
20562057
/// # Errors
20572058
///

library/std/src/sys/unix/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1517,14 +1517,14 @@ pub fn chroot(dir: &Path) -> io::Result<()> {
15171517

15181518
pub use remove_dir_impl::remove_dir_all;
15191519

1520-
// Fallback for REDOX and ESP-IDF
1521-
#[cfg(any(target_os = "redox", target_os = "espidf"))]
1520+
// Fallback for REDOX and ESP-IDF (and Miri)
1521+
#[cfg(any(target_os = "redox", target_os = "espidf", miri))]
15221522
mod remove_dir_impl {
15231523
pub use crate::sys_common::fs::remove_dir_all;
15241524
}
15251525

15261526
// Modern implementation using openat(), unlinkat() and fdopendir()
1527-
#[cfg(not(any(target_os = "redox", target_os = "espidf")))]
1527+
#[cfg(not(any(target_os = "redox", target_os = "espidf", miri)))]
15281528
mod remove_dir_impl {
15291529
use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir};
15301530
use crate::ffi::CStr;

src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | #[deprecated(suggestion = "foo")]
55
| ^^^^^^^^^^^^^^^^^^
66
|
77
= help: add `#![feature(deprecated_suggestion)]` to the crate root
8-
= note: see #XXX for more details
8+
= note: see #94785 for more details
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)