Skip to content

Commit 087343d

Browse files
Bump toolchain to 1.86 (#6412)
1 parent f028b9a commit 087343d

File tree

19 files changed

+48
-51
lines changed

19 files changed

+48
-51
lines changed

components/collator/src/elements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ where
19681968

19691969
// Set the exponent. 4 pairs->132, 5 pairs->133, ..., 127 pairs->255.
19701970
let mut len = head.len();
1971-
let num_pairs = (len as u32 + 1) / 2; // as u32 OK, because capped to 254
1971+
let num_pairs = (len as u32).div_ceil(2); // as u32 OK, because capped to 254
19721972
let mut primary =
19731973
numeric_primary | ((132 - 4 + num_pairs) << 16);
19741974
// Find the length without trailing 00 pairs.

components/datetime/src/provider/skeleton/helpers.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ fn naively_apply_time_zone_name(
129129
/// * `length_patterns` - Contains information on how to combine date and time patterns.
130130
/// * `fields` - The desired fields to match against.
131131
/// * `prefer_matched_pattern` - This algorithm does some extra steps of trying to respect
132-
/// the desired fields, even if the provider data doesn't completely match. This
133-
/// configuration option makes it so that the final pattern won't have additional work
134-
/// done to mutate it to match the fields. It will prefer the actual matched pattern.
132+
/// the desired fields, even if the provider data doesn't completely match. This
133+
/// configuration option makes it so that the final pattern won't have additional work
134+
/// done to mutate it to match the fields. It will prefer the actual matched pattern.
135135
pub fn create_best_pattern_for_fields<'data>(
136136
skeletons: &DateSkeletonPatterns<'data>,
137137
length_patterns: &GenericLengthPatterns<'data>,
@@ -375,9 +375,9 @@ fn apply_subseconds(pattern: &mut runtime::Pattern, subseconds: Option<Subsecond
375375
/// * Compute a score based on the best possible match for the given fields.
376376
/// * Select the skeleton with highest score.
377377
/// * Modify the resulting pattern to have fields of the same length. For example requesting
378-
/// a skeleton "yMMMMd" can have a best match of ["yMMMd", "d MMM y"]. This pattern should
379-
/// then be modified to use the requested length to produce a pattern "d MMMM y".
380-
/// However, fields should not be changed from numeric to text.
378+
/// a skeleton "yMMMMd" can have a best match of ["yMMMd", "d MMM y"]. This pattern should
379+
/// then be modified to use the requested length to produce a pattern "d MMMM y".
380+
/// However, fields should not be changed from numeric to text.
381381
///
382382
/// The following is not implemented:
383383
///

components/experimental/src/duration/provider.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ icu_provider::data_marker!(
2020
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
2121
#[cfg_attr(feature = "datagen", databake(path = icu_experimental::duration::provider))]
2222
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
23-
2423
/// A struct containing digital duration data (durationUnit-type-* patterns).
2524
pub struct DigitalDurationData<'data> {
2625
/// The separator between the hour, minute, and second fields.

components/experimental/src/personnames/specifications/pattern_regex_selector.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ impl PersonNamePattern<'_> {
5454
}
5555
});
5656
let missing_fields = self.name_fields.iter().fold(0, |count, (name_field, _)| {
57-
if available_name_fields
58-
.iter()
59-
.any(|&field| field == name_field)
60-
{
57+
if available_name_fields.contains(&name_field) {
6158
count
6259
} else {
6360
count + 1

components/experimental/src/transliterate/transliterator/hardcoded.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl HexTransliterator {
5151

5252
let c_u32 = c as u32;
5353
// rounding-up division by 4
54-
let length = (u32::BITS - c_u32.leading_zeros() + 3) / 4;
54+
let length = (u32::BITS - c_u32.leading_zeros()).div_ceil(4);
5555
let padding = self.min_length.saturating_sub(length as u8);
5656
dest.apply_size_hint(
5757
self.prefix.len() + padding as usize + length as usize + self.suffix.len(),

components/experimental/src/transliterate/transliterator/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ impl Transliterator {
515515

516516
impl RuleBasedTransliterator<'_> {
517517
/// Transliteration using rules works as follows:
518-
/// 1. Split the input modifiable range of the Replaceable according into runs according to self.filter
519-
/// 2. Transliterate each run in sequence
520-
/// i. Transliterate the first id_group, then the first rule_group, then the second id_group, etc.
518+
/// 1. Split the input modifiable range of the Replaceable according into runs according to self.filter
519+
/// 2. Transliterate each run in sequence
520+
/// 1. Transliterate the first id_group, then the first rule_group, then the second id_group, etc.
521521
fn transliterate(&self, mut rep: Replaceable, env: &Env) {
522522
// assumes the cursor is at the right position.
523523

components/icu/README.md

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/icu/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@
9999
//! functionality are compiled. These features are:
100100
//!
101101
//! - `compiled_data` (default): Whether to include compiled data. Without this flag, only constructors with
102-
//! explicit `provider` arguments are available.
102+
//! explicit `provider` arguments are available.
103103
//! - `datagen`: Whether to implement functionality that is only required during data generation.
104104
//! - `logging`: Enables logging through the `log` crate.
105105
//! - `serde`: Activates `serde` implementations for core library types, such as [`Locale`], as well
106-
//! as `*_with_buffer_provider` constructors for runtime data management.
106+
//! as `*_with_buffer_provider` constructors for runtime data management.
107107
//! - `sync`: makes most ICU4X objects implement `Send + Sync`. Has a small performance impact when used with runtime data.
108108
//!
109109
//! # Experimental modules

components/locale_core/src/subtags/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! * [`Script`] is an optional field representing the written script used by the locale.
1111
//! * [`Region`] is the region used by the locale.
1212
//! * [`Variants`] is a list of optional [`Variant`] subtags containing information about the
13-
//! variant adjustments used by the locale.
13+
//! variant adjustments used by the locale.
1414
//!
1515
//! Subtags can be used in isolation, and all basic operations such as parsing, syntax normalization
1616
//! and serialization are supported on each individual subtag, but most commonly

components/normalizer/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2753,7 +2753,7 @@ impl write16::Write16 for IsNormalizedSinkUtf16<'_> {
27532753
// an indexing failure would be a code bug rather than
27542754
// an input or data issue.
27552755
#[allow(clippy::indexing_slicing)]
2756-
if s.as_ptr() == self.expect.as_ptr() {
2756+
if core::ptr::eq(s.as_ptr(), self.expect.as_ptr()) {
27572757
self.expect = &self.expect[s.len()..];
27582758
Ok(())
27592759
} else {
@@ -2795,7 +2795,7 @@ impl core::fmt::Write for IsNormalizedSinkUtf8<'_> {
27952795
// an indexing failure would be a code bug rather than
27962796
// an input or data issue.
27972797
#[allow(clippy::indexing_slicing)]
2798-
if s.as_ptr() == self.expect.as_ptr() {
2798+
if core::ptr::eq(s.as_ptr(), self.expect.as_ptr()) {
27992799
self.expect = &self.expect[s.len()..];
28002800
Ok(())
28012801
} else {
@@ -2834,7 +2834,7 @@ impl core::fmt::Write for IsNormalizedSinkStr<'_> {
28342834
// an indexing failure would be a code bug rather than
28352835
// an input or data issue.
28362836
#[allow(clippy::indexing_slicing)]
2837-
if s.as_ptr() == self.expect.as_ptr() {
2837+
if core::ptr::eq(s.as_ptr(), self.expect.as_ptr()) {
28382838
self.expect = &self.expect[s.len()..];
28392839
Ok(())
28402840
} else {

components/plurals/src/provider/rules/mod.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,11 @@
133133
//!
134134
//! `ICU4X` provides two sets of rules AST and APIs to manage it:
135135
//! * `reference` is the canonical implementation of the specification intended for
136-
//! tooling and testing to use.
137-
//! This module provides APIs for parsing, editing and serialization
138-
//! of the rules.
139-
//! * `runtime` is a non-public, non-mutable runtime version optimized for
140-
//! performance and low memory overhead. This version provides
141-
//! runtime resolver used by the `PluralRules` itself.
136+
//! tooling and testing to use.
137+
//! This module provides APIs for parsing, editing and serialization of the rules.
138+
//! * `runtime` is a non-public, non-mutable runtime version optimized for
139+
//! performance and low memory overhead. This version provides
140+
//! runtime resolver used by the `PluralRules` itself.
142141
//!
143142
//! [`PluralCategory`]: super::PluralCategory
144143
//! [`PluralCategories`]: super::PluralCategory

components/properties/src/runtime.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,16 @@ impl CodePointSetData {
227227
///
228228
/// - `Script` and `General_Category`: handle these directly using property values parsed via
229229
/// [`PropertyParser<GeneralCategory>`] and [`PropertyParser<Script>`]
230-
/// if necessary.
230+
/// if necessary.
231231
/// - `Script_Extensions`: handle this directly using APIs from [`crate::script::ScriptWithExtensions`]
232232
/// - `General_Category` mask values: Handle this alongside `General_Category` using [`GeneralCategoryGroup`],
233-
/// using property values parsed via [`PropertyParser<GeneralCategory>`] if necessary
233+
/// using property values parsed via [`PropertyParser<GeneralCategory>`] if necessary
234234
/// - `Assigned`, `All`, and `ASCII` pseudoproperties: Handle these using their equivalent sets:
235235
/// - `Any` can be expressed as the range `[\u{0}-\u{10FFFF}]`
236236
/// - `Assigned` can be expressed as the inverse of the set `gc=Cn` (i.e., `\P{gc=Cn}`).
237237
/// - `ASCII` can be expressed as the range `[\u{0}-\u{7F}]`
238238
/// - `General_Category` property values can themselves be treated like properties using a shorthand in ECMA262,
239-
/// simply create the corresponding `GeneralCategory` set.
239+
/// simply create the corresponding `GeneralCategory` set.
240240
///
241241
/// ✨ *Enabled with the `compiled_data` Cargo feature.*
242242
///

components/segmenter/src/rule_segmenter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub trait RuleBreakType<'s>: crate::private::Sealed {
4141
///
4242
/// - `'l` = lifetime of the segmenter object from which this iterator was created
4343
/// - `'data` = lifetime of data borrowed by segmenter object
44-
/// (this largely exists because segmenter data is invariant due to ZeroMap constraints,
45-
/// think of it as a second 'l)
44+
/// (this largely exists because segmenter data is invariant due to ZeroMap constraints,
45+
/// think of it as a second 'l)
4646
/// - `'s` = lifetime of the string being segmented
4747
///
4848
/// The [`Iterator::Item`] is an [`usize`] representing index of a code unit

provider/adapters/src/fork/predicates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub trait ForkByErrorPredicate {
2121
/// - `&self` = Reference to the struct implementing the trait (for data capture)
2222
/// - `marker` = The [`DataMarkerInfo`] associated with the request
2323
/// - `req` = The [`DataRequest`]. This may be `None` if there is no request, such as
24-
/// inside [`IterableDynamicDataProvider`].
24+
/// inside [`IterableDynamicDataProvider`].
2525
/// - `err` = The error that occurred.
2626
///
2727
/// Return value:

provider/source/src/source.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ impl AbstractFs {
287287
.entries_with_seek()
288288
.and_then(|e| {
289289
for e in e {
290-
let e = e?;
290+
let mut e = e?;
291291
if e.path()?.as_os_str() == path {
292-
return e.bytes().collect::<Result<Vec<_>, std::io::Error>>();
292+
let mut vec = vec![];
293+
e.read_to_end(&mut vec)?;
294+
return Ok(vec);
293295
}
294296
}
295297
Err(std::io::ErrorKind::NotFound.into())

rust-toolchain.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
44

55
[toolchain]
6-
# Version updated on 2025-02-20
7-
channel = "1.85"
6+
# Version updated on 2025-04-03
7+
channel = "1.86"

utils/zerovec/README.md

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/zerovec/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
//! # Cargo features
3636
//!
3737
//! This crate has several optional Cargo features:
38-
//! - `serde`: Allows serializing and deserializing `zerovec`'s abstractions via [`serde`](https://docs.rs/serde)
39-
//! - `yoke`: Enables implementations of `Yokeable` from the [`yoke`](https://docs.rs/yoke/) crate, which is also useful
40-
//! in situations involving a lot of zero-copy deserialization.
38+
//! - `serde`: Allows serializing and deserializing `zerovec`'s abstractions via [`serde`](https://docs.rs/serde)
39+
//! - `yoke`: Enables implementations of `Yokeable` from the [`yoke`](https://docs.rs/yoke/) crate, which is also useful
40+
//! in situations involving a lot of zero-copy deserialization.
4141
//! - `derive`: Makes it easier to use custom types in these collections by providing the [`#[make_ule]`](crate::make_ule) and
42-
//! [`#[make_varule]`](crate::make_varule) proc macros, which generate appropriate [`ULE`](crate::ule::ULE) and
43-
//! [`VarULE`](crate::ule::VarULE)-conformant types for a given "normal" type.
42+
//! [`#[make_varule]`](crate::make_varule) proc macros, which generate appropriate [`ULE`](crate::ule::ULE) and
43+
//! [`VarULE`](crate::ule::VarULE)-conformant types for a given "normal" type.
4444
//! - `std`: Enabled `std::Error` implementations for error types. This crate is by default `no_std` with a dependency on `alloc`.
4545
//!
4646
//! [`ZeroVec<'a, T>`]: ZeroVec

utils/zerovec/src/zerovec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ impl<T: AsULE> FromIterator<T> for ZeroVec<'_, T> {
10881088
///
10891089
/// * `$aligned` - The type of an element in its canonical, aligned form, e.g., `char`.
10901090
/// * `$convert` - A const function that converts an `$aligned` into its unaligned equivalent, e.g.,
1091-
/// `const fn from_aligned(a: CanonicalType) -> CanonicalType::ULE`.
1091+
/// const fn from_aligned(a: CanonicalType) -> CanonicalType::ULE`.
10921092
/// * `$x` - The elements that the `ZeroSlice` will hold.
10931093
///
10941094
/// # Examples

0 commit comments

Comments
 (0)