Skip to content

Commit a5da025

Browse files
author
The Miri Cronjob Bot
committed
Merge ref 'f4665ab8368a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f4665ab Filtered ref: d2e3c00d12fb613c03777e620c50528112247ad2 Upstream diff: rust-lang/rust@a09fbe2...f4665ab This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 2156fdf + e4e098f commit a5da025

Some content is hidden

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

52 files changed

+923
-737
lines changed

Cargo.lock

Lines changed: 2 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

alloc/src/str.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,8 @@ impl str {
418418
}
419419

420420
fn case_ignorable_then_cased<I: Iterator<Item = char>>(iter: I) -> bool {
421-
use core::unicode::{Case_Ignorable, Cased};
422-
match iter.skip_while(|&c| Case_Ignorable(c)).next() {
423-
Some(c) => Cased(c),
421+
match iter.skip_while(|&c| c.is_case_ignorable()).next() {
422+
Some(c) => c.is_cased(),
424423
None => false,
425424
}
426425
}

core/src/char/methods.rs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,43 @@ impl char {
969969
#[must_use]
970970
#[inline]
971971
pub(crate) fn is_grapheme_extended(self) -> bool {
972-
unicode::Grapheme_Extend(self)
972+
!self.is_ascii() && unicode::Grapheme_Extend(self)
973+
}
974+
975+
/// Returns `true` if this `char` has the `Cased` property.
976+
///
977+
/// `Cased` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
978+
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
979+
///
980+
/// [Unicode Standard]: https://www.unicode.org/versions/latest/
981+
/// [ucd]: https://www.unicode.org/reports/tr44/
982+
/// [`DerivedCoreProperties.txt`]: https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt
983+
#[must_use]
984+
#[inline]
985+
#[doc(hidden)]
986+
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
987+
pub fn is_cased(self) -> bool {
988+
if self.is_ascii() { self.is_ascii_alphabetic() } else { unicode::Cased(self) }
989+
}
990+
991+
/// Returns `true` if this `char` has the `Case_Ignorable` property.
992+
///
993+
/// `Case_Ignorable` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
994+
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
995+
///
996+
/// [Unicode Standard]: https://www.unicode.org/versions/latest/
997+
/// [ucd]: https://www.unicode.org/reports/tr44/
998+
/// [`DerivedCoreProperties.txt`]: https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt
999+
#[must_use]
1000+
#[inline]
1001+
#[doc(hidden)]
1002+
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
1003+
pub fn is_case_ignorable(self) -> bool {
1004+
if self.is_ascii() {
1005+
matches!(self, '\'' | '.' | ':' | '^' | '`')
1006+
} else {
1007+
unicode::Case_Ignorable(self)
1008+
}
9731009
}
9741010

9751011
/// Returns `true` if this `char` has one of the general categories for numbers.

core/src/default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::ascii::Char as AsciiChar;
3333
/// }
3434
/// ```
3535
///
36-
/// Now, you get all of the default values. Rust implements `Default` for various primitives types.
36+
/// Now, you get all of the default values. Rust implements `Default` for various primitive types.
3737
///
3838
/// If you want to override a particular option, but still retain the other defaults:
3939
///

core/src/iter/traits/accum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ macro_rules! float_sum_product {
203203

204204
integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
205205
saturating_integer_sum_product! { u8 u16 u32 u64 u128 usize }
206-
float_sum_product! { f32 f64 }
206+
float_sum_product! { f16 f32 f64 f128 }
207207

208208
#[stable(feature = "iter_arith_traits_result", since = "1.16.0")]
209209
impl<T, U, E> Sum<Result<U, E>> for Result<T, E>

core/src/lib.rs

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -252,47 +252,16 @@ pub use crate::macros::cfg_select;
252252
#[macro_use]
253253
mod internal_macros;
254254

255-
#[path = "num/shells/int_macros.rs"]
256-
#[macro_use]
257-
mod int_macros;
258-
259-
#[rustc_diagnostic_item = "i128_legacy_mod"]
260-
#[path = "num/shells/i128.rs"]
261-
pub mod i128;
262-
#[rustc_diagnostic_item = "i16_legacy_mod"]
263-
#[path = "num/shells/i16.rs"]
264-
pub mod i16;
265-
#[rustc_diagnostic_item = "i32_legacy_mod"]
266-
#[path = "num/shells/i32.rs"]
267-
pub mod i32;
268-
#[rustc_diagnostic_item = "i64_legacy_mod"]
269-
#[path = "num/shells/i64.rs"]
270-
pub mod i64;
271-
#[rustc_diagnostic_item = "i8_legacy_mod"]
272-
#[path = "num/shells/i8.rs"]
273-
pub mod i8;
274-
#[rustc_diagnostic_item = "isize_legacy_mod"]
275-
#[path = "num/shells/isize.rs"]
276-
pub mod isize;
277-
278-
#[rustc_diagnostic_item = "u128_legacy_mod"]
279-
#[path = "num/shells/u128.rs"]
280-
pub mod u128;
281-
#[rustc_diagnostic_item = "u16_legacy_mod"]
282-
#[path = "num/shells/u16.rs"]
283-
pub mod u16;
284-
#[rustc_diagnostic_item = "u32_legacy_mod"]
285-
#[path = "num/shells/u32.rs"]
286-
pub mod u32;
287-
#[rustc_diagnostic_item = "u64_legacy_mod"]
288-
#[path = "num/shells/u64.rs"]
289-
pub mod u64;
290-
#[rustc_diagnostic_item = "u8_legacy_mod"]
291-
#[path = "num/shells/u8.rs"]
292-
pub mod u8;
293-
#[rustc_diagnostic_item = "usize_legacy_mod"]
294-
#[path = "num/shells/usize.rs"]
295-
pub mod usize;
255+
#[path = "num/shells/legacy_int_modules.rs"]
256+
mod legacy_int_modules;
257+
#[stable(feature = "rust1", since = "1.0.0")]
258+
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
259+
#[allow(deprecated_in_future)]
260+
pub use legacy_int_modules::{i8, i16, i32, i64, isize, u8, u16, u32, u64, usize};
261+
#[stable(feature = "i128", since = "1.26.0")]
262+
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
263+
#[allow(deprecated_in_future)]
264+
pub use legacy_int_modules::{i128, u128};
296265

297266
#[path = "num/f128.rs"]
298267
pub mod f128;

core/src/macros/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ pub(crate) mod builtin {
10171017
)]
10181018
#[allow_internal_unstable(fmt_internals)]
10191019
#[rustc_builtin_macro]
1020+
#[doc(hidden)]
10201021
#[macro_export]
10211022
macro_rules! format_args_nl {
10221023
($fmt:expr) => {{ /* compiler built-in */ }};

core/src/num/shells/i128.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

core/src/num/shells/i16.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

core/src/num/shells/i32.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)