Skip to content
Merged
24 changes: 12 additions & 12 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_eq(), false);
Expand All @@ -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)
}
Expand All @@ -353,7 +353,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_ne(), true);
Expand All @@ -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)
}
Expand All @@ -372,7 +372,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_lt(), true);
Expand All @@ -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)
}
Expand All @@ -391,7 +391,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_gt(), false);
Expand All @@ -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)
}
Expand All @@ -410,7 +410,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_le(), true);
Expand All @@ -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)
}
Expand All @@ -429,7 +429,6 @@ impl Ordering {
/// # Examples
///
/// ```
/// #![feature(ordering_helpers)]
/// use std::cmp::Ordering;
///
/// assert_eq!(Ordering::Less.is_ge(), false);
Expand All @@ -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)
}
Expand Down
10 changes: 7 additions & 3 deletions library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 16 additions & 8 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
///
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)`)
Expand Down Expand Up @@ -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 {
Expand Down