Auto merge of #84600 - m-ou-se:rollup-mf5m2z8, r=m-ou-se
Rollup of 4 pull requests Successful merges: - #84120 (Stabilize Duration::MAX) - #84523 (Stabilize ordering_helpers.) - #84551 (Unify the docs of std::env::{args_os, args} more) - #84574 (rustdoc: Fix typos in maybe_inline_local fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
9684258936
4 changed files with 37 additions and 25 deletions
|
|
@ -334,7 +334,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_eq(), false);
|
||||
|
|
@ -343,7 +342,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_eq(self) -> bool {
|
||||
matches!(self, Equal)
|
||||
}
|
||||
|
|
@ -353,7 +353,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_ne(), true);
|
||||
|
|
@ -362,7 +361,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_ne(self) -> bool {
|
||||
!matches!(self, Equal)
|
||||
}
|
||||
|
|
@ -372,7 +372,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_lt(), true);
|
||||
|
|
@ -381,7 +380,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_lt(self) -> bool {
|
||||
matches!(self, Less)
|
||||
}
|
||||
|
|
@ -391,7 +391,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_gt(), false);
|
||||
|
|
@ -400,7 +399,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_gt(self) -> bool {
|
||||
matches!(self, Greater)
|
||||
}
|
||||
|
|
@ -410,7 +410,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_le(), true);
|
||||
|
|
@ -419,7 +418,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_le(self) -> bool {
|
||||
!matches!(self, Greater)
|
||||
}
|
||||
|
|
@ -429,7 +429,6 @@ impl Ordering {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ordering_helpers)]
|
||||
/// use std::cmp::Ordering;
|
||||
///
|
||||
/// assert_eq!(Ordering::Less.is_ge(), false);
|
||||
|
|
@ -438,7 +437,8 @@ impl Ordering {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ordering_helpers", issue = "79885")]
|
||||
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
#[stable(feature = "ordering_helpers", since = "1.53.0")]
|
||||
pub const fn is_ge(self) -> bool {
|
||||
!matches!(self, Less)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,17 +135,21 @@ impl Duration {
|
|||
|
||||
/// The maximum duration.
|
||||
///
|
||||
/// It is roughly equal to a duration of 584,942,417,355 years.
|
||||
/// May vary by platform as necessary. Must be able to contain the difference between
|
||||
/// two instances of [`Instant`] or two instances of [`SystemTime`].
|
||||
/// This constraint gives it a value of about 584,942,417,355 years in practice,
|
||||
/// which is currently used on all platforms.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(duration_constants)]
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// assert_eq!(Duration::MAX, Duration::new(u64::MAX, 1_000_000_000 - 1));
|
||||
/// ```
|
||||
#[unstable(feature = "duration_constants", issue = "57391")]
|
||||
/// [`Instant`]: ../../std/time/struct.Instant.html
|
||||
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
|
||||
#[stable(feature = "duration_saturating_ops", since = "1.53.0")]
|
||||
pub const MAX: Duration = Duration::new(u64::MAX, NANOS_PER_SEC - 1);
|
||||
|
||||
/// Creates a new `Duration` from the specified number of whole seconds and
|
||||
|
|
|
|||
|
|
@ -710,14 +710,14 @@ pub struct ArgsOs {
|
|||
/// passed as-is.
|
||||
///
|
||||
/// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
|
||||
/// Glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
|
||||
/// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
|
||||
/// extension. This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it
|
||||
/// does on macOS and Windows.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// The returned iterator will panic during iteration if any argument to the
|
||||
/// process is not valid unicode. If this is not desired,
|
||||
/// process is not valid Unicode. If this is not desired,
|
||||
/// use the [`args_os`] function instead.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
@ -735,17 +735,25 @@ pub fn args() -> Args {
|
|||
Args { inner: args_os() }
|
||||
}
|
||||
|
||||
/// Returns the arguments which this program was started with (normally passed
|
||||
/// Returns the arguments that this program was started with (normally passed
|
||||
/// via the command line).
|
||||
///
|
||||
/// The first element is traditionally the path of the executable, but it can be
|
||||
/// set to arbitrary text, and it may not even exist, so this property should
|
||||
/// set to arbitrary text, and may not even exist. This means this property should
|
||||
/// not be relied upon for security purposes.
|
||||
///
|
||||
/// On glibc Linux systems, arguments are retrieved by placing a function in ".init_array".
|
||||
/// Glibc passes argc, argv, and envp to functions in ".init_array", as a non-standard extension.
|
||||
/// This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS
|
||||
/// and Windows.
|
||||
/// On Unix systems the shell usually expands unquoted arguments with glob patterns
|
||||
/// (such as `*` and `?`). On Windows this is not done, and such arguments are
|
||||
/// passed as-is.
|
||||
///
|
||||
/// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
|
||||
/// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
|
||||
/// extension. This allows `std::env::args_os` to work even in a `cdylib` or `staticlib`, as it
|
||||
/// does on macOS and Windows.
|
||||
///
|
||||
/// Note that the returned iterator will not check if the arguments to the
|
||||
/// process are valid Unicode. To ensure UTF-8 validity,
|
||||
/// use the [`args`] function instead.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
om
|
||||
}
|
||||
|
||||
/// Tries to resolve the target of a `crate use` statement and inlines the
|
||||
/// Tries to resolve the target of a `pub use` statement and inlines the
|
||||
/// target if it is defined locally and would not be documented otherwise,
|
||||
/// or when it is specifically requested with `please_inline`.
|
||||
/// (the latter is the case when the import is marked `doc(inline)`)
|
||||
|
|
@ -183,7 +183,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
|| use_attrs.lists(sym::doc).has_word(sym::hidden);
|
||||
|
||||
// For cross-crate impl inlining we need to know whether items are
|
||||
// reachable in documentation -- a previously nonreachable item can be
|
||||
// reachable in documentation -- a previously unreachable item can be
|
||||
// made reachable by cross-crate inlining which we're checking here.
|
||||
// (this is done here because we need to know this upfront).
|
||||
if !res_did.is_local() && !is_no_inline {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue