Rollup merge of #126776 - nnethercote:rustfmt-use-pre-cleanups-2, r=c… · model-checking/verify-rust-std@12075d1

14 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,4 @@

1-

// We avoid relying on anything else in the crate, apart from the `Debug` trait.

2-

use crate::fmt::Debug;

1+

use crate::fmt::Debug; // the `Debug` trait is the only thing we use from `crate::fmt`

32

use std::cmp::Ordering;

43

use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};

54
Original file line numberDiff line numberDiff line change

@@ -24,19 +24,17 @@ mod convert;

2424

mod decode;

2525

mod methods;

2626
27-

// stable re-exports

2827

#[stable(feature = "try_from", since = "1.34.0")]

2928

pub use self::convert::CharTryFromError;

3029

#[stable(feature = "char_from_str", since = "1.20.0")]

3130

pub use self::convert::ParseCharError;

3231

#[stable(feature = "decode_utf16", since = "1.9.0")]

3332

pub use self::decode::{DecodeUtf16, DecodeUtf16Error};

3433
35-

// perma-unstable re-exports

3634

#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]

37-

pub use self::methods::encode_utf16_raw;

35+

pub use self::methods::encode_utf16_raw; // perma-unstable

3836

#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]

39-

pub use self::methods::encode_utf8_raw;

37+

pub use self::methods::encode_utf8_raw; // perma-unstable

4038
4139

use crate::ascii;

4240

use crate::error::Error;

Original file line numberDiff line numberDiff line change

@@ -2,6 +2,9 @@

22

//!

33

//! See the [module-level documentation](super) for more.

44
5+

// No formatting: this file is nothing but re-exports, and their order is worth preserving.

6+

#![cfg_attr(rustfmt, rustfmt::skip)]

7+
58

// Re-exported core operators

69

#[stable(feature = "core_prelude", since = "1.4.0")]

710

#[doc(no_inline)]

@@ -33,10 +36,7 @@ pub use crate::convert::{AsMut, AsRef, From, Into};

3336

pub use crate::default::Default;

3437

#[stable(feature = "core_prelude", since = "1.4.0")]

3538

#[doc(no_inline)]

36-

pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};

37-

#[stable(feature = "core_prelude", since = "1.4.0")]

38-

#[doc(no_inline)]

39-

pub use crate::iter::{Extend, IntoIterator, Iterator};

39+

pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator, Extend, IntoIterator, Iterator};

4040

#[stable(feature = "core_prelude", since = "1.4.0")]

4141

#[doc(no_inline)]

4242

pub use crate::option::Option::{self, None, Some};

Original file line numberDiff line numberDiff line change

@@ -4,6 +4,9 @@

44

//! This module is imported by default when `#![no_std]` is used in the same

55

//! manner as the standard library's prelude.

66
7+

// No formatting: this file is nothing but re-exports, and their order is worth preserving.

8+

#![cfg_attr(rustfmt, rustfmt::skip)]

9+
710

#![stable(feature = "core_prelude", since = "1.4.0")]

811
912

mod common;

Original file line numberDiff line numberDiff line change

@@ -1809,10 +1809,9 @@ pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usiz

18091809

// FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=

18101810

// 1, where the method versions of these operations are not inlined.

18111811

use intrinsics::{

1812-

assume, cttz_nonzero, exact_div, mul_with_overflow, unchecked_rem, unchecked_sub,

1813-

wrapping_add, wrapping_mul, wrapping_sub,

1812+

assume, cttz_nonzero, exact_div, mul_with_overflow, unchecked_rem, unchecked_shl,

1813+

unchecked_shr, unchecked_sub, wrapping_add, wrapping_mul, wrapping_sub,

18141814

};

1815-

use intrinsics::{unchecked_shl, unchecked_shr};

18161815
18171816

/// Calculate multiplicative modular inverse of `x` modulo `m`.

18181817

///

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,19 @@

11

#![unstable(feature = "unicode_internals", issue = "none")]

22

#![allow(missing_docs)]

33
4+

// The `pub use` ones are for use in alloc, and are not re-exported in std.

5+
6+

pub(crate) use unicode_data::alphabetic::lookup as Alphabetic;

7+

pub use unicode_data::case_ignorable::lookup as Case_Ignorable;

8+

pub use unicode_data::cased::lookup as Cased;

9+

pub(crate) use unicode_data::cc::lookup as Cc;

10+

pub use unicode_data::conversions;

11+

pub(crate) use unicode_data::grapheme_extend::lookup as Grapheme_Extend;

12+

pub(crate) use unicode_data::lowercase::lookup as Lowercase;

13+

pub(crate) use unicode_data::n::lookup as N;

14+

pub(crate) use unicode_data::uppercase::lookup as Uppercase;

15+

pub(crate) use unicode_data::white_space::lookup as White_Space;

16+
417

pub(crate) mod printable;

518

mod unicode_data;

619

@@ -16,16 +29,3 @@ mod unicode_data;

1629

/// [Unicode 11.0 or later, Section 3.1 Versions of the Unicode Standard](https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf#page=4).

1730

#[stable(feature = "unicode_version", since = "1.45.0")]

1831

pub const UNICODE_VERSION: (u8, u8, u8) = unicode_data::UNICODE_VERSION;

19-
20-

// For use in alloc, not re-exported in std.

21-

pub use unicode_data::{

22-

case_ignorable::lookup as Case_Ignorable, cased::lookup as Cased, conversions,

23-

};

24-
25-

pub(crate) use unicode_data::alphabetic::lookup as Alphabetic;

26-

pub(crate) use unicode_data::cc::lookup as Cc;

27-

pub(crate) use unicode_data::grapheme_extend::lookup as Grapheme_Extend;

28-

pub(crate) use unicode_data::lowercase::lookup as Lowercase;

29-

pub(crate) use unicode_data::n::lookup as N;

30-

pub(crate) use unicode_data::uppercase::lookup as Uppercase;

31-

pub(crate) use unicode_data::white_space::lookup as White_Space;

Original file line numberDiff line numberDiff line change

@@ -470,7 +470,6 @@ pub mod rt;

470470

// The Rust prelude

471471

pub mod prelude;

472472
473-

// Public module declarations and re-exports

474473

#[stable(feature = "rust1", since = "1.0.0")]

475474

pub use alloc_crate::borrow;

476475

#[stable(feature = "rust1", since = "1.0.0")]

Original file line numberDiff line numberDiff line change

@@ -28,7 +28,6 @@ pub mod usercalls {

2828

pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};

2929

pub use crate::sys::abi::usercalls::raw::{Register, RegisterArgument, ReturnValue};

3030
31-

// fortanix-sgx-abi re-exports

3231

pub use crate::sys::abi::usercalls::raw::Error;

3332

pub use crate::sys::abi::usercalls::raw::{

3433

ByteBuffer, Cancel, FifoDescriptor, Return, Usercall,

Original file line numberDiff line numberDiff line change

@@ -2,6 +2,9 @@

22

//!

33

//! See the [module-level documentation](super) for more.

44
5+

// No formatting: this file is nothing but re-exports, and their order is worth preserving.

6+

#![cfg_attr(rustfmt, rustfmt::skip)]

7+
58

// Re-exported core operators

69

#[stable(feature = "rust1", since = "1.0.0")]

710

#[doc(no_inline)]

Original file line numberDiff line numberDiff line change

@@ -95,6 +95,9 @@

9595

//! [book-enums]: ../../book/ch06-01-defining-an-enum.html

9696

//! [book-iter]: ../../book/ch13-02-iterators.html

9797
98+

// No formatting: this file is nothing but re-exports, and their order is worth preserving.

99+

#![cfg_attr(rustfmt, rustfmt::skip)]

100+
98101

#![stable(feature = "rust1", since = "1.0.0")]

99102
100103

mod common;