Skip to content

Commit dabe9ae

Browse files
committed
Auto merge of rust-lang#84600 - m-ou-se:rollup-mf5m2z8, r=m-ou-se
Rollup of 4 pull requests Successful merges: - rust-lang#84120 (Stabilize Duration::MAX) - rust-lang#84523 (Stabilize ordering_helpers.) - rust-lang#84551 (Unify the docs of std::env::{args_os, args} more) - rust-lang#84574 (rustdoc: Fix typos in maybe_inline_local fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents b5be766 + a257ceb commit dabe9ae

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

core/src/cmp.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ impl Ordering {
334334
/// # Examples
335335
///
336336
/// ```
337-
/// #![feature(ordering_helpers)]
338337
/// use std::cmp::Ordering;
339338
///
340339
/// assert_eq!(Ordering::Less.is_eq(), false);
@@ -343,7 +342,8 @@ impl Ordering {
343342
/// ```
344343
#[inline]
345344
#[must_use]
346-
#[unstable(feature = "ordering_helpers", issue = "79885")]
345+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
346+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
347347
pub const fn is_eq(self) -> bool {
348348
matches!(self, Equal)
349349
}
@@ -353,7 +353,6 @@ impl Ordering {
353353
/// # Examples
354354
///
355355
/// ```
356-
/// #![feature(ordering_helpers)]
357356
/// use std::cmp::Ordering;
358357
///
359358
/// assert_eq!(Ordering::Less.is_ne(), true);
@@ -362,7 +361,8 @@ impl Ordering {
362361
/// ```
363362
#[inline]
364363
#[must_use]
365-
#[unstable(feature = "ordering_helpers", issue = "79885")]
364+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
365+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
366366
pub const fn is_ne(self) -> bool {
367367
!matches!(self, Equal)
368368
}
@@ -372,7 +372,6 @@ impl Ordering {
372372
/// # Examples
373373
///
374374
/// ```
375-
/// #![feature(ordering_helpers)]
376375
/// use std::cmp::Ordering;
377376
///
378377
/// assert_eq!(Ordering::Less.is_lt(), true);
@@ -381,7 +380,8 @@ impl Ordering {
381380
/// ```
382381
#[inline]
383382
#[must_use]
384-
#[unstable(feature = "ordering_helpers", issue = "79885")]
383+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
384+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
385385
pub const fn is_lt(self) -> bool {
386386
matches!(self, Less)
387387
}
@@ -391,7 +391,6 @@ impl Ordering {
391391
/// # Examples
392392
///
393393
/// ```
394-
/// #![feature(ordering_helpers)]
395394
/// use std::cmp::Ordering;
396395
///
397396
/// assert_eq!(Ordering::Less.is_gt(), false);
@@ -400,7 +399,8 @@ impl Ordering {
400399
/// ```
401400
#[inline]
402401
#[must_use]
403-
#[unstable(feature = "ordering_helpers", issue = "79885")]
402+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
403+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
404404
pub const fn is_gt(self) -> bool {
405405
matches!(self, Greater)
406406
}
@@ -410,7 +410,6 @@ impl Ordering {
410410
/// # Examples
411411
///
412412
/// ```
413-
/// #![feature(ordering_helpers)]
414413
/// use std::cmp::Ordering;
415414
///
416415
/// assert_eq!(Ordering::Less.is_le(), true);
@@ -419,7 +418,8 @@ impl Ordering {
419418
/// ```
420419
#[inline]
421420
#[must_use]
422-
#[unstable(feature = "ordering_helpers", issue = "79885")]
421+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
422+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
423423
pub const fn is_le(self) -> bool {
424424
!matches!(self, Greater)
425425
}
@@ -429,7 +429,6 @@ impl Ordering {
429429
/// # Examples
430430
///
431431
/// ```
432-
/// #![feature(ordering_helpers)]
433432
/// use std::cmp::Ordering;
434433
///
435434
/// assert_eq!(Ordering::Less.is_ge(), false);
@@ -438,7 +437,8 @@ impl Ordering {
438437
/// ```
439438
#[inline]
440439
#[must_use]
441-
#[unstable(feature = "ordering_helpers", issue = "79885")]
440+
#[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")]
441+
#[stable(feature = "ordering_helpers", since = "1.53.0")]
442442
pub const fn is_ge(self) -> bool {
443443
!matches!(self, Less)
444444
}

core/src/time.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,21 @@ impl Duration {
135135

136136
/// The maximum duration.
137137
///
138-
/// It is roughly equal to a duration of 584,942,417,355 years.
138+
/// May vary by platform as necessary. Must be able to contain the difference between
139+
/// two instances of [`Instant`] or two instances of [`SystemTime`].
140+
/// This constraint gives it a value of about 584,942,417,355 years in practice,
141+
/// which is currently used on all platforms.
139142
///
140143
/// # Examples
141144
///
142145
/// ```
143-
/// #![feature(duration_constants)]
144146
/// use std::time::Duration;
145147
///
146148
/// assert_eq!(Duration::MAX, Duration::new(u64::MAX, 1_000_000_000 - 1));
147149
/// ```
148-
#[unstable(feature = "duration_constants", issue = "57391")]
150+
/// [`Instant`]: ../../std/time/struct.Instant.html
151+
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
152+
#[stable(feature = "duration_saturating_ops", since = "1.53.0")]
149153
pub const MAX: Duration = Duration::new(u64::MAX, NANOS_PER_SEC - 1);
150154

151155
/// Creates a new `Duration` from the specified number of whole seconds and

std/src/env.rs

+16-8
Original file line numberDiff line numberDiff line change
@@ -710,14 +710,14 @@ pub struct ArgsOs {
710710
/// passed as-is.
711711
///
712712
/// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
713-
/// Glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
713+
/// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
714714
/// extension. This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it
715715
/// does on macOS and Windows.
716716
///
717717
/// # Panics
718718
///
719719
/// The returned iterator will panic during iteration if any argument to the
720-
/// process is not valid unicode. If this is not desired,
720+
/// process is not valid Unicode. If this is not desired,
721721
/// use the [`args_os`] function instead.
722722
///
723723
/// # Examples
@@ -735,17 +735,25 @@ pub fn args() -> Args {
735735
Args { inner: args_os() }
736736
}
737737

738-
/// Returns the arguments which this program was started with (normally passed
738+
/// Returns the arguments that this program was started with (normally passed
739739
/// via the command line).
740740
///
741741
/// The first element is traditionally the path of the executable, but it can be
742-
/// set to arbitrary text, and it may not even exist, so this property should
742+
/// set to arbitrary text, and may not even exist. This means this property should
743743
/// not be relied upon for security purposes.
744744
///
745-
/// On glibc Linux systems, arguments are retrieved by placing a function in ".init_array".
746-
/// Glibc passes argc, argv, and envp to functions in ".init_array", as a non-standard extension.
747-
/// This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS
748-
/// and Windows.
745+
/// On Unix systems the shell usually expands unquoted arguments with glob patterns
746+
/// (such as `*` and `?`). On Windows this is not done, and such arguments are
747+
/// passed as-is.
748+
///
749+
/// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
750+
/// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
751+
/// extension. This allows `std::env::args_os` to work even in a `cdylib` or `staticlib`, as it
752+
/// does on macOS and Windows.
753+
///
754+
/// Note that the returned iterator will not check if the arguments to the
755+
/// process are valid Unicode. To ensure UTF-8 validity,
756+
/// use the [`args`] function instead.
749757
///
750758
/// # Examples
751759
///

0 commit comments

Comments
 (0)