Skip to content

Commit 74bd074

Browse files
committed
Auto merge of rust-lang#70747 - Centril:rollup-2vx9bve, r=Centril
Rollup of 9 pull requests Successful merges: - rust-lang#69860 (Use associated numeric consts in documentation) - rust-lang#70576 (Update the description of the ticket to point at RFC 1721) - rust-lang#70597 (Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new) - rust-lang#70640 (Hide `task_context` when lowering body) - rust-lang#70641 (Remove duplicated code in trait selection) - rust-lang#70707 (Remove unused graphviz emitter) - rust-lang#70720 (Place TLS initializers with relocations in .tdata) - rust-lang#70735 (Clean up E0502 explanation) - rust-lang#70741 (Add test for rust-lang#59023) Failed merges: r? @ghost
2 parents f6fe99c + 4c41ea3 commit 74bd074

File tree

41 files changed

+283
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+283
-709
lines changed

src/liballoc/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl<T> [T] {
432432
///
433433
/// ```should_panic
434434
/// // this will panic at runtime
435-
/// b"0123456789abcdef".repeat(usize::max_value());
435+
/// b"0123456789abcdef".repeat(usize::MAX);
436436
/// ```
437437
#[stable(feature = "repeat_generic_slice", since = "1.40.0")]
438438
pub fn repeat(&self, n: usize) -> Vec<T>

src/liballoc/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl str {
499499
///
500500
/// ```should_panic
501501
/// // this will panic at runtime
502-
/// "0123456789abcdef".repeat(usize::max_value());
502+
/// "0123456789abcdef".repeat(usize::MAX);
503503
/// ```
504504
#[stable(feature = "repeat_str", since = "1.16.0")]
505505
pub fn repeat(&self, n: usize) -> String {

src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
817817
/// When comparison is impossible:
818818
///
819819
/// ```
820-
/// let result = std::f64::NAN.partial_cmp(&1.0);
820+
/// let result = f64::NAN.partial_cmp(&1.0);
821821
/// assert_eq!(result, None);
822822
/// ```
823823
#[must_use]

src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ pub trait LowerHex {
852852
/// }
853853
/// }
854854
///
855-
/// let l = Length(i32::max_value());
855+
/// let l = Length(i32::MAX);
856856
///
857857
/// assert_eq!(format!("l as hex is: {:X}", l), "l as hex is: 7FFFFFFF");
858858
///

src/libcore/hint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::intrinsics;
4343
///
4444
/// assert_eq!(div_1(7, 0), 7);
4545
/// assert_eq!(div_1(9, 1), 4);
46-
/// assert_eq!(div_1(11, std::u32::MAX), 0);
46+
/// assert_eq!(div_1(11, u32::MAX), 0);
4747
/// ```
4848
#[inline]
4949
#[stable(feature = "unreachable", since = "1.27.0")]

src/libcore/intrinsics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,19 +1739,19 @@ extern "rust-intrinsic" {
17391739
pub fn mul_with_overflow<T: Copy>(x: T, y: T) -> (T, bool);
17401740

17411741
/// Performs an exact division, resulting in undefined behavior where
1742-
/// `x % y != 0` or `y == 0` or `x == T::min_value() && y == -1`
1742+
/// `x % y != 0` or `y == 0` or `x == T::MIN && y == -1`
17431743
pub fn exact_div<T: Copy>(x: T, y: T) -> T;
17441744

17451745
/// Performs an unchecked division, resulting in undefined behavior
1746-
/// where y = 0 or x = `T::min_value()` and y = -1
1746+
/// where y = 0 or x = `T::MIN` and y = -1
17471747
///
17481748
/// The stabilized versions of this intrinsic are available on the integer
17491749
/// primitives via the `checked_div` method. For example,
17501750
/// [`std::u32::checked_div`](../../std/primitive.u32.html#method.checked_div)
17511751
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")]
17521752
pub fn unchecked_div<T: Copy>(x: T, y: T) -> T;
17531753
/// Returns the remainder of an unchecked division, resulting in
1754-
/// undefined behavior where y = 0 or x = `T::min_value()` and y = -1
1754+
/// undefined behavior where y = 0 or x = `T::MIN` and y = -1
17551755
///
17561756
/// The stabilized versions of this intrinsic are available on the integer
17571757
/// primitives via the `checked_rem` method. For example,
@@ -1777,17 +1777,17 @@ extern "rust-intrinsic" {
17771777
pub fn unchecked_shr<T: Copy>(x: T, y: T) -> T;
17781778

17791779
/// Returns the result of an unchecked addition, resulting in
1780-
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
1780+
/// undefined behavior when `x + y > T::MAX` or `x + y < T::MIN`.
17811781
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")]
17821782
pub fn unchecked_add<T: Copy>(x: T, y: T) -> T;
17831783

17841784
/// Returns the result of an unchecked subtraction, resulting in
1785-
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
1785+
/// undefined behavior when `x - y > T::MAX` or `x - y < T::MIN`.
17861786
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")]
17871787
pub fn unchecked_sub<T: Copy>(x: T, y: T) -> T;
17881788

17891789
/// Returns the result of an unchecked multiplication, resulting in
1790-
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
1790+
/// undefined behavior when `x * y > T::MAX` or `x * y < T::MIN`.
17911791
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")]
17921792
pub fn unchecked_mul<T: Copy>(x: T, y: T) -> T;
17931793

src/libcore/iter/traits/iterator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub trait Iterator {
198198
/// // and the maximum possible lower bound
199199
/// let iter = 0..;
200200
///
201-
/// assert_eq!((usize::max_value(), None), iter.size_hint());
201+
/// assert_eq!((usize::MAX, None), iter.size_hint());
202202
/// ```
203203
#[inline]
204204
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2920,7 +2920,7 @@ pub trait Iterator {
29202920
/// assert_eq!([1.].iter().partial_cmp([1., 2.].iter()), Some(Ordering::Less));
29212921
/// assert_eq!([1., 2.].iter().partial_cmp([1.].iter()), Some(Ordering::Greater));
29222922
///
2923-
/// assert_eq!([std::f64::NAN].iter().partial_cmp([1.].iter()), None);
2923+
/// assert_eq!([f64::NAN].iter().partial_cmp([1.].iter()), None);
29242924
/// ```
29252925
#[stable(feature = "iter_order", since = "1.5.0")]
29262926
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
@@ -3170,7 +3170,7 @@ pub trait Iterator {
31703170
/// assert!(![1, 3, 2, 4].iter().is_sorted());
31713171
/// assert!([0].iter().is_sorted());
31723172
/// assert!(std::iter::empty::<i32>().is_sorted());
3173-
/// assert!(![0.0, 1.0, std::f32::NAN].iter().is_sorted());
3173+
/// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted());
31743174
/// ```
31753175
#[inline]
31763176
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
@@ -3197,7 +3197,7 @@ pub trait Iterator {
31973197
/// assert!(![1, 3, 2, 4].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
31983198
/// assert!([0].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
31993199
/// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| a.partial_cmp(b)));
3200-
/// assert!(![0.0, 1.0, std::f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
3200+
/// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
32013201
/// ```
32023202
///
32033203
/// [`is_sorted`]: trait.Iterator.html#method.is_sorted

src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ impl f32 {
470470
///
471471
/// let value = -128.9_f32;
472472
/// let rounded = unsafe { value.to_int_unchecked::<i8>() };
473-
/// assert_eq!(rounded, std::i8::MIN);
473+
/// assert_eq!(rounded, i8::MIN);
474474
/// ```
475475
///
476476
/// # Safety

src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl f64 {
484484
///
485485
/// let value = -128.9_f32;
486486
/// let rounded = unsafe { value.to_int_unchecked::<i8>() };
487-
/// assert_eq!(rounded, std::i8::MIN);
487+
/// assert_eq!(rounded, i8::MIN);
488488
/// ```
489489
///
490490
/// # Safety

src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ NonZeroI8 NonZeroI16 NonZeroI32 NonZeroI64 NonZeroI128 NonZeroIsize }
174174
/// let zero = Wrapping(0u32);
175175
/// let one = Wrapping(1u32);
176176
///
177-
/// assert_eq!(std::u32::MAX, (zero - one).0);
177+
/// assert_eq!(u32::MAX, (zero - one).0);
178178
/// ```
179179
#[stable(feature = "rust1", since = "1.0.0")]
180180
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)]

0 commit comments

Comments
 (0)