From 99587a05d033073726797f33a5cfe763b0f5c971 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Sun, 16 Feb 2025 12:21:42 +0100 Subject: [PATCH 01/64] fix musl's CVE-2025-26519 (cherry picked from commit a6ee2f4af223ff7636c5d55c735fd5bb51c8578f) --- src/ci/docker/scripts/musl.sh | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh index ece8e6c15c0cb..9878bec6fbe8c 100644 --- a/src/ci/docker/scripts/musl.sh +++ b/src/ci/docker/scripts/musl.sh @@ -30,6 +30,47 @@ MUSL=musl-1.2.3 # may have been downloaded in a previous run if [ ! -d $MUSL ]; then curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf - + + # Apply patches for CVE-2025-26519. At the time of adding these patches no release containing them + # has been published by the musl project, so we just apply them directly on top of the version we + # were distributing already. The patches should be removed once we upgrade to musl >= 1.2.6. + # + # Advisory: https://www.openwall.com/lists/musl/2025/02/13/1 + # + # Patches applied: + # - https://www.openwall.com/lists/musl/2025/02/13/1/1 + # - https://www.openwall.com/lists/musl/2025/02/13/1/2 + # + # ignore-tidy-tab + # ignore-tidy-linelength + patch -p1 -d $MUSL <= 93 || d >= 94) { + c += (0xa1-0x81); + d += 0xa1; +- if (c >= 93 || c>=0xc6-0x81 && d>0x52) ++ if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52) + goto ilseq; + if (d-'A'<26) d = d-'A'; + else if (d-'a'<26) d = d-'a'+26; +EOF + patch -p1 -d $MUSL <4) goto ilseq; + *out += k; + *outb -= k; + break; +EOF fi cd $MUSL From e4840ce59bdddb19394df008c5c26d9c493725f8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 17 Feb 2025 09:35:47 -0800 Subject: [PATCH 02/64] update version placeholders --- compiler/rustc_feature/src/accepted.rs | 4 ++-- compiler/rustc_feature/src/unstable.rs | 22 +++++++++---------- .../src/deref_into_dyn_supertrait.rs | 2 +- library/alloc/src/slice.rs | 2 +- library/alloc/src/vec/mod.rs | 2 +- library/core/src/error.rs | 2 +- library/core/src/hint.rs | 2 +- library/core/src/num/f32.rs | 8 +++---- library/core/src/num/f64.rs | 8 +++---- library/core/src/num/nonzero.rs | 4 ++-- library/core/src/slice/mod.rs | 8 +++---- library/core/src/str/mod.rs | 10 ++++----- library/std/src/collections/hash/map.rs | 4 ++-- library/std/src/io/cursor.rs | 4 ++-- library/std/src/sync/once_lock.rs | 2 +- library/std/src/sync/poison/once.rs | 4 ++-- 16 files changed, 44 insertions(+), 44 deletions(-) diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 2dfb0c8e04093..d50fe8c6a3e6b 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -387,7 +387,7 @@ declare_features! ( /// Allows `#[target_feature(...)]`. (accepted, target_feature, "1.27.0", None), /// Allows the use of `#[target_feature]` on safe functions. - (accepted, target_feature_11, "CURRENT_RUSTC_VERSION", Some(69098)), + (accepted, target_feature_11, "1.86.0", Some(69098)), /// Allows `fn main()` with return types which implements `Termination` (RFC 1937). (accepted, termination_trait, "1.26.0", Some(43301)), /// Allows `#[test]` functions where the return type implements `Termination` (RFC 1937). @@ -401,7 +401,7 @@ declare_features! ( (accepted, track_caller, "1.46.0", Some(47809)), /// Allows dyn upcasting trait objects via supertraits. /// Dyn upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`. - (accepted, trait_upcasting, "CURRENT_RUSTC_VERSION", Some(65991)), + (accepted, trait_upcasting, "1.86.0", Some(65991)), /// Allows #[repr(transparent)] on univariant enums (RFC 2645). (accepted, transparent_enums, "1.42.0", Some(60405)), /// Allows indexing tuples. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index a638a845c07ea..6a317fc75a87f 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -203,7 +203,7 @@ declare_features! ( /// Allows using anonymous lifetimes in argument-position impl-trait. (unstable, anonymous_lifetime_in_impl_trait, "1.63.0", None), /// Allows access to the emscripten_wasm_eh config, used by panic_unwind and unwind - (internal, cfg_emscripten_wasm_eh, "CURRENT_RUSTC_VERSION", None), + (internal, cfg_emscripten_wasm_eh, "1.86.0", None), /// Allows identifying the `compiler_builtins` crate. (internal, compiler_builtins, "1.13.0", None), /// Allows writing custom MIR @@ -360,7 +360,7 @@ declare_features! ( /// Allows `extern "C-cmse-nonsecure-call" fn()`. (unstable, abi_c_cmse_nonsecure_call, "1.51.0", Some(81391)), /// Allows `extern "gpu-kernel" fn()`. - (unstable, abi_gpu_kernel, "CURRENT_RUSTC_VERSION", Some(135467)), + (unstable, abi_gpu_kernel, "1.86.0", Some(135467)), /// Allows `extern "msp430-interrupt" fn()`. (unstable, abi_msp430_interrupt, "1.16.0", Some(38487)), /// Allows `extern "ptx-*" fn()`. @@ -404,7 +404,7 @@ declare_features! ( /// Allows the use of `#[cfg()]`. (unstable, cfg_boolean_literals, "1.83.0", Some(131204)), /// Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled. - (unstable, cfg_contract_checks, "CURRENT_RUSTC_VERSION", Some(128044)), + (unstable, cfg_contract_checks, "1.86.0", Some(128044)), /// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour. (unstable, cfg_overflow_checks, "1.71.0", Some(111466)), /// Provides the relocation model information as cfg entry @@ -448,9 +448,9 @@ declare_features! ( /// Allows the `?` operator in const contexts. (unstable, const_try, "1.56.0", Some(74935)), /// Allows use of contracts attributes. - (incomplete, contracts, "CURRENT_RUSTC_VERSION", Some(128044)), + (incomplete, contracts, "1.86.0", Some(128044)), /// Allows access to internal machinery used to implement contracts. - (internal, contracts_internals, "CURRENT_RUSTC_VERSION", Some(128044)), + (internal, contracts_internals, "1.86.0", Some(128044)), /// Allows coroutines to be cloned. (unstable, coroutine_clone, "1.65.0", Some(95360)), /// Allows defining coroutines. @@ -491,7 +491,7 @@ declare_features! ( /// for functions with varargs. (unstable, extended_varargs_abi_support, "1.65.0", Some(100189)), /// Allows using `system` as a calling convention with varargs. - (unstable, extern_system_varargs, "CURRENT_RUSTC_VERSION", Some(136946)), + (unstable, extern_system_varargs, "1.86.0", Some(136946)), /// Allows defining `extern type`s. (unstable, extern_types, "1.23.0", Some(43467)), /// Allow using 128-bit (quad precision) floating point numbers. @@ -519,7 +519,7 @@ declare_features! ( /// Allows generic parameters and where-clauses on free & associated const items. (incomplete, generic_const_items, "1.73.0", Some(113521)), /// Allows any generic constants being used as pattern type range ends - (incomplete, generic_pattern_types, "CURRENT_RUSTC_VERSION", Some(136574)), + (incomplete, generic_pattern_types, "1.86.0", Some(136574)), /// Allows registering static items globally, possibly across crates, to iterate over at runtime. (unstable, global_registration, "1.80.0", Some(125119)), /// Allows using guards in patterns. @@ -535,7 +535,7 @@ declare_features! ( /// Allows `impl Trait` as output type in `Fn` traits in return position of functions. (unstable, impl_trait_in_fn_trait_return, "1.64.0", Some(99697)), /// Allows `use` associated functions from traits. - (unstable, import_trait_associated_functions, "CURRENT_RUSTC_VERSION", Some(134691)), + (unstable, import_trait_associated_functions, "1.86.0", Some(134691)), /// Allows associated types in inherent impls. (incomplete, inherent_associated_types, "1.52.0", Some(8995)), /// Allow anonymous constants from an inline `const` block in pattern position @@ -543,7 +543,7 @@ declare_features! ( /// Allows using `pointer` and `reference` in intra-doc links (unstable, intra_doc_pointers, "1.51.0", Some(80896)), // Allows using the `kl` and `widekl` target features and the associated intrinsics - (unstable, keylocker_x86, "CURRENT_RUSTC_VERSION", Some(134813)), + (unstable, keylocker_x86, "1.86.0", Some(134813)), // Allows setting the threshold for the `large_assignments` lint. (unstable, large_assignments, "1.52.0", Some(83518)), /// Allow to have type alias types for inter-crate use. @@ -584,7 +584,7 @@ declare_features! ( /// Allows diverging expressions to fall back to `!` rather than `()`. (unstable, never_type_fallback, "1.41.0", Some(65992)), /// Switch `..` syntax to use the new (`Copy + IntoIterator`) range types. - (unstable, new_range, "CURRENT_RUSTC_VERSION", Some(123741)), + (unstable, new_range, "1.86.0", Some(123741)), /// Allows `#![no_core]`. (unstable, no_core, "1.3.0", Some(29639)), /// Allows the use of `no_sanitize` attribute. @@ -636,7 +636,7 @@ declare_features! ( /// Allows string patterns to dereference values to match them. (unstable, string_deref_patterns, "1.67.0", Some(87121)), /// Allows subtrait items to shadow supertrait items. - (unstable, supertrait_item_shadowing, "CURRENT_RUSTC_VERSION", Some(89151)), + (unstable, supertrait_item_shadowing, "1.86.0", Some(89151)), /// Allows using `#[thread_local]` on `static` items. (unstable, thread_local, "1.0.0", Some(29594)), /// Allows defining `trait X = A + B;` alias items. diff --git a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs index f418d6d8753b4..ec8f84415759f 100644 --- a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs +++ b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs @@ -12,7 +12,7 @@ declare_lint! { /// for `dyn SubTrait` with a `dyn SuperTrait` type as the `Output` type. /// /// These implementations are "shadowed" by trait upcasting (stabilized since - /// CURRENT_RUSTC_VERSION). The `deref` functions is no longer called implicitly, which might + /// 1.86.0). The `deref` functions is no longer called implicitly, which might /// change behavior compared to previous rustc versions. /// /// ### Example diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index c83b1962eb691..dcd95ddf00ff5 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -27,7 +27,7 @@ pub use core::slice::ArrayChunksMut; pub use core::slice::ArrayWindows; #[stable(feature = "inherent_ascii_escape", since = "1.60.0")] pub use core::slice::EscapeAscii; -#[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "get_many_mut", since = "1.86.0")] pub use core::slice::GetDisjointMutError; #[stable(feature = "slice_get_slice", since = "1.28.0")] pub use core::slice::SliceIndex; diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 7d02a15ed7a51..a84bb724473a1 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2526,7 +2526,7 @@ impl Vec { /// assert_eq!(vec, [1, 2, 3]); /// assert_eq!(vec.pop_if(pred), None); /// ``` - #[stable(feature = "vec_pop_if", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "vec_pop_if", since = "1.86.0")] pub fn pop_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option { let last = self.last_mut()?; if predicate(last) { self.pop() } else { None } diff --git a/library/core/src/error.rs b/library/core/src/error.rs index 33cf2af30b954..62fce527b2fe2 100644 --- a/library/core/src/error.rs +++ b/library/core/src/error.rs @@ -1075,5 +1075,5 @@ impl Error for crate::time::TryFromFloatSecsError {} #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")] impl Error for crate::ffi::FromBytesUntilNulError {} -#[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "get_many_mut", since = "1.86.0")] impl Error for crate::slice::GetDisjointMutError {} diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 520b9941ae45d..32b25808542cf 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -472,7 +472,7 @@ pub fn spin_loop() { /// During constant evaluation, `black_box` is treated as a no-op. #[inline] #[stable(feature = "bench_black_box", since = "1.66.0")] -#[rustc_const_stable(feature = "const_black_box", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_stable(feature = "const_black_box", since = "1.86.0")] pub const fn black_box(dummy: T) -> T { crate::intrinsics::black_box(dummy) } diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 4d42997369ffb..a200fd5318669 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -741,8 +741,8 @@ impl f32 { /// [`MAX`]: Self::MAX #[inline] #[doc(alias = "nextUp")] - #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "float_next_up_down", since = "1.86.0")] + #[rustc_const_stable(feature = "float_next_up_down", since = "1.86.0")] pub const fn next_up(self) -> Self { // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // denormals to zero. This is in general unsound and unsupported, but here @@ -792,8 +792,8 @@ impl f32 { /// [`MAX`]: Self::MAX #[inline] #[doc(alias = "nextDown")] - #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "float_next_up_down", since = "1.86.0")] + #[rustc_const_stable(feature = "float_next_up_down", since = "1.86.0")] pub const fn next_down(self) -> Self { // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // denormals to zero. This is in general unsound and unsupported, but here diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index 907971d303ffc..de63a462b61ac 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -758,8 +758,8 @@ impl f64 { /// [`MAX`]: Self::MAX #[inline] #[doc(alias = "nextUp")] - #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "float_next_up_down", since = "1.86.0")] + #[rustc_const_stable(feature = "float_next_up_down", since = "1.86.0")] pub const fn next_up(self) -> Self { // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // denormals to zero. This is in general unsound and unsupported, but here @@ -809,8 +809,8 @@ impl f64 { /// [`MAX`]: Self::MAX #[inline] #[doc(alias = "nextDown")] - #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "float_next_up_down", since = "1.86.0")] + #[rustc_const_stable(feature = "float_next_up_down", since = "1.86.0")] pub const fn next_down(self) -> Self { // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // denormals to zero. This is in general unsound and unsupported, but here diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 21bad6705ab80..332f77bf53e70 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -625,8 +625,8 @@ macro_rules! nonzero_integer { /// # } /// ``` /// - #[stable(feature = "non_zero_count_ones", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "non_zero_count_ones", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "non_zero_count_ones", since = "1.86.0")] + #[rustc_const_stable(feature = "non_zero_count_ones", since = "1.86.0")] #[doc(alias = "popcount")] #[doc(alias = "popcnt")] #[must_use = "this returns the result of the operation, \ diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index ed45e26256e55..cc290f75f92d4 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -4569,7 +4569,7 @@ impl [T] { /// /// [`get_disjoint_mut`]: slice::get_disjoint_mut /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html - #[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "get_many_mut", since = "1.86.0")] #[inline] pub unsafe fn get_disjoint_unchecked_mut( &mut self, @@ -4636,7 +4636,7 @@ impl [T] { /// } /// assert_eq!(v, &[1, 11, 111]); /// ``` - #[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "get_many_mut", since = "1.86.0")] #[inline] pub fn get_disjoint_mut( &mut self, @@ -5025,7 +5025,7 @@ fn get_disjoint_check_valid( /// assert_eq!(v.get_disjoint_mut([0, 999]), Err(GetDisjointMutError::IndexOutOfBounds)); /// assert_eq!(v.get_disjoint_mut([1, 1]), Err(GetDisjointMutError::OverlappingIndices)); /// ``` -#[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "get_many_mut", since = "1.86.0")] #[derive(Debug, Clone, PartialEq, Eq)] pub enum GetDisjointMutError { /// An index provided was out-of-bounds for the slice. @@ -5034,7 +5034,7 @@ pub enum GetDisjointMutError { OverlappingIndices, } -#[stable(feature = "get_many_mut", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "get_many_mut", since = "1.86.0")] impl fmt::Display for GetDisjointMutError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let msg = match self { diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 05c16791ce7ed..9800888efc37b 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -361,7 +361,7 @@ impl str { /// ``` #[must_use] #[stable(feature = "is_char_boundary", since = "1.9.0")] - #[rustc_const_stable(feature = "const_is_char_boundary", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_is_char_boundary", since = "1.86.0")] #[inline] pub const fn is_char_boundary(&self, index: usize) -> bool { // 0 is always ok. @@ -818,7 +818,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "str_split_at", since = "1.4.0")] - #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_str_split_at", since = "1.86.0")] pub const fn split_at(&self, mid: usize) -> (&str, &str) { match self.split_at_checked(mid) { None => slice_error_fail(self, 0, mid), @@ -859,7 +859,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "str_split_at", since = "1.4.0")] - #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_str_split_at", since = "1.86.0")] pub const fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) { @@ -899,7 +899,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "split_at_checked", since = "1.80.0")] - #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_str_split_at", since = "1.86.0")] pub const fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)> { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) { @@ -940,7 +940,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "split_at_checked", since = "1.80.0")] - #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_str_split_at", since = "1.86.0")] pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)> { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) { diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 6a0ff3a29e08f..93d254e34f5eb 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1024,7 +1024,7 @@ where /// ``` #[inline] #[doc(alias = "get_many_mut")] - #[stable(feature = "map_many_mut", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "map_many_mut", since = "1.86.0")] pub fn get_disjoint_mut( &mut self, ks: [&Q; N], @@ -1091,7 +1091,7 @@ where /// ``` #[inline] #[doc(alias = "get_many_unchecked_mut")] - #[stable(feature = "map_many_mut", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "map_many_mut", since = "1.86.0")] pub unsafe fn get_disjoint_unchecked_mut( &mut self, ks: [&Q; N], diff --git a/library/std/src/io/cursor.rs b/library/std/src/io/cursor.rs index 606099c8bc67a..08832bbc1e3d1 100644 --- a/library/std/src/io/cursor.rs +++ b/library/std/src/io/cursor.rs @@ -153,7 +153,7 @@ impl Cursor { /// let reference = buff.get_mut(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_mut_cursor", since = "1.86.0")] pub const fn get_mut(&mut self) -> &mut T { &mut self.inner } @@ -201,7 +201,7 @@ impl Cursor { /// assert_eq!(buff.position(), 4); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_mut_cursor", since = "1.86.0")] pub const fn set_position(&mut self, pos: u64) { self.pos = pos; } diff --git a/library/std/src/sync/once_lock.rs b/library/std/src/sync/once_lock.rs index 21e6b65a744f8..ffb90b1469584 100644 --- a/library/std/src/sync/once_lock.rs +++ b/library/std/src/sync/once_lock.rs @@ -191,7 +191,7 @@ impl OnceLock { /// }) /// ``` #[inline] - #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_wait", since = "1.86.0")] pub fn wait(&self) -> &T { self.once.wait_force(); diff --git a/library/std/src/sync/poison/once.rs b/library/std/src/sync/poison/once.rs index d2938b7a0c12e..103e519540795 100644 --- a/library/std/src/sync/poison/once.rs +++ b/library/std/src/sync/poison/once.rs @@ -284,7 +284,7 @@ impl Once { /// If this [`Once`] has been poisoned because an initialization closure has /// panicked, this method will also panic. Use [`wait_force`](Self::wait_force) /// if this behavior is not desired. - #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_wait", since = "1.86.0")] pub fn wait(&self) { if !self.inner.is_completed() { self.inner.wait(false); @@ -293,7 +293,7 @@ impl Once { /// Blocks the current thread until initialization has completed, ignoring /// poisoning. - #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_wait", since = "1.86.0")] pub fn wait_force(&self) { if !self.inner.is_completed() { self.inner.wait(true); From 2171400b45074e66e270f373c2be5229f7a3fa74 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 17 Feb 2025 09:36:15 -0800 Subject: [PATCH 03/64] bump channel to beta --- src/ci/channel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/channel b/src/ci/channel index bf867e0ae5b6c..65b2df87f7df3 100644 --- a/src/ci/channel +++ b/src/ci/channel @@ -1 +1 @@ -nightly +beta From c62a549cfe2cc53b3471afe4749bee0c5c4c8764 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 21 Feb 2025 09:05:07 -0800 Subject: [PATCH 04/64] bump stage0 to 1.85.0 --- src/stage0 | 824 +++++++++++++++++++++++------------------------------ 1 file changed, 359 insertions(+), 465 deletions(-) diff --git a/src/stage0 b/src/stage0 index 5c3e3a7cebcc7..2589a4debd455 100644 --- a/src/stage0 +++ b/src/stage0 @@ -13,469 +13,363 @@ nightly_branch=master # # All changes below this comment will be overridden the next time the # tool is executed. - -compiler_date=2025-02-08 -compiler_version=beta -rustfmt_date=2025-02-08 -rustfmt_version=nightly -dist/2025-02-08/rustc-beta-aarch64-apple-darwin.tar.gz=ca5440402ebfd3ba7ce3b30ecbcdc3e9341861996a5dd51601de3131d62d0bc2 -dist/2025-02-08/rustc-beta-aarch64-apple-darwin.tar.xz=bb7c79e5adb6998ac3a57ae7434a247029777bf3e1687c51ff3fdca938b72b3d -dist/2025-02-08/rustc-beta-aarch64-pc-windows-msvc.tar.gz=596a586332d87beaf3d52fead6e6c286a1da6abc89b53da5f6874f5da134cded -dist/2025-02-08/rustc-beta-aarch64-pc-windows-msvc.tar.xz=6828f88d3d576cdea838d975e0dc61ae2daf32746d7dbefce07f12684f5c0d97 -dist/2025-02-08/rustc-beta-aarch64-unknown-linux-gnu.tar.gz=86943f595d3ad4b4ee5b7c9db63df9addf9c5e50e25267f64daa504dc4bb63b6 -dist/2025-02-08/rustc-beta-aarch64-unknown-linux-gnu.tar.xz=13449944b13c4a8ef9aae649e1edf0bfbedc9816f7f32445ce9623098a21e51d -dist/2025-02-08/rustc-beta-aarch64-unknown-linux-musl.tar.gz=ce7fc3bed538a938f11b1cc15da20dc7d68097cf7d68a37ecc969c225bf5dcaf -dist/2025-02-08/rustc-beta-aarch64-unknown-linux-musl.tar.xz=a3b77720f7ff2a4707ecf44cab11ef088c3903ed6e123de14237b2149858f1a0 -dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabi.tar.gz=a9f02a5eb65c85f98b73dfd88ef4eb48e6782455b3ccb77032b2df5bbfa39e84 -dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabi.tar.xz=93c5ad3bcb8473a7ec0dcc81b788436c9881c9d9c276906dc09bada56b45180c -dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz=90f46141b9590ad69f60ffabdceb262e0940081994bda97a74692b76fd5cf8c0 -dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz=364a0b19dd91fe47c7152bd5a495d5ebf10170e4e5896859b02aef81225fc72e -dist/2025-02-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz=977901c4eaf17b2acc8f7b7dd4e2efe5c45b45f5763f94b2ca36beadcc1544fc -dist/2025-02-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz=4f60ec3e8a48c97a98567338be479499dbfb48db328d3d208763a8e6ad36e80d -dist/2025-02-08/rustc-beta-i686-pc-windows-gnu.tar.gz=ab1f6cf30ac8abf6dd130144355b79510633b24b06b416d82ba1fbccd318c2e5 -dist/2025-02-08/rustc-beta-i686-pc-windows-gnu.tar.xz=68327052940d99080217450553c42f3df81507385b5b90734c9b41a57e601ec6 -dist/2025-02-08/rustc-beta-i686-pc-windows-msvc.tar.gz=479053067ce64241d06a09d88b23cfb3da6dbcff46b5e8e33c2c1797ecdefb19 -dist/2025-02-08/rustc-beta-i686-pc-windows-msvc.tar.xz=12a4286b430fdd49e8806aa98a4395fc2ded6eae5ca254fb2cddc2c6db2cd893 -dist/2025-02-08/rustc-beta-i686-unknown-linux-gnu.tar.gz=865d88d2a9bb177851e901a56c5b3a295aa4ecdec8f73c72d4f9914b2e4aac60 -dist/2025-02-08/rustc-beta-i686-unknown-linux-gnu.tar.xz=3f17f91cd666e59efd5a47c2db28af8eee0d89d4ebbc6263f005e1d8d7d5b839 -dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz=a1c42bc975d9ccd10771aa83874d0ea382780a8a925016d966d50084fb45c267 -dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz=5452b62e9cccb5dac1cd36b01d31b11ac97c85bf4f82a559a15a08c278061d78 -dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-musl.tar.gz=eb9d9ac867835710ef4dd301aed0afbfeb4221c818ef4d7f70f4bb2b5bc02790 -dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-musl.tar.xz=0afbff667ada4671511c48d6c5558009f395f3c2f3ad3d10c716882f6c9860f6 -dist/2025-02-08/rustc-beta-powerpc-unknown-linux-gnu.tar.gz=db77ef515643b4ced71ab9ffce80338fe99b03abd6b7672f627f38e33e6642d9 -dist/2025-02-08/rustc-beta-powerpc-unknown-linux-gnu.tar.xz=cac3b683fb606be111d5788b1a4194ec0ea77e0226350454cb7d1904d6f2f78e -dist/2025-02-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz=a86bb2a0cd6f2c25f6f6c55b070a3f841c0a006588f759d0aa7c8d6b3401d904 -dist/2025-02-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz=050e07098291a659baa3fb31e2a83c7e6e203614139dab3f3eb2c486c20b9f8b -dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz=c20d1b649bb28b8abba4a5dd8e881a03061ebe091e5cdbc44310706fc76b55b0 -dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz=24c742968242e5bb3d81b865c0fdfdb021772a40fe4d25f3b83fdcf8ccb087bd -dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.gz=2aa9e78148c44ae2c01f554449811993e592aa9c428de37fbdb42dead53eb60c -dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.xz=2e6751dacf4ce4a60c61e1fa8afb746ac38285c62e567df78f2de27ce25e5770 -dist/2025-02-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz=d0d365fdba806bda1263767d40365da7b5c2e5d01cfe6e9e4c5a2fd66ad4608a -dist/2025-02-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz=fef429294c81caa19fc0dac00eda00d55c087e94c7235e032b17c2b4f5556850 -dist/2025-02-08/rustc-beta-s390x-unknown-linux-gnu.tar.gz=75ea2ad9e2377d09c9517a932126f876eaf377ff0f38a382187bb4a8c31be34e -dist/2025-02-08/rustc-beta-s390x-unknown-linux-gnu.tar.xz=908e6fff603ef6d0721efc24e8faf014f5cafa71fc0220da4dac5c870b974c04 -dist/2025-02-08/rustc-beta-x86_64-apple-darwin.tar.gz=ccea051b3787d3682258edcfa6a35f2d7a44ac5c3d8117fcd55cc0a97e7b9b92 -dist/2025-02-08/rustc-beta-x86_64-apple-darwin.tar.xz=3555ff1e179da6a249861086c8986039ab7dcdcf581beb1f27246f987da436f6 -dist/2025-02-08/rustc-beta-x86_64-pc-windows-gnu.tar.gz=227da932cd028d2c2415f4df4c14daf225e2a917a0879e1debcee2b8ebbfc790 -dist/2025-02-08/rustc-beta-x86_64-pc-windows-gnu.tar.xz=231c0fb2989746424f8ad394e9015ef13a6b991a50f62009e7bca3e010e9320e -dist/2025-02-08/rustc-beta-x86_64-pc-windows-msvc.tar.gz=b75be89ce511758f7b9ab6b5701155349e5675e4b85975c33a91483d78666927 -dist/2025-02-08/rustc-beta-x86_64-pc-windows-msvc.tar.xz=bf529ca4409fefe3d38e2b0ee6b3102e9f8b7ace4352bea7e6d3148a84e98767 -dist/2025-02-08/rustc-beta-x86_64-unknown-freebsd.tar.gz=e2dcaf33887031f8d169ab734f3b3eb6858e5247097e46293c11ba1a2887a919 -dist/2025-02-08/rustc-beta-x86_64-unknown-freebsd.tar.xz=2cf5c49c04e57bcc34ada76ff22dd149c4d643b5af5766267663f2e0e4031d17 -dist/2025-02-08/rustc-beta-x86_64-unknown-illumos.tar.gz=c7572379985941a513b7b9e750043a74097655600cb34cb0460a34a5587b7e0d -dist/2025-02-08/rustc-beta-x86_64-unknown-illumos.tar.xz=4e98bbcbae02618c3f95a21fdb22b4e067ce0bacd8370076a1bf8107964d2896 -dist/2025-02-08/rustc-beta-x86_64-unknown-linux-gnu.tar.gz=bcc22d77b53b54bcb95a5b92b19af7cf5d3e4b4418c3c9ed1d5ab9db3cd6c3a0 -dist/2025-02-08/rustc-beta-x86_64-unknown-linux-gnu.tar.xz=8f3eb1b74e06bbdbf1d09e5df205677db6f6ff78e94f80fc1fd1441deed86f80 -dist/2025-02-08/rustc-beta-x86_64-unknown-linux-musl.tar.gz=ccd5ba2c7c7d8c8eeaae2f7c7b462945d7c7ac552d6175dd33c0b77ee3d6730b -dist/2025-02-08/rustc-beta-x86_64-unknown-linux-musl.tar.xz=ab198284a035b8b5ef584a925b5f7ef08228d1eeb43b17a33dab8c7ae93cbc96 -dist/2025-02-08/rustc-beta-x86_64-unknown-netbsd.tar.gz=5b52a1e3f591e6f65ac50d885cfa38e2bb655abc3db7f09ea860450b4b95d6e0 -dist/2025-02-08/rustc-beta-x86_64-unknown-netbsd.tar.xz=fad94b63a75e789df1e5d25e0bf44d1fc29146dea862006d5b1ffb5c20fdfc8d -dist/2025-02-08/rust-std-beta-aarch64-apple-darwin.tar.gz=19c355276bb12522f3c8e94e843e6e54434c66c4e2e49bf68e084d43e1c83350 -dist/2025-02-08/rust-std-beta-aarch64-apple-darwin.tar.xz=c05a1e3e86e2846c4322df02f9b02a1bf16edbf39d3394da56e1a8b3b36d9a60 -dist/2025-02-08/rust-std-beta-aarch64-apple-ios.tar.gz=ade5b194bd6b7737f505d201f6560ec3aeb41345ea692b2d262317fe0a3bfc38 -dist/2025-02-08/rust-std-beta-aarch64-apple-ios.tar.xz=026a233fab1b27e70dd1455a9a9a0f097d0617b720f82549a413bc4b2d9a2755 -dist/2025-02-08/rust-std-beta-aarch64-apple-ios-macabi.tar.gz=fe743c3895565a7e641b8727a0e96172e0a735bb77f9ced18e201f54d5bab19e -dist/2025-02-08/rust-std-beta-aarch64-apple-ios-macabi.tar.xz=66fd5b769ae7f0e4dd587fdf81ac31cb780cd20eadd082ef0252d7346354bfdb -dist/2025-02-08/rust-std-beta-aarch64-apple-ios-sim.tar.gz=ccc55643bde9f89be185b560e44d379ef85a0cc7f087f2f2bf7738d523b7a32d -dist/2025-02-08/rust-std-beta-aarch64-apple-ios-sim.tar.xz=b1d4c3de214fa207e987742ab73d316537ad9856eb3499d046f6aea4e9d3bc0c -dist/2025-02-08/rust-std-beta-aarch64-linux-android.tar.gz=b17466c9da602c1c282826bdd878e6ba4592906f74b0e8bbe3df302c2358ede4 -dist/2025-02-08/rust-std-beta-aarch64-linux-android.tar.xz=4addf9a4ed3ae4c80b097027fef7237261d2e9ada641e549cc91595c83614d6e -dist/2025-02-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.gz=391f0b460feb164d29ed222b322380586743b19ab03c217690e8053e22903d3e -dist/2025-02-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.xz=d81567dc4e204f7080854d0a3a7e7e16424758ff122dfc14448fa9da630932aa -dist/2025-02-08/rust-std-beta-aarch64-pc-windows-msvc.tar.gz=91ff95f6a56ee5db99e72b293ea2048be0fd5ac3788bd32d9fc97337e7ee8b68 -dist/2025-02-08/rust-std-beta-aarch64-pc-windows-msvc.tar.xz=d6eb64cdaa12fcc469687f99d03a30329847e89bf802361bb6acd61f65b0547e -dist/2025-02-08/rust-std-beta-aarch64-unknown-fuchsia.tar.gz=c9f43315d352ecddbc18a9034723c58d5d8ec77fffa9e0e82322743d162e3db7 -dist/2025-02-08/rust-std-beta-aarch64-unknown-fuchsia.tar.xz=2356a2902f91323d1492ef12fa2f17d1e4934748cec03d6621d6ecfe272f1c3e -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz=ccc8c1777dc8d2e04d4d0640ece7b7820a8fea60a0fe371efcaa055972dcd7b3 -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz=4208ef48af14c5feee97c16fe7e894777a479492760dc0eb838febf2eb92ece7 -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-musl.tar.gz=b67e319c5e447e9ebf4b9a7e51800e7d7aec3564f0829fa23df953d8ee714131 -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-musl.tar.xz=432ea33a49f0010125c960d7b93b585e7b4c91b34f9d07989cf1664bf7e71fe5 -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.gz=53bbbc52c4f99733c7b4a1038fa014867c0d6ca8f1d7eccba651fab4f794247e -dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.xz=6df101f4d5416cba695be66b975a4e4dcab2a3041d079f0a454f342a6d24d7db -dist/2025-02-08/rust-std-beta-aarch64-unknown-none.tar.gz=f1ef3141ac9c634e7e6686cf3c13b83323eb168a249f596b1490f874372c1423 -dist/2025-02-08/rust-std-beta-aarch64-unknown-none.tar.xz=a709c52f479c73ed15709b3cb0b8e7641606cf86375a4c9a60b1c9d381c70183 -dist/2025-02-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz=31b8fec1cd20dd1809bdf733209288d60de0f096fbd0cc2955982ce119703772 -dist/2025-02-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz=afb3872ffa8ab3c79d08f713aeb76c658ea00a3b9d79d5516d89aa78ec1eab8e -dist/2025-02-08/rust-std-beta-aarch64-unknown-uefi.tar.gz=d73b90fa9d3a330274b2004ec535d396f90a82ac5b10fb8688f82472bd2c5ac1 -dist/2025-02-08/rust-std-beta-aarch64-unknown-uefi.tar.xz=ae05fa6bf0638b0e26fcb8bcac5973835aa965a56507588fa3d43981f20eee89 -dist/2025-02-08/rust-std-beta-arm-linux-androideabi.tar.gz=c18354734b678f0665dd60bb8765df00bca5d3fb7bb6e6a4b83e3cde971c26cf -dist/2025-02-08/rust-std-beta-arm-linux-androideabi.tar.xz=5f6bc44bbe3b24140fecad715cc5528249906bacf98fc3a0618a9c0cc92913e0 -dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz=d9a2ab83df4240431479fe27600ab1098333699e14103b8a627dc09a3dad6976 -dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz=4f95a441ff45c16fb8aa37432cffeef60f2e0711c9cb1015cf440f4da51d5425 -dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz=dacdeceea6625041f75c3f2fad4382d2c957b9511666987695fed8e3a2216c88 -dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz=e338c1d2cef57e4c4ef613e6b080371751b874f94a246ab32e872a008e9166ab -dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabi.tar.gz=8bd4174934e5d0e4dd8e757db494a238c95024be5336e6062923b479c0275b6a -dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabi.tar.xz=1637b8d23bc8052803d785f15031a75594860f2263808c9dee68dead29bcd37e -dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz=db6eb6a2af3395e1eee0060d0c022c74c0741c765009f081c0646d696bd0b873 -dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz=ca21a4af4de66abf9d31ae6b3fbc33df152656feef7a269bf7d039d2766176ee -dist/2025-02-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.gz=118c52dfa7142c0ee281b126da5b043b2357b78e7e110000f490b20e6a1e7eed -dist/2025-02-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.xz=558fbb7453a2e633630ed33ad150dce87fa515b5b443ae66c5f85ee27e0e771f -dist/2025-02-08/rust-std-beta-armebv7r-none-eabi.tar.gz=96ff6441b0577b25b83540dc803d692d3444bcd0b4f6128a7743970726facce9 -dist/2025-02-08/rust-std-beta-armebv7r-none-eabi.tar.xz=2621a9f82f73a3a2a2a0c6a7446549c5ad29a430a3e0b961909fe68da21b8491 -dist/2025-02-08/rust-std-beta-armebv7r-none-eabihf.tar.gz=0ef78d66dea96d1a6565fb3469bdcb3368f9e61a55a59a5d2508c54c091484e9 -dist/2025-02-08/rust-std-beta-armebv7r-none-eabihf.tar.xz=1c586301ae2a20ed1caaf0d62d985f9fd95bf2b937ebe7b6d738ca5812713722 -dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz=aaeb690b0a08e8f6546ac5608fade5852bb029db9189d6d036c69c4895c6ce32 -dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz=1d6ae672d5ebcd302a654c4347a386fabc3bf53aec9664cdf76b9c5a061d4eb1 -dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz=5557c7444e72eb29c904436f0221cb40c3156c5289c39b7e8c1a057dfd56c394 -dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz=ae9abe3580b1751854305200bd6a5dbf98aeef396e163534ac5521d04d7bfa7c -dist/2025-02-08/rust-std-beta-armv7-linux-androideabi.tar.gz=c466403dfb8e15cd674859fad24e2e0dd1ba100946c662a9bf29f2440f02a938 -dist/2025-02-08/rust-std-beta-armv7-linux-androideabi.tar.xz=83ad7b8237ae7ab0ddd6f43b604b27677ec9e83453f3127c356936af12140ee2 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz=12489ebd742dd611937c2942c6f897608d1c4acb0fcb103a2a18f70b9b2d0596 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz=54231b6c641736b29317682be9d1de9463e23478a892c16e083bc1bf20c9c925 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz=e41b6582cc6eb2340208a3473d54d441e13fab87bfee3091a513da4039c224c6 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz=9ca2df0ba2afd630a94a3bac08f8c412fdb6f905333c8978ac9b6bb5be777774 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz=dd9f6f6d930d18dc5e1764691acd2e33cdd032ef757d534ea70202fcdc18e461 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz=9d0e4864ecb7e33b231dedd10b54ad7707d79c61ff455256fd693a46a4ecddb5 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz=b508af76bcabed45442fc1587ea1c74bbbf85d75fbd2fb64d7078cd799485ae6 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz=3f9916a37ac0b79586756f09986516ba08e1c24b4d4675bd17d66058e42494cd -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-ohos.tar.gz=a80bdd0178f0b9c98c2fe80e59a1b936115a509d9b1be0202bea09d275b4c5d0 -dist/2025-02-08/rust-std-beta-armv7-unknown-linux-ohos.tar.xz=6cb0340d4633e52f7a6f3419a0f18a9d0b75f604fbfe99ce5886186f81204264 -dist/2025-02-08/rust-std-beta-armv7a-none-eabi.tar.gz=f9ac794582c73c7e0a36990daa6c2e2d637213dc16a0063aed330bf68cf04d4d -dist/2025-02-08/rust-std-beta-armv7a-none-eabi.tar.xz=7463c6f6e9ba1bc056ab528e00017db0d6ac2b0e06812f0b1d7b569a8a7e51ab -dist/2025-02-08/rust-std-beta-armv7r-none-eabi.tar.gz=c676cfbcaae8c7686a231693b923f98e23ed3dfa174ecf42aab57d94e2bddd85 -dist/2025-02-08/rust-std-beta-armv7r-none-eabi.tar.xz=93b2802c8f555fdf03cd309539eabfa2f8e434114f8f750b89ec3005249e9b91 -dist/2025-02-08/rust-std-beta-armv7r-none-eabihf.tar.gz=077cf1bbe4fdb0c011bd625a59ebc4b3d2876a50b544b76934523504c59042b9 -dist/2025-02-08/rust-std-beta-armv7r-none-eabihf.tar.xz=3be6d9e04ad155e78be5ecce391b57b285c7675cd9a4f86e2ddb388c934c21f8 -dist/2025-02-08/rust-std-beta-i586-pc-windows-msvc.tar.gz=2e705d5660544cec738cda300b059dcc1d730f7ff3cb029980a1ac9c1f9e6831 -dist/2025-02-08/rust-std-beta-i586-pc-windows-msvc.tar.xz=4cc0760e20f53648ae5b171c6948af3950cda4c468f2bb437016d92a2eeb2465 -dist/2025-02-08/rust-std-beta-i586-unknown-linux-gnu.tar.gz=3a516cf5c265899c9a548f6b9305b78069cc03864dcf1b3fa0e247adfa978cb8 -dist/2025-02-08/rust-std-beta-i586-unknown-linux-gnu.tar.xz=25144f4fb500ab9ba438042dd24796b25660fc3d16d3e04b64561bd35f84e46b -dist/2025-02-08/rust-std-beta-i586-unknown-linux-musl.tar.gz=70bf9429de2e11fe9e14216d3c1cc61a3923e1a7c7bc17d5b0d63785716a9e26 -dist/2025-02-08/rust-std-beta-i586-unknown-linux-musl.tar.xz=35cfef70aa5c59ecbe0d563959c62ec0162a8943d32cdc45dd0207b6ad3d16eb -dist/2025-02-08/rust-std-beta-i686-linux-android.tar.gz=a17f82a5f41e38c5c9ccaf1b2cf5182ed2e3c459e87c841497f0594cda7f71bf -dist/2025-02-08/rust-std-beta-i686-linux-android.tar.xz=06565daae363ed88f579f261a89f75d126785c894e439976ae47870cedd56378 -dist/2025-02-08/rust-std-beta-i686-pc-windows-gnu.tar.gz=986595d50c1c5799f67bd04575b248c5cd81dc03f318bd137b46248f75b2727f -dist/2025-02-08/rust-std-beta-i686-pc-windows-gnu.tar.xz=9daf96aa939ec6ed4ac8ff6119da06fca827a7f160e5c7db658653d5839846af -dist/2025-02-08/rust-std-beta-i686-pc-windows-gnullvm.tar.gz=f793d7a5ce20392287a7d178a2403d1d72dec2437401c447a7c5e3168c25bcf6 -dist/2025-02-08/rust-std-beta-i686-pc-windows-gnullvm.tar.xz=039a361f65fd610b14142f0d654895f4ac271cfb03918f7fcd8b2e9c5ffc3c98 -dist/2025-02-08/rust-std-beta-i686-pc-windows-msvc.tar.gz=6cdd125eafa981da12bff2a7e519866cfe40b7d6d7b6debabbd2415759fd9dc8 -dist/2025-02-08/rust-std-beta-i686-pc-windows-msvc.tar.xz=7f1a722bc007efe77dbd099ff36f2c682ec4bcdb7e8b60d6ad868e9d08a9a367 -dist/2025-02-08/rust-std-beta-i686-unknown-freebsd.tar.gz=b7dc78d6d4e6ce343ce90a7153082575a991eebd8acbc3cdfbcb56d1cc281b83 -dist/2025-02-08/rust-std-beta-i686-unknown-freebsd.tar.xz=91d19c3086de738b3d11a2bd0f0ad31c9f6a9c39ef800fdb2040638fc91c69ac -dist/2025-02-08/rust-std-beta-i686-unknown-linux-gnu.tar.gz=fdd0f12816d4bfc15c441cd26c7ef0f9ac05f19b03f471f162e8781f04bfc392 -dist/2025-02-08/rust-std-beta-i686-unknown-linux-gnu.tar.xz=a1ba9ce61110a1a64cba2bad7274865979d8d10cf30dba44137cd0acd4b49bf1 -dist/2025-02-08/rust-std-beta-i686-unknown-linux-musl.tar.gz=3774b47f5d6748c32d634f0414391121f2a68d7e3e15162cce62ca42bfce1db3 -dist/2025-02-08/rust-std-beta-i686-unknown-linux-musl.tar.xz=fb0203eb986554773288b732feb65a76aa7e4510b30acf60a9a879614332f0e1 -dist/2025-02-08/rust-std-beta-i686-unknown-uefi.tar.gz=a388f43900f4ac040e2263f06e89ef92c3d630f2631b37147eb1234e3ff5555b -dist/2025-02-08/rust-std-beta-i686-unknown-uefi.tar.xz=5fcc43194705468d31fc07ea2cca780fef717adc2d46bd9508d006adcd237c23 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz=c1d25f88813fb558bf47478a7e2a43e735f2e7ceba87f3ab8e658200825ac6a5 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz=66ae16763fba1c9e54519a34b70811f4b54c2a3985bd0faab4ae1a454f837556 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.gz=0cf97c80c7dc0e760d9aa2f6a6d6b82ecceed06b0c0e7f56b2f3fee98f558d3e -dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.xz=7b8284890d5c90e9a3d2cee73ee6b77ed0f023321a547a9add7d25e64886c9b9 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-none.tar.gz=67f97000b8786928eb7ff7f060fdaa2fa9e3805c23e5f3fc24350c6ab0954c17 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-none.tar.xz=5660100854fbe9fd87c0854b560a91dd5b653f07a0c374ba6349c44ff54b3b76 -dist/2025-02-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz=a885c29e4eea19ada52cc22bfe395eb0f2e884932885c3978187a44405d5873a -dist/2025-02-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz=acbfef3c94943ebc1a44e662a5eeffea6c3c0f8b2518568b03d2e1c5baf323ea -dist/2025-02-08/rust-std-beta-nvptx64-nvidia-cuda.tar.gz=2bb3f9493afdd89c52bd62e2597c8687335e0d4fbe5a486782335a614881a516 -dist/2025-02-08/rust-std-beta-nvptx64-nvidia-cuda.tar.xz=0702664eceb39c21390e3ee8dbfc0a7a181877449642b1b47dc74e1f463d8ebc -dist/2025-02-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz=788b46512726f8350f8266f4dc7e3bd4108ea96b2c257876d42d6c62cef71507 -dist/2025-02-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz=a746eeeb6c41696c95144068e348237bc7a3b254b1c3db626797dd2947194999 -dist/2025-02-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz=48f11a2d3aee9b3cb8d9e7f6480c8859427f446ebde617e2575a17dda6605fc7 -dist/2025-02-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz=5a3933b2465cfe93daab1b5d339a0da17bc364d5621d85e192283250b337e38f -dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz=50bddd9780ebcb5bc081b41c071c6059618881e1cc384f30787caa6fd2f28127 -dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz=4630d67082a6c2211a8c59a6da45d260616bd026d7cf7d2bbee5ae6d24b218c1 -dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.gz=4a0bcf103df6febd7b3e04bb24d54b30b6a2f4ffaf150f6774811c149f450588 -dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.xz=6a37963463641ddc14e03c0f9d8b037cd62afe3af89aeaa73f1f1d3aea1a6f93 -dist/2025-02-08/rust-std-beta-riscv32i-unknown-none-elf.tar.gz=7e2c0f7ea78086cc2b8674aacf350b6de737ca68a51778a8a66c75932161a8a8 -dist/2025-02-08/rust-std-beta-riscv32i-unknown-none-elf.tar.xz=a575b31731a910d2db684a931ced914b4286b942ce878fde94f08bafae92903c -dist/2025-02-08/rust-std-beta-riscv32im-unknown-none-elf.tar.gz=096407f438062be73bdd4f2efb6e06ddcb6c6c8e08b3c2db76388a4f4c4a731f -dist/2025-02-08/rust-std-beta-riscv32im-unknown-none-elf.tar.xz=38b771d01c0a56330d9547692c424e92b243d3f2448c13b29873cb2e4fe70b17 -dist/2025-02-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz=218d5db0b8427fcc0a81612134d830e6807db8d66eaa4365c4b101f29ab75ae2 -dist/2025-02-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz=1227b4dbfe7f3a0c7715904d3ed1e9f9846c49e522bb579d7dd76de370ab83a2 -dist/2025-02-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz=8e5ad6f6116b0fef61650f2a3788cc9a9e6da1cd76dd0dc300d81060ef42ee6b -dist/2025-02-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz=777cc9ec22cb9b92ea3569d6835770f45ea7793397be670edeafa65660d411eb -dist/2025-02-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz=16d6414fcbfd0356206cccb10f0d5ec1391300c8bd92029d9457fc3030cf3cff -dist/2025-02-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz=bd4ffe303e7b6a9031eae2dca7b4af4c7095e06961a55a6eff01db57178c1635 -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz=facbe91da7b765e03b058682a1353153b89632f5f60692b25077ba4152105faf -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz=e130dbd1aa2f19c308ca3e72e0456769ab0898a9bacdc667261396d786a22fca -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.gz=3849880a18e3176c4acb895dcee7f5befa64ad3413ac8476325d97a9a2bbc542 -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.xz=8a14b3cb0c9e20ec84ab686e6eca5acd201e71364ab5007c96b884feb4b59340 -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz=f5f58c50d793cb26103f812bb32b2d3623c57319a141e151201764f20032262b -dist/2025-02-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz=db7ea697f41b8dc2610c6d71ded8dc0b80ec848c002cb6af8faa3105023ec424 -dist/2025-02-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz=b081a9b131703cbc11658eb84e54e495fca021bdc6487d902c7aeb8126629437 -dist/2025-02-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz=2a3327ffdd3bfb9b4ce6d1aa13202958587d0819dc49ce08e635970d8e608b6c -dist/2025-02-08/rust-std-beta-s390x-unknown-linux-gnu.tar.gz=3b0abfeb0a6bda721e1faad0fe4ed2db072ae04beaef53d895f3902a26387522 -dist/2025-02-08/rust-std-beta-s390x-unknown-linux-gnu.tar.xz=5d6314a99746c5fd7f1d0eb0ac426848b4baafb9e2f4e08b7ce361091909a485 -dist/2025-02-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz=01f85bdc840f6d354fbc765b2574cbf039a97e7a8cd4345f31d4a93f41ea2936 -dist/2025-02-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz=350aa8e77ce705d04d996ae3911121c14213fed5db6d179ae4efeb54e64d5554 -dist/2025-02-08/rust-std-beta-sparcv9-sun-solaris.tar.gz=4cdb48054bcd8c596657c466145e1ec9d9a513d6019694895b7b1218183d7ed1 -dist/2025-02-08/rust-std-beta-sparcv9-sun-solaris.tar.xz=abda0bf8356c63fcf50fafb196c86a6c2275f3155362fe6b9eb63c8a145e07dc -dist/2025-02-08/rust-std-beta-thumbv6m-none-eabi.tar.gz=87ce4c701797be511509773e6121d69470d604f143c4e46e18866105193d503e -dist/2025-02-08/rust-std-beta-thumbv6m-none-eabi.tar.xz=d0af4c523a37df6ef2519d2abd680e2abc21e8806904cbbfa2bad3ddebc55252 -dist/2025-02-08/rust-std-beta-thumbv7em-none-eabi.tar.gz=9c183442ae8a7bf18303331e23c2263d180157a4fa9d000735b57f54f894fbf3 -dist/2025-02-08/rust-std-beta-thumbv7em-none-eabi.tar.xz=c9278b82123969a4f9c8536f6d27ceb6b6cae182335cee4cfc1ba8f297d503c7 -dist/2025-02-08/rust-std-beta-thumbv7em-none-eabihf.tar.gz=cda7f615c006369dea46c6d00660d596459d2ca809b27802c15a9e71e741f806 -dist/2025-02-08/rust-std-beta-thumbv7em-none-eabihf.tar.xz=7b2bf45033d1849ced101c696641a3e0037dc65029bea06fcedf3b11af1b21b8 -dist/2025-02-08/rust-std-beta-thumbv7m-none-eabi.tar.gz=bbe3db6ddb17830708086940294a8931054c09d781968f69c810a5a17cb4299d -dist/2025-02-08/rust-std-beta-thumbv7m-none-eabi.tar.xz=4cf28e2656f8927cbb75c007aded9d0fcac8d8d34841e9ac5486ba8ad3a75a58 -dist/2025-02-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz=6021afefa8b06c99e09e63c07a8d4580ef7a6d9e004205d85f8fea47fb7c77d7 -dist/2025-02-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz=7fb5c89a7605b0b377fd3e11d3ac5e33dc59667557b690b02df5c852109cefe8 -dist/2025-02-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz=f1cbb573556272077f7a119e019ee4c1f8c533cfcbdb2b12c858c7d72c05212a -dist/2025-02-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz=2d7c0f7ece15f6ad5de053a4b0292113efd8b45457a7ea4ac4a84534985a6e7c -dist/2025-02-08/rust-std-beta-thumbv8m.base-none-eabi.tar.gz=fb5c1d99eeedb48edac78bce237351bb2a04b3ce1e028b47c488a28a0f5b258d -dist/2025-02-08/rust-std-beta-thumbv8m.base-none-eabi.tar.xz=301ced2f4ca8766183cfbd84b94ca09f21c9c2fee62b3e1afca440f5872ec6f0 -dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabi.tar.gz=c720cd1896d201ecee177381386cf37ff58a0ad2e153efa8752dc11358489774 -dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabi.tar.xz=f2e14c2a08777200dcec2c18677a1bd68c57a7caaed8751e17d4a82af0f61e9c -dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz=146bfeecf574cab3bc15396c2523f27cc463ba9030d9a8c9a07118781a78227c -dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz=093364007abdcb942a1d095bba6b3f6a63cb891e3897764923828db5aa44f970 -dist/2025-02-08/rust-std-beta-wasm32-unknown-emscripten.tar.gz=f2e4ef8637a02510dc3edf78f7117dc16671946e1eebf3ee8911160bde53f3a2 -dist/2025-02-08/rust-std-beta-wasm32-unknown-emscripten.tar.xz=d30b8b9a7607de4cee24b144452439726eb8b4a436f53c058c2b0c21b686a391 -dist/2025-02-08/rust-std-beta-wasm32-unknown-unknown.tar.gz=242403cc6e3df3d47c566c63fccfb40e6a95d2f2295630bb13f4875c9e28ae62 -dist/2025-02-08/rust-std-beta-wasm32-unknown-unknown.tar.xz=8ba08c010e49593d417feb05f3efe407200421bc26d40b51a8d92ae6cbc46200 -dist/2025-02-08/rust-std-beta-wasm32-wasip1.tar.gz=25cdad2de0d599c5e90373765acba871e2facc7656ea1362b3e0d1132fe8805b -dist/2025-02-08/rust-std-beta-wasm32-wasip1.tar.xz=0eb3ae579124a47f7e8b63e6933e703d00c535f8369c614678e35c431a5480ff -dist/2025-02-08/rust-std-beta-wasm32-wasip1-threads.tar.gz=08d400d8ad036c2b240f4044adc6cf484cf996b5f1cca5e9c0fe81814a71635e -dist/2025-02-08/rust-std-beta-wasm32-wasip1-threads.tar.xz=46aeb5066e5fe4bc613a704c760292a85d2cd5ae10d135412adf5cb42de24015 -dist/2025-02-08/rust-std-beta-wasm32-wasip2.tar.gz=9df47e7c8280b8780ca41ed3dac9326375c76955560491ade1c2fdc8682b70d4 -dist/2025-02-08/rust-std-beta-wasm32-wasip2.tar.xz=275cc332f6d29c685ecfc308e143edccf58fce0359f632b038733a7759ae7389 -dist/2025-02-08/rust-std-beta-wasm32v1-none.tar.gz=96ee2faa07796474ea348b83b626cfa0bd07d108ffd05aed8051b63960315ee5 -dist/2025-02-08/rust-std-beta-wasm32v1-none.tar.xz=965650429f8129c65a6180025fdb69c0890f5c6f9c1fc16566c08b055e4ed93c -dist/2025-02-08/rust-std-beta-x86_64-apple-darwin.tar.gz=92ebd93de4f4da8267e13824db8455dbcb7bb95ffda8ae480c648c2eb8f820da -dist/2025-02-08/rust-std-beta-x86_64-apple-darwin.tar.xz=00e4b5a44f69a2c9235e522eee91e972624c75e3ce773928b09e9ee20d2d51ba -dist/2025-02-08/rust-std-beta-x86_64-apple-ios.tar.gz=dfb3d88798ff9b490c1a517d57e459a77cf2bb2e8b427493a3a612405534ebb3 -dist/2025-02-08/rust-std-beta-x86_64-apple-ios.tar.xz=7091bae8ccf328336261c2b096d1565c0dc9dca02b03d4e228a7c3f4c412a6df -dist/2025-02-08/rust-std-beta-x86_64-apple-ios-macabi.tar.gz=79628c744d12c1bc5514801a530d903ec539efd16e82d0c871adfaa168b7f55b -dist/2025-02-08/rust-std-beta-x86_64-apple-ios-macabi.tar.xz=2b12ae64c94a4f11591de8484998391d2825bc68535257dd305d31a1c51a7210 -dist/2025-02-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz=54f4caf75ac93676fd61fec65e2ea6b73774d5de7d7abe8d47d9c2d8030d8fe0 -dist/2025-02-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz=abc1feb82d4449c0d098a1ee0861ad991e79911cf0d5cc9ed9b5ca1e134248e6 -dist/2025-02-08/rust-std-beta-x86_64-linux-android.tar.gz=fdc1afd6334f725cfd913faf0915da711cdbcc45c05ec2672fae34d97e73ca60 -dist/2025-02-08/rust-std-beta-x86_64-linux-android.tar.xz=9451c74b695dce762d56354fac148263b0a7de75209c127bc7126da54ede7114 -dist/2025-02-08/rust-std-beta-x86_64-pc-solaris.tar.gz=d32731be8a9d3c5e8279a1b4971d105fe457717acbdfcfd720bc0ae55a34df26 -dist/2025-02-08/rust-std-beta-x86_64-pc-solaris.tar.xz=a5a08cfaae7eb3d77c137bf0d436beb7a84a19e351f529fe459861a8841df44c -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnu.tar.gz=7c41f46506f93132c5f90184d7ad1577edec98d47be17c6330f24cd172c673d5 -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnu.tar.xz=e439c8a7368e70685b239ab7b84bffcd8081ddc80c2d9f6d2b686485316aed68 -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.gz=128c7e526e37551ba3b6a347cb870c4ceefb272d964512fa10635c8f1f6e239c -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.xz=660409184e81625419b91a4fb5d84572abb0505d9bc11bacbed50121f9230790 -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-msvc.tar.gz=10b37018a254f81e55f555628fcc535a54b0eae0097f02a148c443a3d7e762f9 -dist/2025-02-08/rust-std-beta-x86_64-pc-windows-msvc.tar.xz=d61e44948d2ea70b44c8d3f958a3657dae9eb8a551aedb3ef90327da0124d9d5 -dist/2025-02-08/rust-std-beta-x86_64-unknown-freebsd.tar.gz=7ed5b948a50946b518040170be16cba1b5ec0c02f823436c973e5afbd335d26b -dist/2025-02-08/rust-std-beta-x86_64-unknown-freebsd.tar.xz=0bdce5b2f88448dbbe101f4ef48231763739533b52c32ab6ef858b6b37d98a50 -dist/2025-02-08/rust-std-beta-x86_64-unknown-fuchsia.tar.gz=49676d645ef9c49a421f3fa1d908830b61542541f1ea12c2d240ceaac3b977d4 -dist/2025-02-08/rust-std-beta-x86_64-unknown-fuchsia.tar.xz=1c0854c619e2a0dd7e508513fb68c22352ddc170572bfe6535d2f759de069c53 -dist/2025-02-08/rust-std-beta-x86_64-unknown-illumos.tar.gz=8ded61102c481e7c000292a8c6d39d84c016f81b00618947ac7357a7c72fb142 -dist/2025-02-08/rust-std-beta-x86_64-unknown-illumos.tar.xz=b76ed9b0896cfe863fd2aff88fd6d075e6091a651cb0d5fa65307948316f7ebd -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz=1cbcf5ae9dd2c61212b82bf27bf1b1b7d9504f077119c1fa04a978fa0ef3b2e6 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz=86f236dc4222f5f93f160ca847f43f364e1659b6d4c9f68a31c202f5346f2221 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz=2225ae88e8cf954b7eef8fc2e4f391c0194fd7be6433928dbc8aa6e2235ac479 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz=6017a3197b7a103a4444b81f8fa4f790a2b11bf1c3db0af297e2ed0c97f78172 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-musl.tar.gz=e7b3c4d8efb8f56fa76c3cfe51eb0683fc41308691ac194b9eb70e13b1b2e976 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-musl.tar.xz=f0ad48db569e21b8fa1053de3320d766cbb10962ebbd69ed56f170bdaf76fe45 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.gz=f1baa7f02c0969d74cd0ba420ae0a8d5e761cd5545c04fd2e432c889db8cb655 -dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.xz=e572e1a7db7e0127bf7072e5361b91dac84c019afa6433538b40dc984957f1d7 -dist/2025-02-08/rust-std-beta-x86_64-unknown-netbsd.tar.gz=c714b5f4a61041b5c68abc532203c88d65a852a813b7af8e11ab3207804886fc -dist/2025-02-08/rust-std-beta-x86_64-unknown-netbsd.tar.xz=61d6c87b146f114d14fe637257b9feccbb1d787958a7291f7800c7541bd8e21b -dist/2025-02-08/rust-std-beta-x86_64-unknown-none.tar.gz=5ab7c9985beb3f07520cecbb60c2fcb8bf60b3079b253267fb55d2139619331a -dist/2025-02-08/rust-std-beta-x86_64-unknown-none.tar.xz=992257d8f922654977d1c1fdad2b57654b4ea7fd2c27d6a4bcb8f85b9a75fc5a -dist/2025-02-08/rust-std-beta-x86_64-unknown-redox.tar.gz=e5090b881329fd94e4250cef92464bf3fc42ae6566ab3bf461e1f3c843d3d1fe -dist/2025-02-08/rust-std-beta-x86_64-unknown-redox.tar.xz=89cc1ad229a453c15d4a88137646d6824c572eed602c9c131982e3ddc62abd75 -dist/2025-02-08/rust-std-beta-x86_64-unknown-uefi.tar.gz=f42383deea91ab9dfdffede178b4411d751772a482811058dfc0bcc33da2fab6 -dist/2025-02-08/rust-std-beta-x86_64-unknown-uefi.tar.xz=3b4e67edf9785c0eff0fd83e357fbd4c0840620d1b7380ba5d270729f751e4b1 -dist/2025-02-08/cargo-beta-aarch64-apple-darwin.tar.gz=f197e428af3ea3d409a43b54372c9f0f7f8f70ef8d048e066b5c609364211e35 -dist/2025-02-08/cargo-beta-aarch64-apple-darwin.tar.xz=e84b8ec6f87512fbf31c823703b94ebee8531675430224331845158b8997121f -dist/2025-02-08/cargo-beta-aarch64-pc-windows-msvc.tar.gz=16b73927483117d158a3f3aa36d9cd14d74dce707071345fab9e6c359b68665b -dist/2025-02-08/cargo-beta-aarch64-pc-windows-msvc.tar.xz=3fb1381b750a1ccf386602394af21130e9cc6384b962bd008ffb2e11bcac4c1b -dist/2025-02-08/cargo-beta-aarch64-unknown-linux-gnu.tar.gz=2b0d90694987ee10a0f0e5b40c1f95c65c9bbeae6c921556b85067a1920f5988 -dist/2025-02-08/cargo-beta-aarch64-unknown-linux-gnu.tar.xz=b47667e97225ce7542c6e9a137adbc7c002ee1e4b1e0c1255b5dcb87743d886f -dist/2025-02-08/cargo-beta-aarch64-unknown-linux-musl.tar.gz=843bea38aaeaf6629060a046e6654fde6f4a73221a996e56ea9a1f35466cc6cb -dist/2025-02-08/cargo-beta-aarch64-unknown-linux-musl.tar.xz=147827cb32d5ff3628f347800a9202eb0b3caaa142d363dffde94bc6bf821352 -dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabi.tar.gz=0dd6585f3e93a60d4084a4f7f6c58748e82c03ea38fee164828d3911d024459b -dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabi.tar.xz=2e8240d79a86de26e7782265bd6551c6357a025b7084a3ba88161c84e2fee54b -dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz=323095df9d5c9f47463c5b05729960ee0db5f910619050ed548adb2b8c59fc35 -dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz=8f5be63da1f8e9a7d90116c9793e03021855dde170a356002f306180d4ba7ff7 -dist/2025-02-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz=63dfca05df7a8d14c27070ce882a96defa2e5c3134fe17e848273694b42b3c88 -dist/2025-02-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz=3881f42ce8e69953804cb0c566fe08f44ab8763cefe8c0d6a4461645dd44f518 -dist/2025-02-08/cargo-beta-i686-pc-windows-gnu.tar.gz=70aabf19aa3db89599131fc09fc005a9c8c0974d3f04267df0e41007f5bc46d7 -dist/2025-02-08/cargo-beta-i686-pc-windows-gnu.tar.xz=c57bfddc9285dd7c1151c3bfbde4f92da394fe6c8d0239c1f9ee8eceeb15e29c -dist/2025-02-08/cargo-beta-i686-pc-windows-msvc.tar.gz=056e750115574ab4e008d76d1bda67aa30f3818a9f46cc88d7ad13bb4238d772 -dist/2025-02-08/cargo-beta-i686-pc-windows-msvc.tar.xz=663a9ec0ba07807ce289bd61c66e196262e991046da44dd583fdc1414759f5e8 -dist/2025-02-08/cargo-beta-i686-unknown-linux-gnu.tar.gz=95dee9910674196f2bf655e91a8443be5b46e36747bf1e980e1585fa3789375b -dist/2025-02-08/cargo-beta-i686-unknown-linux-gnu.tar.xz=09af49a00e181084e7f766c9008c2d3446ff1cb801780feb79d0b7cc31a038b6 -dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz=ab1ac3686ed7b3b50ace61efe20ea6848370de691cf0f287337113d7ca52c61b -dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz=bee237e641da0d804f2002d33910bfb199127c5006af39dd06d877ca5fd1ff82 -dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-musl.tar.gz=9beb2a39f1ef7630f03ed1da5e1e68964a4b198fe7f18d0db9efb4f10d70b35f -dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-musl.tar.xz=f1528e4aec2095d55b98e3421d2310f3aa3fcf7c2493f83e75d3cbc80e18f923 -dist/2025-02-08/cargo-beta-powerpc-unknown-linux-gnu.tar.gz=2ee460d198339449e85ff8c7e522c47f33677e90f8b215c0a13514fe5f05cdb1 -dist/2025-02-08/cargo-beta-powerpc-unknown-linux-gnu.tar.xz=4a9fc5e31abfe582b580e395ada8d59a1aecf65b07b09b8ce526a84fdf61830b -dist/2025-02-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz=9e471ec06debbe078b8c92773a1c4380969e92dbbd9f20884986b2cc7e942106 -dist/2025-02-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz=1cc6e9e448f036af3bd6f8e597ee242edc65811835e20545e84ab917744b50ca -dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz=08fb88ea0a4d904b28ef7a51275ccfd1f8480f1d33c7a5a83461d322143e81be -dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz=0809a5f718157763bbf67e8c3a3b9b868a6694bd88b87277b542fc3207c1f1d7 -dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.gz=dcbf18b645016eee37a23dce4126d0ad61f8886e8997b480609e8f8fffe0191a -dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.xz=f4f9350ec459016cc0fe54414d75fee119b0051e3ae1b839971ec5b569be97ce -dist/2025-02-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz=dbeee82ff5cec6c16ba873b40f986e85b55f831efbd4d09d0107b2e66037db87 -dist/2025-02-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz=2974493a708fd5c793b9f1920a11b66aa5ad6aaffecb0b9c597416b7200e411a -dist/2025-02-08/cargo-beta-s390x-unknown-linux-gnu.tar.gz=ca157ff6dac3d680f63c99fc2efbc30376eb6ae54682f40369c4d2aa8647b77c -dist/2025-02-08/cargo-beta-s390x-unknown-linux-gnu.tar.xz=ea5ebe153fbe3d1fdf514ebc050f46776b075268aaf7e7e3ef308f13d0ad545f -dist/2025-02-08/cargo-beta-x86_64-apple-darwin.tar.gz=dd19dc295a1c430a52c223478a01610b359e2e0b40abce7111c9a02a51d4d313 -dist/2025-02-08/cargo-beta-x86_64-apple-darwin.tar.xz=f729d46cb4ca8945657671d5d0c0a55792a2ac9f5ea21b3e2991843004fc23ae -dist/2025-02-08/cargo-beta-x86_64-pc-windows-gnu.tar.gz=9a7dbfaaafd177a725aef60ec6c4fe3c5b732bcbd69a2e25a91ad7461a76ef4c -dist/2025-02-08/cargo-beta-x86_64-pc-windows-gnu.tar.xz=ef585bc9e5f23368fbb960959f80fd34961909e62cd65bb847db06a7178b174a -dist/2025-02-08/cargo-beta-x86_64-pc-windows-msvc.tar.gz=5e396a15cc63f084467d9afcb30cb374c070856b0aa3fcf209d88bcccfc6436b -dist/2025-02-08/cargo-beta-x86_64-pc-windows-msvc.tar.xz=78cdbf2cf0d7fec4d24308853e96a39bf5c417905abfcad34de4d1b2d498a617 -dist/2025-02-08/cargo-beta-x86_64-unknown-freebsd.tar.gz=1e485ce036055c7b3e1949d9e34e7d3dca436438b3f09bd75d36e49217d53d44 -dist/2025-02-08/cargo-beta-x86_64-unknown-freebsd.tar.xz=80c5d0d5860eebbb807a2e5cf8ccba8ed4461f932825439ec8182f6f0c8939c4 -dist/2025-02-08/cargo-beta-x86_64-unknown-illumos.tar.gz=5681331e1d29b476c4f458fee453f73efc86856caf1d30c49df9dec3e147f4b1 -dist/2025-02-08/cargo-beta-x86_64-unknown-illumos.tar.xz=9f7d97045851bb1ab334761cddb38cd8bf3bb0b26f2fca4903c09301c70fbca4 -dist/2025-02-08/cargo-beta-x86_64-unknown-linux-gnu.tar.gz=24bda5749883e133ac58ddcfdbd8dbeeb660c3b33d613852dd1d993cc13f6e8f -dist/2025-02-08/cargo-beta-x86_64-unknown-linux-gnu.tar.xz=2304e5cde3efdb5c6e7319d8239bca7d1c69306846cc3eba84d70d49b8c24e51 -dist/2025-02-08/cargo-beta-x86_64-unknown-linux-musl.tar.gz=825a42ae4bab8be081c7320f06fc7ce6d0c0c31f2224fb0c13af4d01e04c3626 -dist/2025-02-08/cargo-beta-x86_64-unknown-linux-musl.tar.xz=656d148e383896d06483297d785d62c8e235020081acb4110a8bf698a3d6d6e5 -dist/2025-02-08/cargo-beta-x86_64-unknown-netbsd.tar.gz=1e6a750acd6c1f44e37b3d1b1dceef7e8a0d2b0806e1577b667573a6340e7cf9 -dist/2025-02-08/cargo-beta-x86_64-unknown-netbsd.tar.xz=c45bd23fd1004cea41f133a40bd102e55e9f7ed29c9e8cec83dcacc4653da7c7 -dist/2025-02-08/clippy-beta-aarch64-apple-darwin.tar.gz=cd22d4191ca0fb9d8ec3d627805f297ca4528018e34c4f627e7e4fc05d6b0954 -dist/2025-02-08/clippy-beta-aarch64-apple-darwin.tar.xz=0c408799a742b00dce013553a597e62d8f84232ede6883632dade6b3d024904f -dist/2025-02-08/clippy-beta-aarch64-pc-windows-msvc.tar.gz=b4d902d9a096cdc6eb655ae2a0960db6fe4b83ccb681cc5bb5124dcfc5e1fdc0 -dist/2025-02-08/clippy-beta-aarch64-pc-windows-msvc.tar.xz=9e2514d7f304e3253e7205cec8189b8f9b1d49da5b14b2c03e69b8bb0223a65c -dist/2025-02-08/clippy-beta-aarch64-unknown-linux-gnu.tar.gz=1496cc4bbd0edc18ce05bc2ca76d9ed78934f1d1c4749ff830dff7d1acc2535f -dist/2025-02-08/clippy-beta-aarch64-unknown-linux-gnu.tar.xz=4577dce94261cdf07064f43404ade755a8906ed0b1a39a148333d9309e011916 -dist/2025-02-08/clippy-beta-aarch64-unknown-linux-musl.tar.gz=d28217818fb6c1a13456684bfdbf9caa687dcc257fadffcde2d2fd94dfbb228a -dist/2025-02-08/clippy-beta-aarch64-unknown-linux-musl.tar.xz=bae2f1841776e321f5f950678516bb31c05dea8f825fda23f3a3cd423dc00249 -dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabi.tar.gz=e1698a07ab47d02954bdb67034de33a8414731e3d12a8937cdea97004d98e45f -dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabi.tar.xz=631499b2ee136c428f1c6045eb6aefee3e6c765dec1baeb0c3e4da056d540d71 -dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz=248a15737924d07afee2108e6545cb4bd5cce91878dedb5368c358c16a0b016d -dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz=6581c968d48e37baf99addf17baf8b4fdda1417c201da311959c62a51783209a -dist/2025-02-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz=8ff9d93ea49d805ffd3534c6aa03692fa7dc8bf0460bba7c22259257dae863d1 -dist/2025-02-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz=b267e928b9708cc168d84c005036d155547274e8fe03f23b14232609b780d219 -dist/2025-02-08/clippy-beta-i686-pc-windows-gnu.tar.gz=957e8d14451557ce11de7303be61a50c68af7b90293a46e48c9a1bb3db05d154 -dist/2025-02-08/clippy-beta-i686-pc-windows-gnu.tar.xz=576732c661cd0998f7b47e99fe84c3dbcb919e787e3222e1c27b5377361083aa -dist/2025-02-08/clippy-beta-i686-pc-windows-msvc.tar.gz=5a4ea7d3fd79823b2342ec9069e865000dc5ab58be0fcf3655bcb161cb195858 -dist/2025-02-08/clippy-beta-i686-pc-windows-msvc.tar.xz=fbe4f93a9f1ab718a5dd3995ce67b7b0768f7f211f8fc3f1e6b181c4e4f1f467 -dist/2025-02-08/clippy-beta-i686-unknown-linux-gnu.tar.gz=0c013dba1ac3db5ec21e672f357c6a86c379c29f7cac0d43df4857e0332abe22 -dist/2025-02-08/clippy-beta-i686-unknown-linux-gnu.tar.xz=0e585010d88a8f04f9e031fcef623a12da7f82ed9f0d827157b10f6be80eb920 -dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz=2716e252361ac72dfebc8521b3f2c0edaa6e0a0bb0b9a3ea3b9b888a5d747104 -dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz=3d400fda76fbc8a830e12f5f71e40d4993019e9e53d58434ca23e3d8761d530f -dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-musl.tar.gz=8d7cd64c2ec8ee5f25bbd6aa01ba22001a4ab2eae6ca481583f736a1da07dc31 -dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-musl.tar.xz=f60bca644d441e36e537e896d4b122ca0f8cde0fbd886f12c3a312efd5225997 -dist/2025-02-08/clippy-beta-powerpc-unknown-linux-gnu.tar.gz=a3fc359554026ae39c7cc46c53c6928de0522387ad2327444745eefd0fdcc43b -dist/2025-02-08/clippy-beta-powerpc-unknown-linux-gnu.tar.xz=8344b79f4a2a61cf68e526c144bbe797f1c60dec047845fc731f4c47a58b7be6 -dist/2025-02-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz=05c2cd6e95a7c8ef36703b9bc39cedb8e5eb5b3c93a66a16deef2e18e96be489 -dist/2025-02-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz=2a0c36d392c3b69fc437c8ab8358f87c6c50380e8c5ced6690c9a7d0be9c95e8 -dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz=c9c6975ec5ef1e206a917d03841db90e1f4a3562b0afec32a4753134752454d3 -dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz=efe920b25316d84c08693f28d0593d227ca18456be2dd9b426c8cbf49d81a352 -dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.gz=b133cb9709d11da1710b3b833a3e15d3fc216cacfd37e6e1c7c8fe1dbc202067 -dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.xz=7db8db7300b87bc7841ef59111c8f83fc6e6ffedbb6dd8fbb79431edb821e017 -dist/2025-02-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz=2fea1f879ca90478a2fb75566da4cbed2f2afec31af6d18160fe183772241658 -dist/2025-02-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz=668ef736714909588cae0bc77c30c3063d2911b0e1c28fc77678081099d38a83 -dist/2025-02-08/clippy-beta-s390x-unknown-linux-gnu.tar.gz=a05eb2ea42fc2ed7df974610b076adae42ec456bb80eaf9191521dda5c0cf12b -dist/2025-02-08/clippy-beta-s390x-unknown-linux-gnu.tar.xz=5874e0cfa3b7f7c3b8d9d0c84a519b98908b6228fcd9f29d971b9c36d639a998 -dist/2025-02-08/clippy-beta-x86_64-apple-darwin.tar.gz=e259a0e7776430f1697153505f937c92e942fb5c436c00dd9da3b160ef9a7856 -dist/2025-02-08/clippy-beta-x86_64-apple-darwin.tar.xz=a311ec69770a431837a26e63591dba11dedbad411b688ee69e457bb7a4596c50 -dist/2025-02-08/clippy-beta-x86_64-pc-windows-gnu.tar.gz=2b8278419633f83ca22e2d1c54a170e04775d903076935ce13e91575d6122715 -dist/2025-02-08/clippy-beta-x86_64-pc-windows-gnu.tar.xz=13190a1e83debb9483abc7b0e4e3a4b8d53895542ffa56ebc012dbd72b8e7637 -dist/2025-02-08/clippy-beta-x86_64-pc-windows-msvc.tar.gz=9c8c8de0bd646bb0284e47b6adc1db6443d9da7c06ed6d237c421339a446fd83 -dist/2025-02-08/clippy-beta-x86_64-pc-windows-msvc.tar.xz=32dbce4ca3f3abf6da249e33297efea856b3b0ff39b3571531d71e1d0f90a46c -dist/2025-02-08/clippy-beta-x86_64-unknown-freebsd.tar.gz=55b22726920214e2ca9c4e552b50401fb3eef872c63de554623aaeebf9e11e75 -dist/2025-02-08/clippy-beta-x86_64-unknown-freebsd.tar.xz=b67e699d65462020333c037f206287e609f35e448cffeed6ecaec6874ccb2233 -dist/2025-02-08/clippy-beta-x86_64-unknown-illumos.tar.gz=6bf570aa87c05050e5dffcc191db07b1b0abf18bce160637a1be39e5caa130e6 -dist/2025-02-08/clippy-beta-x86_64-unknown-illumos.tar.xz=52ae7e8906f27c020df67beae61c1c1faf6458a0ccb3e904b909841b2b504d89 -dist/2025-02-08/clippy-beta-x86_64-unknown-linux-gnu.tar.gz=fadc4ff0f2acc6d44a5a29d01101152c8570dcca69ea4fd60e8ca6cc2cfac1e9 -dist/2025-02-08/clippy-beta-x86_64-unknown-linux-gnu.tar.xz=fd8472509ffdb81ff5ce786784274f654eb213ce963caf6e5cb90baa9e641c3b -dist/2025-02-08/clippy-beta-x86_64-unknown-linux-musl.tar.gz=c94e847aae4aa7a04981a4be424cdb2a1eae81a808858a5fc14a20134b7575e3 -dist/2025-02-08/clippy-beta-x86_64-unknown-linux-musl.tar.xz=b1f2a240069cda55c7c49afda6137822d7aee855557cf7269ac4f440d54a0ca9 -dist/2025-02-08/clippy-beta-x86_64-unknown-netbsd.tar.gz=86ada6c1406ff381a81624da25e65f415380da01252e6016bffe50ef7ca5b49d -dist/2025-02-08/clippy-beta-x86_64-unknown-netbsd.tar.xz=2b24a66215cd93b84065cd35d00bb3e7c9482b118eaeaf089bb2a128450add88 -dist/2025-02-08/rustfmt-nightly-aarch64-apple-darwin.tar.gz=0e6740aa70ccffed1e2649619990b75586638b8eb34747aab58ba4cccfb09f29 -dist/2025-02-08/rustfmt-nightly-aarch64-apple-darwin.tar.xz=c5c166763202c35bb7844f0866f05cfb7e2666fe9416776a092372362e7bd8e3 -dist/2025-02-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz=cf025264c087d9339787db6f8cd4c76aaa9c3118b7875de7413dc1894b660fcd -dist/2025-02-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz=f788a44b9542ddda3a88e3000c31644e1b9ee874ce523798b6638f7f181b8df0 -dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz=0a7d236cd45ef4f3f12e4516b202cf9b5190e70a19044c8b17c5eef16c45032e -dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz=80cf271c8adc2192b212d1b40992d90aa21fcc695375774c17a4f70468c82c11 -dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz=58d0eef426f8f0c4bf191118161db008db378ee3e77d973d7e15e39e88c3f7ea -dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz=7eedaef7100f7272f38fbc3cc14a1f4fee7deddd31a59f7db71c2a6f2f03f946 -dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz=df5190ea7d9bb84d5ffdda74cec7591388d3501c2a4084c667e0f29ca0a0ba9d -dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz=96334a22d0534adc8521b6a000f422f1727f80235303137eac32f4e76e85194b -dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz=2944da8dab479b4892f512711ed6bb3b242602ab11c81c6b22352a467c898165 -dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz=5aa59c9ded50503a2f05d5330ef41ae888254887559b31c4304422aa4ba9e73f -dist/2025-02-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz=bf17c1d62ae3f59b595c6536add64453d5584135e1d238bae55216c428416767 -dist/2025-02-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz=c60925816b01596b846e56efa7cd0e186391e212da077b36d781b926799704ad -dist/2025-02-08/rustfmt-nightly-i686-pc-windows-gnu.tar.gz=5c73dce13f7e0ad408f39f49ae647b0fbda00416027ba43228a443f311b33fb1 -dist/2025-02-08/rustfmt-nightly-i686-pc-windows-gnu.tar.xz=df005321b30d82854f97a3e68a702c64ded7f4cde18edc69c3b1d7c8927b53e0 -dist/2025-02-08/rustfmt-nightly-i686-pc-windows-msvc.tar.gz=2483fe75cd360607f29fc5f7cfc6d55074047291544f398946b5c263eef6b164 -dist/2025-02-08/rustfmt-nightly-i686-pc-windows-msvc.tar.xz=f2553f96bb513e999597c89d0655bf1b28a338d6510f9a146b3e47674c83c550 -dist/2025-02-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz=9cbc32383a8b6025ab9b7d75bf95b831cba32826f2732597cc3749b1a44278d6 -dist/2025-02-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz=07f16dcf8340feaa8ac400eb54833017d501f78f11f699c095febec148f35aef -dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz=03f7b562d15fb47e8e3ad244b127ed170c6296fbf5bf822fddd51eb5ab2a4f1d -dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz=834186eb75bff0e05f1a7d9ea63382c7b96a18519aa6815060554b06f3d7b90e -dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.gz=45c7db895ae3751fe07dc7483d0c1ae6dae989ec0b3507eabdfaaf9b1f24af04 -dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.xz=8aef8265279fca165e1627639d64c1f980877744cbd8a927c6c6f3f1e9ef2fd8 -dist/2025-02-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz=4f85245ee5c997a7d821ea3c397c5bc7315c8cb07605f2b5a4746f254ef567aa -dist/2025-02-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz=ec1326a520eb4bac792bce1e260b261e3cd638c123dc2da962bf2f25bf3a89a6 -dist/2025-02-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz=dd473534cd897998f6dd361f18a61ea12ed38bbb323c3d602b3124e832ce37fb -dist/2025-02-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz=a3523178a5186ebd3847b1b0fbdf91f300b29f780fc7910fa867ccddaecbab73 -dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz=625777f6ccf6ede941a88252bea183f8f285f6d282f95a78153e5d45e63edaad -dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz=7c57c7c0163c74beaa80378974cfbe222f70057e44a025e042989f3816cf02e0 -dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.gz=b431d8683230d783641bbacf7fee8102ecccf527485e8a753781b49906cdfb56 -dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.xz=637801af10b564fa8b2bc8b3075b3fc26efd69237702bdd95b60f6d55e7a92ea -dist/2025-02-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz=2532bededd1512c36f97ad91d065ccf681b4df47db86dc382635cbd55e6f1aaa -dist/2025-02-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz=16eb4fcdc66b86d45af649905b33eb1a9cb9a859eaf4becae10b443a747b790f -dist/2025-02-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz=2c29615e4de5f4f9aac64102afee2f7775e961037c2b044ff5ea4690564a0af5 -dist/2025-02-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz=0f88b8da8d50b7bc1fef09a53c5cedb79d24b3a63b8ab8cc6960285acb7fde7a -dist/2025-02-08/rustfmt-nightly-x86_64-apple-darwin.tar.gz=f46c2a065cf61ba644062b20efbbd6cfd0dcba5b15bc8f333c35e32dd4640e03 -dist/2025-02-08/rustfmt-nightly-x86_64-apple-darwin.tar.xz=9bd81b4ec3625d959f96d7b6b17d6c548673c10f7246b712f99fe40e8dcb4844 -dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz=2d37451b9314b525d41817c432e3bff5e90028cb020f0331f39490975376bf82 -dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz=e8ad4c33272708ba094a2a14e1a69d9071345351921b357ebd0df7d32ccfdcd3 -dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz=1d8e24202a8b2111b78531e5313446c6d2e3be083aef77cbd95c09b909b7c49b -dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz=9217ed18bb34379079aa529e3ef2fcc899db75780db942b1b6a45cb8f9b317eb -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz=f82fdf61057bae8a38daa767f72c74efefaa6043ef48229bed9d8a86787387be -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz=60857a9f3518fa6e1a0b8f17a0391672af55bf37bf5fc965b18079060086f946 -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-illumos.tar.gz=67384f76d40cb80dc79bf0221a4c021e33f11f283e793404421bd5391d75f0af -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-illumos.tar.xz=e1238f9c47666b623feca48243e88ad40ba70d3d762e5e0326dd29eef41f8c83 -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz=cdf48fd39c450219ecbc0801aab198c74e31e543b663030bcff9d6df8829f7b0 -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz=a5a461c01b8709335c7e2dfef9378ee49aee5f9491f4bf6173142ab87bee3d31 -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz=d9881dac0e6d10758cc5e28d3c63be557d596336685b5d095cb77f69853ad978 -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz=beec700c0c6829c8975abbd26f7330a3ddc21040a8f2d531f1991f99ac11363f -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz=188004d4990d1ca6f8fa7b00dfab510b0cbe840fda4e7318942bc2664c03588a -dist/2025-02-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz=ff25e65591a638072362122059d71888ddef0b9b81f0b0d7b2fc285fe82192f9 -dist/2025-02-08/rustc-nightly-aarch64-apple-darwin.tar.gz=c97c0921c6749ab5eebb2fcc65cc7fc98af43d1504fa1cf4ef360e299c74fdde -dist/2025-02-08/rustc-nightly-aarch64-apple-darwin.tar.xz=51e12e1a1bb60b65145a5742899f0ba3c60840c60962c424351dd337de7b2906 -dist/2025-02-08/rustc-nightly-aarch64-pc-windows-msvc.tar.gz=469e68dc2e1546ca27117cb3d282a77bd783e84c351d911a2e45c91916fc5944 -dist/2025-02-08/rustc-nightly-aarch64-pc-windows-msvc.tar.xz=ca16024d975f6c4835d53a47cc12e728380ed9e9126f4f523854b5c8af148499 -dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz=75e9f08ced58ed868a1c5e727b632c1ea9ed8f483cadc68d30d7394ab3f60215 -dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz=c5d3906481bed31bfa563f216e8c17e8be971cf64d0a5d66820025900aa82893 -dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-musl.tar.gz=a6dab5d9fd0ddb5fd83f5332e3608df71b62891c1bc02f73479cf0aa344c4d1a -dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-musl.tar.xz=9b4412cb694f46774b5642b972b0c149b5ba8d4081069cf078ee83e7f7ab1c45 -dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz=cda11234e3e2370fb2a9ae7d4f50a7c44c646c5ea9dee4d4a576383785ae993d -dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz=bd6cece56d6559ae261d5494af10d665bb7293f439287f1d190cd959c598ab15 -dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz=c29c0ace7fe5b160e9399813848e70865d4eb90536169d9c6089a90b74e4e0b7 -dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz=bea382931c0b9804ab6ea0f3666679493c1c4390a2f732ad367b6540d4279614 -dist/2025-02-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz=c83086892fb1ce1b4ca0c778e9efe57334bd18d74a961fccca78125d58f185b0 -dist/2025-02-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz=30ac3e64449a919ccb70dd30350086bcd5e8f4d12e0da6851f685fb60cdb871b -dist/2025-02-08/rustc-nightly-i686-pc-windows-gnu.tar.gz=f51df0f5c9a8a89fabfb347f1164000a99485bd85dd67ca7bc84e2a48f9c80e6 -dist/2025-02-08/rustc-nightly-i686-pc-windows-gnu.tar.xz=153a564d7930f3c217b25f8573f79b279af82b8ea5ad7ccf09f8c127d4cb6c33 -dist/2025-02-08/rustc-nightly-i686-pc-windows-msvc.tar.gz=2d9c05cb1d60804cfca6076f231ac03081d3b2072cdb87e5f1d9f036325a17a1 -dist/2025-02-08/rustc-nightly-i686-pc-windows-msvc.tar.xz=fbb95c6c97a5e4389b761a1ba712f111f808113ef30abbbf0e95bedc5344708a -dist/2025-02-08/rustc-nightly-i686-unknown-linux-gnu.tar.gz=df09eea18c7be163abd768ede37cfdec306563d0b33219ae040d8f9eef263154 -dist/2025-02-08/rustc-nightly-i686-unknown-linux-gnu.tar.xz=3ba7cab1234713f4fffade6344b62fc6b89d264e3b8b993799e5e0051d869e08 -dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz=ae94de4d5bcd8c265fb0297078d446fd84bb5ca7f9e61f87e956330d2c439ccd -dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz=be81df065f92bd25825af0935b3188418c97e377ed7ce05ae287f576ff2eec9c -dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.gz=96ccf45347235ac893cb61aa0d61aedcc46ae7c93d26f3ad964a73ddd1c274f9 -dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.xz=1e19c00ef298e5cd1334aa60df8873c0925304bb2a996d0ca590d363443f2f20 -dist/2025-02-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz=3e44c93e6be85dfcd8031fce279b1d1604859d149a979d91144272ed4da920fd -dist/2025-02-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz=c3651fdbfec98c155159d799a895917c0df3599dcda71a79bdcedee3c9cb616d -dist/2025-02-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz=4875368f83906c9f447657ed70b0d53ae75ff563e6bd9b75110defbaf44ba134 -dist/2025-02-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz=069716dd18791fea69df0b97627bba5fc83ee466883080ef934f4cb6b6342ee7 -dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz=0aa826fe16a9245091b84972be39aae113f62c1a254b82ec91df81a2c2c2da82 -dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz=2324bf8323d784cd37ca9546295e252a0327e25386ba406409e5c4172412d356 -dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.gz=2b5debffe5fd870828cf54365b21b1cb989bc5223b76a911299208c5ec105c2c -dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.xz=34342b7ac92698d15b53afa13897fa37401e33b591e2a9ebb00ea17bf2ad7741 -dist/2025-02-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz=e189c8be0a75ebc0c65e1b467476c510415231c5bb67d742719b39c425ee98a6 -dist/2025-02-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz=2407a0e42ff8280a16e944f430d2724bed6765295a64a53f463e341d35f9fb0b -dist/2025-02-08/rustc-nightly-s390x-unknown-linux-gnu.tar.gz=ffbaaee6cb11d1cbed985601a58fa5e9d796161b0435b9a8ef547148f042200a -dist/2025-02-08/rustc-nightly-s390x-unknown-linux-gnu.tar.xz=3c6dcdea50189f815b16033dfc8524687d7101eafb266be8f16681fcf348dbd5 -dist/2025-02-08/rustc-nightly-x86_64-apple-darwin.tar.gz=43b2f1b7d16b46419d8fcede2b5b354ab778a1f2c3f59e691b71db8cfa00d727 -dist/2025-02-08/rustc-nightly-x86_64-apple-darwin.tar.xz=6f18083854625d41b5ace4aa8b33f9c1aadfba764a6cb8ce1d5986f745ddfe3c -dist/2025-02-08/rustc-nightly-x86_64-pc-windows-gnu.tar.gz=eba376122f9f9439aa2f6f08a08d496e07fd3e5ac99c82a69eab279e44755b8f -dist/2025-02-08/rustc-nightly-x86_64-pc-windows-gnu.tar.xz=e5b67e358ae1068482f6e09cdacb6f212b6b6c5e87056909b54182d21c6ba5bb -dist/2025-02-08/rustc-nightly-x86_64-pc-windows-msvc.tar.gz=310f2fc7bf1d32926d78e264638d2795718a1406209238c8c18ba76680c58fca -dist/2025-02-08/rustc-nightly-x86_64-pc-windows-msvc.tar.xz=f8915c772b352fd7f25a7f1be36c94f7b383b813d9dae139831c9f7f2b960de8 -dist/2025-02-08/rustc-nightly-x86_64-unknown-freebsd.tar.gz=05bd6715082b006f6d43c369f37c262732e4bb1c44cabe50a201ceb8556ce651 -dist/2025-02-08/rustc-nightly-x86_64-unknown-freebsd.tar.xz=d03c251f78273d4a3de99e650634d30287c4868031ddd3cc929cef8d7cb5d215 -dist/2025-02-08/rustc-nightly-x86_64-unknown-illumos.tar.gz=16804058f8c88358ae2ab0a8302acb092c27a459ca7217d30fde504746be14f9 -dist/2025-02-08/rustc-nightly-x86_64-unknown-illumos.tar.xz=b76535703edb204daf577e42b0a1ae2a41bfa18e0e3205fb5773e7ec12ec9fc7 -dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz=5a63f9f4ee7c5a91252ae8b235780ed6349641c9b6593e9038021c3a3927374d -dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=0a53b3706ab2981fadb020362dd497917f8361cc778a11d9a7fa05a3b329eea2 -dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=ab4e3c5a4eaabf0f227b160efcf2f8d0e9a572d079ece83c6313fca9865a5dc3 -dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=dcd74640d883aa75df93b86b041f98ef99178d5f39e78de3ff6801077703da32 -dist/2025-02-08/rustc-nightly-x86_64-unknown-netbsd.tar.gz=cdb3d9ac0651e3d44dbb50b3e341e609e228cbc4c358b126547a2909b807901a -dist/2025-02-08/rustc-nightly-x86_64-unknown-netbsd.tar.xz=f4227393819e678dd67c579fc00b52fc1a3974e270f10593d8b550f7362b5a63 \ No newline at end of file +compiler_date=2025-02-20 +compiler_version=1.85.0 + +dist/2025-02-20/rustc-1.85.0-aarch64-apple-darwin.tar.gz=458d9ccfab76f4d98ab363bd8575d6ba7cb2b2e4e88ec247334962d416657b31 +dist/2025-02-20/rustc-1.85.0-aarch64-apple-darwin.tar.xz=2a03e227b57a49d80b43473b6fa2d56ad661ece0d8ffd81f639cd31600d3823e +dist/2025-02-20/rustc-1.85.0-aarch64-pc-windows-msvc.tar.gz=ccea9eede9d1c1a0f4fc618d6ee29454e844ab312f97137b36a58b703488e164 +dist/2025-02-20/rustc-1.85.0-aarch64-pc-windows-msvc.tar.xz=1f5caa1e6116d17b78af5dbe5ae132571a0f95e6f5fbf2e603b7f0fcca537fac +dist/2025-02-20/rustc-1.85.0-aarch64-unknown-linux-gnu.tar.gz=e54c03bc6c8d00f400e56137086f62a73dac1c531113c7824ceccef3e6fdc198 +dist/2025-02-20/rustc-1.85.0-aarch64-unknown-linux-gnu.tar.xz=e742b768f67303010b002b515f6613c639e69ffcc78cd0857d6fe7989e9880f6 +dist/2025-02-20/rustc-1.85.0-aarch64-unknown-linux-musl.tar.gz=23a0ca78076c6df83a2b76ebd7669430ea68837da193f249b4ae0a04100af796 +dist/2025-02-20/rustc-1.85.0-aarch64-unknown-linux-musl.tar.xz=6ca3cb187eb88e9a7f690fd5f7fdde72377275a40ec977baca42971dc40a2295 +dist/2025-02-20/rustc-1.85.0-arm-unknown-linux-gnueabi.tar.gz=abbf7281fa1ce0731226a1f91638b87de7bda53eb0559881595599e9eb32bed7 +dist/2025-02-20/rustc-1.85.0-arm-unknown-linux-gnueabi.tar.xz=f4f915e3e553ffb570047e79fa12331011e9f3f32af1ed9fbd237588b2949690 +dist/2025-02-20/rustc-1.85.0-arm-unknown-linux-gnueabihf.tar.gz=462351d8e58b0afb7444749081f4246c666654bf50e3eb8603568a52df56e74f +dist/2025-02-20/rustc-1.85.0-arm-unknown-linux-gnueabihf.tar.xz=a2617342bd897f1372ed49802fe456a0cde4dd88202250d7a90573924736ac87 +dist/2025-02-20/rustc-1.85.0-armv7-unknown-linux-gnueabihf.tar.gz=2025dc1acc1e9038f075db162a04ab5a70acf1f4d2710c8a7c35e6cbb10e1f35 +dist/2025-02-20/rustc-1.85.0-armv7-unknown-linux-gnueabihf.tar.xz=84bbb983fefd97cc4d14756f3b3e5c88208ca95e33fc4f9936ec90c33cda5a6a +dist/2025-02-20/rustc-1.85.0-i686-pc-windows-gnu.tar.gz=c52f5d18d873a031bb4ea38201e4542bd465304106bfb22293cdb04b06d43626 +dist/2025-02-20/rustc-1.85.0-i686-pc-windows-gnu.tar.xz=f77a5c372f2a85fdd171ac2b131e74dfea38c8520061e78cd18eafedbb08817a +dist/2025-02-20/rustc-1.85.0-i686-pc-windows-msvc.tar.gz=e57b126ce7cde58579c3f0256c90fdf99bd271a9581a026b6a34cc2b0dea956e +dist/2025-02-20/rustc-1.85.0-i686-pc-windows-msvc.tar.xz=9ac71f5e19541741bf30db2ffc3bc312b029dd9ef839a0e066d8e88bc6b29d7b +dist/2025-02-20/rustc-1.85.0-i686-unknown-linux-gnu.tar.gz=937866c66863045dfe50424123e2ec8ede18a094bc4d170798f38113092d7ea1 +dist/2025-02-20/rustc-1.85.0-i686-unknown-linux-gnu.tar.xz=c5a5751f3cfa027b53fee83d01dec8e555f3622b6993335aed12b1747aa9543c +dist/2025-02-20/rustc-1.85.0-loongarch64-unknown-linux-gnu.tar.gz=c34f932e4f17120b3ff20776a95f6523f1d44f6333e3ecaae2c296748cb990e2 +dist/2025-02-20/rustc-1.85.0-loongarch64-unknown-linux-gnu.tar.xz=d43d2119ff25d879b2d280d3e5a03fcd21c57a32d479ad5626500c32432f18c9 +dist/2025-02-20/rustc-1.85.0-loongarch64-unknown-linux-musl.tar.gz=19e03a13578aaf42c2c6177ba5a499a840f40de04bdd9e9b6321acf37031cf96 +dist/2025-02-20/rustc-1.85.0-loongarch64-unknown-linux-musl.tar.xz=bf6f72de862177b6f347d641089ea0d900ef71fbbb54ca7f1751cce94f0fa6d6 +dist/2025-02-20/rustc-1.85.0-powerpc-unknown-linux-gnu.tar.gz=50c78b12b6c98e7ca2eea7d114474ff51b33396ad68392d4183331d61b5402d5 +dist/2025-02-20/rustc-1.85.0-powerpc-unknown-linux-gnu.tar.xz=fbe7154abc641d6cacfdc6239ed4701fc7a09b5046c6d1bd209b59e7f2b2d0f0 +dist/2025-02-20/rustc-1.85.0-powerpc64-unknown-linux-gnu.tar.gz=ab05a8163f5c907a175465050c8781438dd6986ff079c6a425f42ad4c3007662 +dist/2025-02-20/rustc-1.85.0-powerpc64-unknown-linux-gnu.tar.xz=f8e38291ba4241bc28e9c118d7a449ce3601abdeb2076f2f618858679fb3b929 +dist/2025-02-20/rustc-1.85.0-powerpc64le-unknown-linux-gnu.tar.gz=b84c475caf291cff30a813daaf89134575ecf69b10b40c6e50121934cb9a4607 +dist/2025-02-20/rustc-1.85.0-powerpc64le-unknown-linux-gnu.tar.xz=371e40f9d6d82aecb056f70f82868d98ddc1c20510aa7d388442ac8d2d86a6ca +dist/2025-02-20/rustc-1.85.0-powerpc64le-unknown-linux-musl.tar.gz=ced612f68b531c0c4955451dca8b24a4129422ba9c286d1a039f470e8e17f23c +dist/2025-02-20/rustc-1.85.0-powerpc64le-unknown-linux-musl.tar.xz=eb237e0ad82d72fb6fea5b8de7abee5d8bdcc74444a8f9c2f7e46d446fbc3a25 +dist/2025-02-20/rustc-1.85.0-riscv64gc-unknown-linux-gnu.tar.gz=3a0936c7e17391ac2b72a45845b739fbdf00f531baf675952517a5e7322a37fb +dist/2025-02-20/rustc-1.85.0-riscv64gc-unknown-linux-gnu.tar.xz=2da33044f17a8bc49a1478dc1eb2536df491a44d6e6bb0ec7c86f46877d44e98 +dist/2025-02-20/rustc-1.85.0-s390x-unknown-linux-gnu.tar.gz=79b12d98345e04060cc149099b6884574c0ad3a723203af54c9b428b1adc542b +dist/2025-02-20/rustc-1.85.0-s390x-unknown-linux-gnu.tar.xz=308361737ed522aa77dd8b4ea91b5db244113ada5fa234d3ed008b526d07e2e8 +dist/2025-02-20/rustc-1.85.0-x86_64-apple-darwin.tar.gz=3358fa99bbe7d70c3400700c093d6ca67efce694276f72ce8c4da43cd5a2235e +dist/2025-02-20/rustc-1.85.0-x86_64-apple-darwin.tar.xz=19bb6d9608d415779b85100eab92544b0e96d6b84b85b7c3eb4a15df9db1656f +dist/2025-02-20/rustc-1.85.0-x86_64-pc-windows-gnu.tar.gz=e6ed10e54106136171e85091843a788f797d37279ec9c0190ed207f179e2fabb +dist/2025-02-20/rustc-1.85.0-x86_64-pc-windows-gnu.tar.xz=3b3262372a832cf6bd024e55613ccf551931c5109e090ce00a439d6d66ba5ff5 +dist/2025-02-20/rustc-1.85.0-x86_64-pc-windows-msvc.tar.gz=8e688838f7b68061cf8a9161b98316ce433f5a50b27076b4f9bf995747e489db +dist/2025-02-20/rustc-1.85.0-x86_64-pc-windows-msvc.tar.xz=80ba356369004caf050d4389da5f8f924e4c07cf7189854b78718747f74747fd +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-freebsd.tar.gz=6627732f2b2a9224008988191bc0555f24036306ab176deb681104ffe74b780b +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-freebsd.tar.xz=e9852801c57915a434c0db4f6441cc515c5fb5a15959b3cfeb5545cb2b7a7bfb +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-illumos.tar.gz=3819efa6e85c02ce2a04a3d8ebc41d8133c4035f62005299a386a33ac08a0c20 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-illumos.tar.xz=e0448253e75c6e4d7c773e08a0c3a83cface60102b4f2473c68674027b22b324 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.gz=bddacba2c4008d27d6beb486dc701f8e39d7ce073053749c4d2c56013b6d2999 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz=7436f13797475082cd87aa65547449e01659d6a810b4cd5f8aedc48bb9f89dfb +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-musl.tar.gz=fc87da048cb903f65d349c8476753ea7f70c53e012dd883c73025765106349f9 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-musl.tar.xz=229735169a7dfdd460cc36e3a7f44729555d7de10af88494b77a93ce767d86c3 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-netbsd.tar.gz=80186233763265c6c12e86e13c2eaba137100bd979cbd21ef8a949e0d786d386 +dist/2025-02-20/rustc-1.85.0-x86_64-unknown-netbsd.tar.xz=9920135e0d82e324841a56d2d9fa424e9194c6ee01a2850b7380676747132f23 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-darwin.tar.gz=b7ff9bc2cabc6277e2ec6d73ca5b3e5ea5e2a0582e5e5302ef9e354f348dab68 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-darwin.tar.xz=7da1367209de00e3fb315c0e76658e3605ee2559892d29851a3159ae7ea1ddc5 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios.tar.gz=67fa6b6dc997bf8c7d5fb7539e07fffc78851e32e111ad661605f96515074a83 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios.tar.xz=27dca83083250431b79e7f64499ac8f0901a881726712ab380ed60c7dbbb3938 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios-macabi.tar.gz=8eec10890ceb228665d926a03a03c156d3d9040bd4c5aedc5cbd7430e03b9586 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios-macabi.tar.xz=da14e5c8b7ca745fa425c5fb14d2f13a11534b9aed9eccc5c92f0f08c5603e98 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios-sim.tar.gz=cfa34c84e88ea30204dc618f88cb08994072ac7a0408456472ce011da41eb555 +dist/2025-02-20/rust-std-1.85.0-aarch64-apple-ios-sim.tar.xz=fea06e54f3d5d0e474ec8c308b8e98c4b902132eeb58389967a1b13c3c91196f +dist/2025-02-20/rust-std-1.85.0-aarch64-linux-android.tar.gz=e66eb451fa7169d26578f27096005a853d1de3cee3eeabed7ab944e2600585b6 +dist/2025-02-20/rust-std-1.85.0-aarch64-linux-android.tar.xz=aa4f59fe9368b50b11f60508549a54e40fee740ad7948deb7c2283f492b3892c +dist/2025-02-20/rust-std-1.85.0-aarch64-pc-windows-gnullvm.tar.gz=5ccad748ca551ff9138f7382e49531104a16793af26bbcacccb6424d5b1cda32 +dist/2025-02-20/rust-std-1.85.0-aarch64-pc-windows-gnullvm.tar.xz=0fe66b88d16b57712431f2e039ae9d9bd349526007b2dcb6cdebe1e3b89d0ab6 +dist/2025-02-20/rust-std-1.85.0-aarch64-pc-windows-msvc.tar.gz=a2ef5fcd725846fa8e763ab0f72200ec8b10dbce0828b9ee6f793d953f1cacef +dist/2025-02-20/rust-std-1.85.0-aarch64-pc-windows-msvc.tar.xz=7154bb45bdc399b20266e051adfb6d7f2aa3f6df684080ab8b27c03784f2647c +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-fuchsia.tar.gz=832957fbf6079053d9b7cec14c0b79ee6432003f083a3896d242b3a359aab9cb +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-fuchsia.tar.xz=23608bbde84420cbeec41cea492494406a10aa152bc368e2480c74d53185712f +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-gnu.tar.gz=63f8c57c2433e5ac970a9512660b8ca86002699bad4de5a2287fc591a7091e49 +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-gnu.tar.xz=8af1d793f7820e9ad0ee23247a9123542c3ea23f8857a018651c7788af9bc5b7 +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-musl.tar.gz=fcc4bbdd9bdc326dc5fd7fc573acbf5e4f9d5915d343c177188abe9098b4db8b +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-musl.tar.xz=4aa3da29bfa0f807d5cfcde055d7619fe911a52a4459eff75fcd2d90f2279a7c +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-ohos.tar.gz=61a2cb551858f8c44c01b670cd05d507bde016ce13007330fcd07e239a9132c7 +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-linux-ohos.tar.xz=9f53d11dc40332e1e18c108006e69acb29229711aee54d10061429f31e3f6020 +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-none.tar.gz=16b2cbf21e74a87c030f097f9f4ffae1fe57994f361b75ddb1204cc922fa228e +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-none.tar.xz=badad6c305e25bc63ab343e93180da4934c246bc2e79c466aefdefdc677a7f80 +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-none-softfloat.tar.gz=0ddde6c60d534a535e8e1674ed165087d5695c12e6280f4af36098331d08089b +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-none-softfloat.tar.xz=93403bffa574077532bb38321e438e03b6e609a21dcec9e8bd9581d02129a4cd +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-uefi.tar.gz=9f6ddd25d3c825e332e7fffe322d82449ed5946ef454a126210c3176202f2fde +dist/2025-02-20/rust-std-1.85.0-aarch64-unknown-uefi.tar.xz=f0a1e463e9e8e9619bcf0118d0924f1a26dab26a69409441ae9a6d47086e098e +dist/2025-02-20/rust-std-1.85.0-arm-linux-androideabi.tar.gz=a60f53baea9bfb5064bc71ea120e0988766fea2d445c1d51da2ff26b8efc24ba +dist/2025-02-20/rust-std-1.85.0-arm-linux-androideabi.tar.xz=187de3796a6b66807f54ccd29fa8f1575532586fbd4a0dfa085dd7497c122aee +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-gnueabi.tar.gz=aee959e2659720d2a28d5c77e6a0f9048152b56f6469513d6a25d66a9bc9fc04 +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-gnueabi.tar.xz=5d7c7f0311a22e65a54a90bcd15f2f0c5f9149adca6e21488de8397de47581d1 +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-gnueabihf.tar.gz=3b4b3c2c3ae2b4ff81b4b44e7ba716c084875c8acfbcff69fa8a53d2e7b43733 +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-gnueabihf.tar.xz=2775a3a249e44fd47e764211433186502a73edb14ba11d5ac05e25a17d99aa4c +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-musleabi.tar.gz=51522b8287c49d462943de43ea7866a657413f504ed01ca91dca8cbea05e9b92 +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-musleabi.tar.xz=ac8bc55eac5683d82d00315df24e1efb0fe5e6f61a5cfb01a197bd961e189691 +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-musleabihf.tar.gz=c15442b720ec827219160d579eb9156d09264193264a3a0d39c5d8e2cf2ddf4d +dist/2025-02-20/rust-std-1.85.0-arm-unknown-linux-musleabihf.tar.xz=a994763782ad39dc997893747f029aa9469e94d632482b86f1351139879eb2b9 +dist/2025-02-20/rust-std-1.85.0-arm64ec-pc-windows-msvc.tar.gz=d3d1a4af3ba7407aebefdf3f7e75af593a26880831bf144099045b3c964b623c +dist/2025-02-20/rust-std-1.85.0-arm64ec-pc-windows-msvc.tar.xz=21fb8ce6e3c62a809c5e97655c6afaa4e9a6964b745ec50ce3aa4444310948f9 +dist/2025-02-20/rust-std-1.85.0-armebv7r-none-eabi.tar.gz=b0e41b10167668b40d5d533cb7ae166cb8b45f4eb89dba488cd769c007e3a6a1 +dist/2025-02-20/rust-std-1.85.0-armebv7r-none-eabi.tar.xz=3efa19eb7c2582a65405cb5f493b50504f1c90e515834030e8f49ab79c4a0fcc +dist/2025-02-20/rust-std-1.85.0-armebv7r-none-eabihf.tar.gz=53a358839744f6ba1a385fc443e4961affbe71fecef1c3589cb8d32c7f8a50ff +dist/2025-02-20/rust-std-1.85.0-armebv7r-none-eabihf.tar.xz=55f847958044e177845e899c0fc1551b4257729839a9c790d6dd9ae033feadb8 +dist/2025-02-20/rust-std-1.85.0-armv5te-unknown-linux-gnueabi.tar.gz=cc04c55e9c27280d2eb253863bc3902b3b3277ee7a279ba2fd786a8af1c06a3b +dist/2025-02-20/rust-std-1.85.0-armv5te-unknown-linux-gnueabi.tar.xz=f46a9f9cc7be46642ca1c24dd616a224e939e58af8aef6f1515737b823a20e6d +dist/2025-02-20/rust-std-1.85.0-armv5te-unknown-linux-musleabi.tar.gz=018370ccbafdc1496d307e31e6719b5f64fae14d0176fbed471b790333e0d681 +dist/2025-02-20/rust-std-1.85.0-armv5te-unknown-linux-musleabi.tar.xz=0d5785d93f9ef26350bd798e14b0805fcc9ec24199f089455571d24cb0591e5e +dist/2025-02-20/rust-std-1.85.0-armv7-linux-androideabi.tar.gz=76de193228c9277e2e88762da1c16c309f466e04007b1801be76453726122dc2 +dist/2025-02-20/rust-std-1.85.0-armv7-linux-androideabi.tar.xz=92a80f1e52a8fcbe3a0a53f939aa0fd861b625cdb1708bd671e1d0195bd4be09 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-gnueabi.tar.gz=b433c0ae086a462ae77c1b85533eb05ed9352abe926f135127d05d020dea5ac2 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-gnueabi.tar.xz=29159e7958f1cb071ead33b84bd37042e6f92a962bfe5cfe5d4ac2d008b7dbd3 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-gnueabihf.tar.gz=5a6112409087db2a050a7cbc5e15e3c8356b191683061f6ea6dde085375b3c44 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-gnueabihf.tar.xz=fc87231cbdff074c705c69a2956718f1d648669327bd1fbc64beb8e87d8ff931 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-musleabi.tar.gz=0a1f34c82e09d141f259667c027f8c60afd8763649db91051c482e0b7c438180 +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-musleabi.tar.xz=e3ad985f1f8b24d76c0e1ecd2b5916db8b01893939a0a13b6b1bf5df51e0823b +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-musleabihf.tar.gz=4a99373bb8b2d408e7243620cb3e0c753ae7e51a3d8b2187e0369e2ebc54bfdc +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-musleabihf.tar.xz=3eee98ee12d75cd63c107ad71323b81831db22e14080c8ccaa1246e3df822fba +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-ohos.tar.gz=75cafa381f97035293152035c0375ca6ca73cfc396ebceb092b91ea641812c7e +dist/2025-02-20/rust-std-1.85.0-armv7-unknown-linux-ohos.tar.xz=975ac7a827f95af3193b352a3b42ff1de486c446f2c8239fa9946b2137a50f32 +dist/2025-02-20/rust-std-1.85.0-armv7a-none-eabi.tar.gz=cfd3aaba027e17a9b7097dfe7ff3194518eedb47ba0b57c5067e13263a67d1b7 +dist/2025-02-20/rust-std-1.85.0-armv7a-none-eabi.tar.xz=7385d84d4d35472b4813aba56204b8edaa0332a5239ed3a787509e81707739c6 +dist/2025-02-20/rust-std-1.85.0-armv7r-none-eabi.tar.gz=2e285f4c986c5d0d4192cc4c29c2ab55ed9483d7313fab58d4c443d8664352e9 +dist/2025-02-20/rust-std-1.85.0-armv7r-none-eabi.tar.xz=b9311596184812d85546eacd3440f55a5be8bbfff901dd0cdf05cf8e5979cf5a +dist/2025-02-20/rust-std-1.85.0-armv7r-none-eabihf.tar.gz=33d22dd4f9407d8f02345a508360ab3859d855949e960bcd3f610e75cf7cae83 +dist/2025-02-20/rust-std-1.85.0-armv7r-none-eabihf.tar.xz=4a61eb8e3688ce62880876dc308abb6368a0a16e6e743ef1b4a0531feb3d9eca +dist/2025-02-20/rust-std-1.85.0-i586-pc-windows-msvc.tar.gz=2a2d73814ed6bba7eb6aa364074c8fb397f3a65f8c0c7b23870665dcf5a5ba4d +dist/2025-02-20/rust-std-1.85.0-i586-pc-windows-msvc.tar.xz=497f109ba1a95040682137dc357236c19b7e10dd57b43eda3e42fe47cbe51c77 +dist/2025-02-20/rust-std-1.85.0-i586-unknown-linux-gnu.tar.gz=dd3ffd543ed552820791f9bfdb0513e8d193afd0b702fc331bf0c16c127e5c1d +dist/2025-02-20/rust-std-1.85.0-i586-unknown-linux-gnu.tar.xz=3cb7318da10876de14076549d79410a8441923a92d62b616d8c105f5f5cd831b +dist/2025-02-20/rust-std-1.85.0-i586-unknown-linux-musl.tar.gz=18e67ca8b9c95e3e345895714b7a305342ef573d478f3da5f828e042344db347 +dist/2025-02-20/rust-std-1.85.0-i586-unknown-linux-musl.tar.xz=2bb598be00b5581983dda95afb6d1bdfd54c781573e952d9ea4c855887ffe8c3 +dist/2025-02-20/rust-std-1.85.0-i686-linux-android.tar.gz=2953dbd7cdfc6873decf35e2c380b63fc816cde8c50b311431ae862b9d726ccb +dist/2025-02-20/rust-std-1.85.0-i686-linux-android.tar.xz=667d696397333f59ca06d817b79006430fd3679d03aa8178ff42dc4f717bba59 +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-gnu.tar.gz=378c1ebf092cbe1d46aff06b3d9ed804211c573dc7c4a67b4a65bf3b2556620b +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-gnu.tar.xz=77ab5a078e42289a2a5651c43f75b09f012be5aeddf7d4e440284f9d6243f9a3 +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-gnullvm.tar.gz=7b8aa875c663bcef000112f9929dc5a1a6a11b0f6aa99d41d85cd5add925ddf8 +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-gnullvm.tar.xz=dbeb37c30b05ed8b2aa910802eb29cb08f8da77f3fcd528f37d2cc8f36ebcbbb +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-msvc.tar.gz=948c6860f12be07eac79b0ebcdbb92533c9255ff22ae713d3425474239fe04ce +dist/2025-02-20/rust-std-1.85.0-i686-pc-windows-msvc.tar.xz=10f6ce455b8061c7b79b70b7469590872c4f69a04be077b18e633a3c652c8b59 +dist/2025-02-20/rust-std-1.85.0-i686-unknown-freebsd.tar.gz=ebbad2fe832193d043e4b37c98fb3ddae1d8c84c510bac4fd449501a7a4631a5 +dist/2025-02-20/rust-std-1.85.0-i686-unknown-freebsd.tar.xz=7fdb025997e88a73e0b4a1af828309496244b120947d765911e7e8e70c836d3f +dist/2025-02-20/rust-std-1.85.0-i686-unknown-linux-gnu.tar.gz=b1b8e059ff51201f1b8266522dc79ff82ca45f3b7faed32baea8297a249a918d +dist/2025-02-20/rust-std-1.85.0-i686-unknown-linux-gnu.tar.xz=401571adfe1223d83ed041e5a8c54c1f3afb3010d1d5b0c1fd79e7da1ab0a0de +dist/2025-02-20/rust-std-1.85.0-i686-unknown-linux-musl.tar.gz=b45bf1eb2a962be32a73d2cb26f74bd5d942834accfffc51d0799728240f3c1b +dist/2025-02-20/rust-std-1.85.0-i686-unknown-linux-musl.tar.xz=1a35004afd1bc37df873c98284862c2e04b7c8c045d0edae776828463d87d36d +dist/2025-02-20/rust-std-1.85.0-i686-unknown-uefi.tar.gz=3473ecaea771fe436a02ec2a33c911a7ea12baf978fbeeb9fba4f26a7e5ca836 +dist/2025-02-20/rust-std-1.85.0-i686-unknown-uefi.tar.xz=4a1a3d8a6186a82ea863bdaff85efa848d5b90e57227ebfb49449cddd0edb9fe +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-linux-gnu.tar.gz=4f0637df4471678f8bf02b6f9c8ec39c570961d4420e3bbf14fd2f0e9978c5fe +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-linux-gnu.tar.xz=2d05f5e13e7cb3ee6b0ca0dcd13a231a28eeb0faa4d15257a35cf7284149cd6a +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-linux-musl.tar.gz=13e2eb2d2b8b77e26230ea9dc2b0a0391d145cb48179c3eebb23b7d1a65f73e4 +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-linux-musl.tar.xz=81fef91411161f3397cfcf6ffdca43e1d81a9bb87f8dfc5b7c7d36ceac252fc3 +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-none.tar.gz=f90deabe886b71a3895a53e2e7b1f0cfcd0325be4a7067ccf04b1f7052160ea1 +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-none.tar.xz=dc82cb74fb662394b9bad651275925cee4bec348fa0fd10da6003c4dc90062b8 +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-none-softfloat.tar.gz=c80635499182e17be6b41027f7a02ba890f3bd4be3f4f5f57a8e5aaff7ab08e4 +dist/2025-02-20/rust-std-1.85.0-loongarch64-unknown-none-softfloat.tar.xz=8047aa74db52e36a9ba61f1c4b645ee188d9de65f1ab8847ae7116983b8d7371 +dist/2025-02-20/rust-std-1.85.0-nvptx64-nvidia-cuda.tar.gz=b2abc98c3f267c292d6e787157b44ba1c7f1896b256ebe3e6ece3ef069569d71 +dist/2025-02-20/rust-std-1.85.0-nvptx64-nvidia-cuda.tar.xz=ed9c6a19659441fe400f8a0aef816376e5f44e4122e0c5f1ed635db1c3381f59 +dist/2025-02-20/rust-std-1.85.0-powerpc-unknown-linux-gnu.tar.gz=4f57e4a736d1fe7d83f28f12a640db34c7547857e7c06656a0d2832af62cada1 +dist/2025-02-20/rust-std-1.85.0-powerpc-unknown-linux-gnu.tar.xz=ab2d5ac7cd295adaa4d959e8abbf42b372292c95d1a9f18aad64951ad6e2ab2b +dist/2025-02-20/rust-std-1.85.0-powerpc64-unknown-linux-gnu.tar.gz=23db29e057a106d1ef42b88163a270ced8f00655e12bbad5afa09b3df78c2221 +dist/2025-02-20/rust-std-1.85.0-powerpc64-unknown-linux-gnu.tar.xz=e9ff89e759125ad2786ad2f6c40e820095720ea00fba66819d15fba79489430a +dist/2025-02-20/rust-std-1.85.0-powerpc64le-unknown-linux-gnu.tar.gz=d5fd78794560aa1f8b87ba84df1b00314a1bc3f28cefa69424511a52808ed4ba +dist/2025-02-20/rust-std-1.85.0-powerpc64le-unknown-linux-gnu.tar.xz=d0cfda4e18623d17922eb367e44ac9549ab3d5fe1c0bdbe0c2c95754255fa705 +dist/2025-02-20/rust-std-1.85.0-powerpc64le-unknown-linux-musl.tar.gz=7fe5daddab9eb7699921a2dc70776653242c768384803cec2c3e98dba6216cde +dist/2025-02-20/rust-std-1.85.0-powerpc64le-unknown-linux-musl.tar.xz=80ca77ab2db141361c452cfa8e67e35acfdc47f7eb16152dc6919c06c98672c9 +dist/2025-02-20/rust-std-1.85.0-riscv32i-unknown-none-elf.tar.gz=3d5a47158568a32af4f24e5c5b59e2f86eaf938d297b71a26a99e9430e4b2ec2 +dist/2025-02-20/rust-std-1.85.0-riscv32i-unknown-none-elf.tar.xz=45a0a8091d1bb3dd52016f8d309364751f0b0e9ffa7371d50dc615a45bd3aeff +dist/2025-02-20/rust-std-1.85.0-riscv32im-unknown-none-elf.tar.gz=57812db88203358c400e0179d290bb872ebc2fce765cc6a6034f2341dbde8560 +dist/2025-02-20/rust-std-1.85.0-riscv32im-unknown-none-elf.tar.xz=79c786553b2a5ab7b26c1eb7c133fa261e24ac7cb8779dc6151230a56ac3645d +dist/2025-02-20/rust-std-1.85.0-riscv32imac-unknown-none-elf.tar.gz=9dc3dfd891d7e8f093268b3f72e31e7d588fa9c691596c7015c14fedf970f54b +dist/2025-02-20/rust-std-1.85.0-riscv32imac-unknown-none-elf.tar.xz=8fa7ae172babc3aba8c754382bba2308be21cc42e355c20fc4e3f1b4297ae8d1 +dist/2025-02-20/rust-std-1.85.0-riscv32imafc-unknown-none-elf.tar.gz=ab7c40278ad1706767631269d2ea7724fa4d7fc7b87b2b07c91d17f31fdcc595 +dist/2025-02-20/rust-std-1.85.0-riscv32imafc-unknown-none-elf.tar.xz=0ca1baf0a6ecba03ffd8aa27509bec508b6372d49b0d659ff8737ac1f176e784 +dist/2025-02-20/rust-std-1.85.0-riscv32imc-unknown-none-elf.tar.gz=18a2270bd42dd5e846344056ff87f8b7ce5f9775798f2601df5d949e47e74819 +dist/2025-02-20/rust-std-1.85.0-riscv32imc-unknown-none-elf.tar.xz=2c9b448c7deaa75c08b661baeb38d5f750137fa4a0c854793b32ae8fc44e4a3e +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-linux-gnu.tar.gz=663607262f7e4efd0220e672a677c34c25ec5c551d405b254a02ee914a1279f1 +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-linux-gnu.tar.xz=0f5ecfe54859bbe715821f982b1a5396784fdf55605d00ece05d3e57a965ed16 +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-linux-musl.tar.gz=5c2a4cd3cd5b308a541266ec68e1532c5120d5a8f0c846ea832506dbff44a3ae +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-linux-musl.tar.xz=29333a22f6c2ffbfdaa2cdfdba15a3dc8a6ce46e25b3bcad964a9985e9f1cfe5 +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-none-elf.tar.gz=1876fd118ea0780fce5a6ddba46c255516e1c892e58aec935b575c4ad9d40e3c +dist/2025-02-20/rust-std-1.85.0-riscv64gc-unknown-none-elf.tar.xz=3e7ffb9b394f30e1f6cef7226399b1fed2345282ca48961b432620a7330759c0 +dist/2025-02-20/rust-std-1.85.0-riscv64imac-unknown-none-elf.tar.gz=b77b84b6c94f770e29ad6ecdeed89c352e331e7e9012d0d60ccee5c7708b61fc +dist/2025-02-20/rust-std-1.85.0-riscv64imac-unknown-none-elf.tar.xz=08294b7cf0623efe7c0528be381e46eb89542a1d68114d8bfa9c45e826561d43 +dist/2025-02-20/rust-std-1.85.0-s390x-unknown-linux-gnu.tar.gz=af3d8df97ea24a7f3231a63d5e7f80f7af77a91fd27e67c4d1a2eb8d3422c97f +dist/2025-02-20/rust-std-1.85.0-s390x-unknown-linux-gnu.tar.xz=d25053fbee1a0cb899bac8c8e4968aa35f9c3637e486cb5bb2c79ad43a78f3e7 +dist/2025-02-20/rust-std-1.85.0-sparc64-unknown-linux-gnu.tar.gz=ce70dc2c63fe8f04953cd3fd0220f530711d2386395a7353d60d857202917368 +dist/2025-02-20/rust-std-1.85.0-sparc64-unknown-linux-gnu.tar.xz=65cd47af46a5b74e61ff6ae4cce8a979ee8670a57b8aa61e732828d1da073f73 +dist/2025-02-20/rust-std-1.85.0-sparcv9-sun-solaris.tar.gz=661174eda8bd880e47219aaeb8500fa9a7e0b48b0b3a7b71f9f790e02b4ad477 +dist/2025-02-20/rust-std-1.85.0-sparcv9-sun-solaris.tar.xz=f59d3de4a799a21110e761c40225674097c94ee44a53c692d78a7a276f63da16 +dist/2025-02-20/rust-std-1.85.0-thumbv6m-none-eabi.tar.gz=68356705e1a1ad708f06320410a6c42aff0c6f8e241c93dcc5fa6838e92e5ab3 +dist/2025-02-20/rust-std-1.85.0-thumbv6m-none-eabi.tar.xz=d1f60466afb2bf9f0441cd84fddcf175b42ddb8d3c680f1235213f38b1ee2231 +dist/2025-02-20/rust-std-1.85.0-thumbv7em-none-eabi.tar.gz=a69708bbba2d45288e96b16313a0c41e599c8bd7a0821fe77e5adc374567a367 +dist/2025-02-20/rust-std-1.85.0-thumbv7em-none-eabi.tar.xz=bfa15789649cb5e39c4767112387f0dcf0d9797172464c89909a5aa08a0b4213 +dist/2025-02-20/rust-std-1.85.0-thumbv7em-none-eabihf.tar.gz=1c8f068caa4895f85e2adc01f439dc55449f5880aebbfcd83893a5ebfab38805 +dist/2025-02-20/rust-std-1.85.0-thumbv7em-none-eabihf.tar.xz=f7a099e8970295c1cfdb2f2bbbeee4305624d020908cd06f07708bb61ba1d3df +dist/2025-02-20/rust-std-1.85.0-thumbv7m-none-eabi.tar.gz=a64fddee82790b48649f821bf8168a266e892bdd06c28446e24faf65399b43fc +dist/2025-02-20/rust-std-1.85.0-thumbv7m-none-eabi.tar.xz=c8c375521f6a1ee358e8adde483cd14cfdac5d6a95e57ca80bd69afe8c5d21b6 +dist/2025-02-20/rust-std-1.85.0-thumbv7neon-linux-androideabi.tar.gz=c8629b589378b85d10e861ca1d76490a12d3e9e5b9faf70156eca0158c8aae85 +dist/2025-02-20/rust-std-1.85.0-thumbv7neon-linux-androideabi.tar.xz=425666f37a96b9c59a2ce54dbfbfeb866a63a602f16a5f051b75149b86e5806f +dist/2025-02-20/rust-std-1.85.0-thumbv7neon-unknown-linux-gnueabihf.tar.gz=9f5a01fe547b452bcc722f5b7364ec43b9e24ba40cc568524c5714bea5495897 +dist/2025-02-20/rust-std-1.85.0-thumbv7neon-unknown-linux-gnueabihf.tar.xz=77ca27672dcc2040a5ed53584d3e660f482981d77fd5ad842bb61a85225363d8 +dist/2025-02-20/rust-std-1.85.0-thumbv8m.base-none-eabi.tar.gz=92b49a2201f5c8bee8b31ba573d440ce89f8341ff32fe0b3bcb199ff1e7504f6 +dist/2025-02-20/rust-std-1.85.0-thumbv8m.base-none-eabi.tar.xz=c0a7313323fd472a4c5d48002ec0bc8e7c8d3306351e6aeaec98a145631c80e2 +dist/2025-02-20/rust-std-1.85.0-thumbv8m.main-none-eabi.tar.gz=28dbc9882f2c5d05685aa876d7cc899c1235584354e04a6a3aeb5b0682133972 +dist/2025-02-20/rust-std-1.85.0-thumbv8m.main-none-eabi.tar.xz=20a03a60a0c49b62dd5d24672558421207cfa68f1779b854e597b5a22a92bbfa +dist/2025-02-20/rust-std-1.85.0-thumbv8m.main-none-eabihf.tar.gz=fd0f0582c53ef0a0c7b516a035b863c5d6bc30d2c3ba2ed63c62836bf635e20d +dist/2025-02-20/rust-std-1.85.0-thumbv8m.main-none-eabihf.tar.xz=7559f7e109243bca91ed2e1f6659ebe1c01bc860df703bc80fd824357d4e08eb +dist/2025-02-20/rust-std-1.85.0-wasm32-unknown-emscripten.tar.gz=2ee5992e6b8118b9b112fce15c29294f276c07e7b977d9b17fc7bba6612eea5c +dist/2025-02-20/rust-std-1.85.0-wasm32-unknown-emscripten.tar.xz=db23b6d4a692465d4f3e748b50da63658cb9826edfbcb2ce4ec30a9a2f466099 +dist/2025-02-20/rust-std-1.85.0-wasm32-unknown-unknown.tar.gz=c1e19115a19b074d87d5652d959951b641ffa1512a9dee10964f0f7ee19cca3c +dist/2025-02-20/rust-std-1.85.0-wasm32-unknown-unknown.tar.xz=aff693dd50ffd905c2f381c7bc5ac7e71249ca8fe4ad9961be89ff9d4aaf1fd5 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip1.tar.gz=f0a10e69269543bf583c3a7cbe92ff098945cdff7b815b5021c29ea487b84ba4 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip1.tar.xz=fa1fad886c3abd76734deeeec3943d173548ac49aff9e7f3be5a9ed8754638e4 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip1-threads.tar.gz=be6246312b8d0c0e9e7280f4b42a13bd175686315adff11c02388819b4bee438 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip1-threads.tar.xz=6b9d5506212d12fcdcb081226aad216a96b80f5f8a581b75b30f0d89d46b6420 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip2.tar.gz=fd069a7d94d6f0ee0dec85ca2420ca013a7e0e42d1ab58bbeb15df0df2caf8f0 +dist/2025-02-20/rust-std-1.85.0-wasm32-wasip2.tar.xz=050fdf67e37f2d6df81badecd6772672b48104ef16ca182d70bde2db52ba1cdb +dist/2025-02-20/rust-std-1.85.0-wasm32v1-none.tar.gz=4b779605a3aa01d13c9fd8db60f9c7444db4c3bfe7eceb47d86982224494fe68 +dist/2025-02-20/rust-std-1.85.0-wasm32v1-none.tar.xz=a92e40bfb40a9ea476fd377c5fe76d0d72fc558dea584a244fc060c7370784f8 +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-darwin.tar.gz=18a5b48cf5bdca82acf51a12e1e2dbd05b13279b1859d014e46b56eb10f3922e +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-darwin.tar.xz=eefbc63670d44c3825962f7fdf8e00f256ff1f02e22504aba3562e25cea519ec +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-ios.tar.gz=9a775d008d9fc4bfcda2d1a890f15a428c2f64442ade8e6044f181de46c890c0 +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-ios.tar.xz=9b303795db4c0b43bddd00fbb04ec94a0b00ffe0244456405255c1e8a83067d9 +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-ios-macabi.tar.gz=119d00441d15f5639a40b298abb904d53db2e3fd8f7cb1a2b26897c90efd3bbb +dist/2025-02-20/rust-std-1.85.0-x86_64-apple-ios-macabi.tar.xz=2c8a3b59bf25e6e5ffbe806b57999303045fe190bb954e4fc4b826abc4ffda54 +dist/2025-02-20/rust-std-1.85.0-x86_64-fortanix-unknown-sgx.tar.gz=3b8f8868e5a9e4c61e4a261a10a2bb927423dd8497786a67cb34811657c1b47e +dist/2025-02-20/rust-std-1.85.0-x86_64-fortanix-unknown-sgx.tar.xz=da9b6622f7caf536ed5a41b5a6409d785eca8241227480860a442bf7b6b1b29b +dist/2025-02-20/rust-std-1.85.0-x86_64-linux-android.tar.gz=22fc8e48cf6fc74f6d0ab772ad58c3ba81f140a3780c17aa5f9e4f55bd4762b8 +dist/2025-02-20/rust-std-1.85.0-x86_64-linux-android.tar.xz=e1b00ff04850fbf42c642575bb0181f22cbdd82701ff2c43a6e34248bbcce168 +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-solaris.tar.gz=7c1b50402d14268a042df4ddf170f8fb8a1752234f5debcdb8d89532f034a9dc +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-solaris.tar.xz=60a5aa12ca481a8ad08b9e2574bc78ac27cd0abb5cfadd656e483da877cc0918 +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-gnu.tar.gz=fec898239dad3b3bc466f79a5370e6189c17977eff300f90367cf51fd083da3a +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-gnu.tar.xz=b33decf9770ddcf3ce924c9a6f42952df70d295129b9ab407831a5edd0c25deb +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-gnullvm.tar.gz=d5433f1da60900fe222da059e5ccfa1763873f41888f8cd10cd843fa6c23c313 +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-gnullvm.tar.xz=6e878063bcdcedd9ea98d4e64a2a455c731bc7486e0b9401d5de06cfa6bdff69 +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-msvc.tar.gz=afe8fbf37001f559cbddc7c786db50946d3f483f12a290115ee1ef8fff10a833 +dist/2025-02-20/rust-std-1.85.0-x86_64-pc-windows-msvc.tar.xz=7b1748506b97186b40485a7287709dae9efd399402b636e7301c5f91970d5c46 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-freebsd.tar.gz=ab61f7ce5f919e36bf04e201d83e977c422cf931811685c2f914395ff3b7d866 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-freebsd.tar.xz=f2718b6b864189dc6288a6dc1ada37c7dd08db43635971c5a8051cd05108f659 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-fuchsia.tar.gz=98e906a8061d7ab791ec8e4bd67b793c18c1abc48b80abb3d531c6ff8244332d +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-fuchsia.tar.xz=1fe8a8f3bff3fa255ad9e5d00467231644b25582b4796ed0a1583aefe7d135c2 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-illumos.tar.gz=23208234d99ce0ff1405f5bde3de45dd6340f800858b6dc8659ff77168c71e04 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-illumos.tar.xz=c87458ddb76051f1a71d3812fbf4185e41bca35aba9850cc0f4a1617adc45228 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-gnu.tar.gz=b3ad21966023d24fac039385201dc4109a2f25e6f7a0a5b2a0910eccfdc0c4a9 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-gnu.tar.xz=285e105d25ebdf501341238d4c0594ecdda50ec9078f45095f793a736b1f1ac2 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-gnux32.tar.gz=e09a6d6b3f5d9eaf59f914ac1c58c6bf2dd3ea3a72e99b1a7c3dfdef2b87185a +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-gnux32.tar.xz=8022d50df6cc4c1cb282c2b2ff50daa3fc15aa8399303a2e11d3aa55f6282499 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-musl.tar.gz=7f42d43feaf78ec253cc6bc82c4ab3f69f260db2b3bf987395e543a4d36004af +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-musl.tar.xz=27cebed8bafcb07c1c61a3dfc548efc3c032720d953375391896b664f8fe06f5 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-ohos.tar.gz=5edca1d4019feb96f58dc4e7e2b8fbf6e0db2a9a056b5357618d5b18eccaa4f6 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-linux-ohos.tar.xz=bcc955d35045e3804e75c869b8c5f8dfc68b64f6da106ba97809e2ffbafe0917 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-netbsd.tar.gz=ba990cdc32e4b323aef9fb02b8683ddc7aba6c233fcae9dfb6154121ccad2308 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-netbsd.tar.xz=2fcc5248b5a243fd392555df74c9af12affafef596a8b39a5ea50a6b7adadde5 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-none.tar.gz=40fd74f25645db1de63a30e27a38c058b3ef239d2ba2bd772287860b4985df79 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-none.tar.xz=e9692c507fe1d54bfe5d4c5cafbe92a31ab441f3b676ba99ded2600afbea3905 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-redox.tar.gz=78ec0efab89e1bfaae46f1c62d79f4a4ba333633e524613b4ef0d2ce447fb75e +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-redox.tar.xz=5018eb4a87ca1fbb695a2230873a062691570d7b4ac8a8b561328ec3f9d748f6 +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-uefi.tar.gz=b2e26191a0312a7fc5c27ec37b541a21b3d1cc67e0d9d105df4aabe735abd9fd +dist/2025-02-20/rust-std-1.85.0-x86_64-unknown-uefi.tar.xz=9b34ce41ca39309724ee17e7758e0eb3e0c9c92590e35455c92412daba063f0e +dist/2025-02-20/cargo-1.85.0-aarch64-apple-darwin.tar.gz=b280ffddaefd6ce6979390ccdadfbb222eebcb85d070286bff56c8fb016ada30 +dist/2025-02-20/cargo-1.85.0-aarch64-apple-darwin.tar.xz=d67766fb2e62214b3ee3faf01dcddddcb48e8d0483c2bb3475a16cb96210afed +dist/2025-02-20/cargo-1.85.0-aarch64-pc-windows-msvc.tar.gz=0c372f879fe4f091188b81ddf9d92b99068fa708b0b69d18fdb5b7cef3871440 +dist/2025-02-20/cargo-1.85.0-aarch64-pc-windows-msvc.tar.xz=c6d783396ccc8da0fb650d0d8984a5a36c17f963353653f1b3c665f88d50e704 +dist/2025-02-20/cargo-1.85.0-aarch64-unknown-linux-gnu.tar.gz=08fd45dd98dc1f60084e1156c0982e5f3d564a6da0d738f4a4a528c8f8dc8299 +dist/2025-02-20/cargo-1.85.0-aarch64-unknown-linux-gnu.tar.xz=cdebe48b066d512d664c13441e8fae2d0f67106c2080aa44289d98b24192b8bc +dist/2025-02-20/cargo-1.85.0-aarch64-unknown-linux-musl.tar.gz=9e6b80ed0c3d9d7faf1a5e1c7f6b970af7b4b89ef8034092dfc4a29d032a1cca +dist/2025-02-20/cargo-1.85.0-aarch64-unknown-linux-musl.tar.xz=4d3e2c4897af9e9bb1e77c7916fd0346eeb5bfe2fab3f9af9fe6858d93738284 +dist/2025-02-20/cargo-1.85.0-arm-unknown-linux-gnueabi.tar.gz=f33b98b7435916469637cab5acd1a1b63842837ffed2a3becabf11b1eedf1e85 +dist/2025-02-20/cargo-1.85.0-arm-unknown-linux-gnueabi.tar.xz=a154bc0f06572e915284ea395174618f2e07aadd577694af5a49bf14f82270cf +dist/2025-02-20/cargo-1.85.0-arm-unknown-linux-gnueabihf.tar.gz=785a4ec767c32bede6c30d8db46f43d1174a06a405965c8766af6a5bd5905f22 +dist/2025-02-20/cargo-1.85.0-arm-unknown-linux-gnueabihf.tar.xz=5fac5f8a65c3f1cf4f5e1d36237a3d6003d4c6704a3ef2aee333ce7a5b90f87e +dist/2025-02-20/cargo-1.85.0-armv7-unknown-linux-gnueabihf.tar.gz=d24807bd44e1259b37bbe05d62147883e136cded309ba5142983845b036d31e1 +dist/2025-02-20/cargo-1.85.0-armv7-unknown-linux-gnueabihf.tar.xz=1e697c548ef7db76e93ae94c828659570ea64ffc8b11a24dd8eb698b17a03b66 +dist/2025-02-20/cargo-1.85.0-i686-pc-windows-gnu.tar.gz=375b06b0b1c8fce033aabcd5ceb75ac7b3e5dfefc84f2bcdb52ef060b61ca976 +dist/2025-02-20/cargo-1.85.0-i686-pc-windows-gnu.tar.xz=210b9c0eaabd2fcf20c2f91f8cd8397b59c48431da6af0816fc0bd0fcb8edfc4 +dist/2025-02-20/cargo-1.85.0-i686-pc-windows-msvc.tar.gz=86f7d5301378e30fbb90c76ffb94f09717fc2cc1245aa271d2c923d2fd658c2c +dist/2025-02-20/cargo-1.85.0-i686-pc-windows-msvc.tar.xz=7e278a4813b2d2efa7eff450d96165aecdab37b231a270a768e9cbdc110f0536 +dist/2025-02-20/cargo-1.85.0-i686-unknown-linux-gnu.tar.gz=c6f9247e7f0029f516441048b188846506544962bd40f904de2b818666abcdee +dist/2025-02-20/cargo-1.85.0-i686-unknown-linux-gnu.tar.xz=3832027242911ab96fd86128587fc563596a5b10e8e38a073facf61c1ac9668f +dist/2025-02-20/cargo-1.85.0-loongarch64-unknown-linux-gnu.tar.gz=fdaac42ba66c52f6c3d510d24afd8d41cbdab3857a953620ebf6d3253e97d250 +dist/2025-02-20/cargo-1.85.0-loongarch64-unknown-linux-gnu.tar.xz=9aa447eefcd3ba2f9dbab77596c8669849899ab243543fc8f1914089707081ac +dist/2025-02-20/cargo-1.85.0-loongarch64-unknown-linux-musl.tar.gz=0e37a0463ca99614b1e11c2b008c99525103c354fb7d017d8b42ba8e148b07d3 +dist/2025-02-20/cargo-1.85.0-loongarch64-unknown-linux-musl.tar.xz=68db72051903d9b47021152386815b9e6109023a5ba93d2d3a46a79190734bdd +dist/2025-02-20/cargo-1.85.0-powerpc-unknown-linux-gnu.tar.gz=fc54791e15fa0f4fa73ad64f3249a4c02c6c0952d0f4387b98ad5435187add51 +dist/2025-02-20/cargo-1.85.0-powerpc-unknown-linux-gnu.tar.xz=e67c30a72f969c51ad199084b3ce0cdc573a4e21f732b2cc39dafbcb9807a5ce +dist/2025-02-20/cargo-1.85.0-powerpc64-unknown-linux-gnu.tar.gz=99f86675087fda0c18e9455ba8bf4c2986b157dca25a431810e234eba5d245e4 +dist/2025-02-20/cargo-1.85.0-powerpc64-unknown-linux-gnu.tar.xz=73cf850f6715acbf0029c7e5d4694825f61bd4e193e6413e65a78bcb13df97b7 +dist/2025-02-20/cargo-1.85.0-powerpc64le-unknown-linux-gnu.tar.gz=8cf1f5c86db16ea242bbe1fcdfdca9476882ee7de83224264af30acd6f5d3119 +dist/2025-02-20/cargo-1.85.0-powerpc64le-unknown-linux-gnu.tar.xz=e1469f4249a7e21f872af487dcd1bd10ce388b5b3679bdab0cb0965e1e30fe47 +dist/2025-02-20/cargo-1.85.0-powerpc64le-unknown-linux-musl.tar.gz=b3dbb13b2a3764b30c80ed6ef9ded5a028b4d42fcbfe14ef5ac294fc8e0a0800 +dist/2025-02-20/cargo-1.85.0-powerpc64le-unknown-linux-musl.tar.xz=757fa8229175ed926972bda045ce2f7ef5ec2fc8d1750f884a33db4b8accf9a9 +dist/2025-02-20/cargo-1.85.0-riscv64gc-unknown-linux-gnu.tar.gz=8373cd81bd12ee484aa19151f5369de7916a4d4ef7baf37f762f9287e5e9dce9 +dist/2025-02-20/cargo-1.85.0-riscv64gc-unknown-linux-gnu.tar.xz=c9f28b519799fc2d8089865e30fad04bb5339604d13725365fcd7ad7ee6c1489 +dist/2025-02-20/cargo-1.85.0-s390x-unknown-linux-gnu.tar.gz=3bc82baebf5e23c75ba9d0a16fe99a19f5ba1e74e921a55469539d8c92d7f8b7 +dist/2025-02-20/cargo-1.85.0-s390x-unknown-linux-gnu.tar.xz=7e1defd60095c91ded1612194f811ec5f2fc2e83bb914d35594d01fa3c54049d +dist/2025-02-20/cargo-1.85.0-x86_64-apple-darwin.tar.gz=05ecd058504cddf7458f2fc8ab9ebf3ae1a117359d242ae4275a22546d340ab8 +dist/2025-02-20/cargo-1.85.0-x86_64-apple-darwin.tar.xz=97cc257fe6a0c547e51b86011f0059a1904ac5e7abdf8f603ed86ec93cc4a9ac +dist/2025-02-20/cargo-1.85.0-x86_64-pc-windows-gnu.tar.gz=ef9aa0ef220d97fea37179a1568a363d8699c9a9ff3539993b9cbe473ef197ee +dist/2025-02-20/cargo-1.85.0-x86_64-pc-windows-gnu.tar.xz=89334a33ef88882a9f4c8ab92125fa27aefa52a4c93579f7121c6e952a7352ab +dist/2025-02-20/cargo-1.85.0-x86_64-pc-windows-msvc.tar.gz=f72df45faf7cbdb8868e4100d4562e59e9a7b2cba1f19039fdd0a3addf3de291 +dist/2025-02-20/cargo-1.85.0-x86_64-pc-windows-msvc.tar.xz=2e514d1840df05ec951ac3caf519a93a8ec40ac95b0371b4f6a7728a2713e07f +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-freebsd.tar.gz=b22b26302c52321be70f959d5059180468a6e43bee228e1f035a04e4e3632b10 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-freebsd.tar.xz=9931e39951dd2111d7c52ae5f1ef65a8e05063c6fa90150f1ec479eddd3d2ca8 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-illumos.tar.gz=575697f9dbb3591fea3ee55aa14a55f32232ca79eb46480a216f61b4ee8c5529 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-illumos.tar.xz=783d3a1435824613643ff5e9c0a216bea42ab0c85a0ca5780b19267b83bd80a5 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-linux-gnu.tar.gz=e27ffcafa0c7a8eee305085155530974ba62edf5278548ba6de4e0674f55c372 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-linux-gnu.tar.xz=0aff33b57b0e0b102d762a2b53042846c1ca346cff4b7bd96b5c03c9e8e51d81 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-linux-musl.tar.gz=e96c9199a63fc4967cb27f79d68974708d5b485778567288301705d48ee5edda +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-linux-musl.tar.xz=097bf46bb15bf8af3e33f7720fd14d6d02bbbf7dddcef926b773a52535c2c8a3 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-netbsd.tar.gz=d12b9d44046eca322e71eb644bf186afa951816fc3759cab94902741085fb450 +dist/2025-02-20/cargo-1.85.0-x86_64-unknown-netbsd.tar.xz=312e16ec06b512449fdbb136d280a5103db68c5e417cc90dc3575bcee2c17ec0 +dist/2025-02-20/clippy-1.85.0-aarch64-apple-darwin.tar.gz=668cb7689ac1b0f0b79d11c282e554e2706d9a4ba0455208064467ea956cbeec +dist/2025-02-20/clippy-1.85.0-aarch64-apple-darwin.tar.xz=62038ee7a541e78ebb34172eac2b8e458e00ecdf4f83bfbe204044c70d9a5e9c +dist/2025-02-20/clippy-1.85.0-aarch64-pc-windows-msvc.tar.gz=3f5af6dac7ed8ef3c29df2d4b4f6aa7519de55eb7dbe4bec4eaed835165d71fe +dist/2025-02-20/clippy-1.85.0-aarch64-pc-windows-msvc.tar.xz=7e1e17d402238c8219d4d99210a2a9fd5dd1033c8f855c0cfe6f46cbaae1051b +dist/2025-02-20/clippy-1.85.0-aarch64-unknown-linux-gnu.tar.gz=2f161d6bbb146766d00ea96b1e3143a3f50b28c3c7e1c99f4e5b11e2ff60c236 +dist/2025-02-20/clippy-1.85.0-aarch64-unknown-linux-gnu.tar.xz=f3b8e769021a6bcee8174ac49a60c367effb6d97af0f2a6c44dc9ea39ff2bda9 +dist/2025-02-20/clippy-1.85.0-aarch64-unknown-linux-musl.tar.gz=7c1c0457f56f90e69269f5fa1e98ee4ce19d364dd9a007ad6c06681b862c0df1 +dist/2025-02-20/clippy-1.85.0-aarch64-unknown-linux-musl.tar.xz=635dc1ae7fdb14dac9f8feab29dfd53ae1e168af939d88286390117427190cc9 +dist/2025-02-20/clippy-1.85.0-arm-unknown-linux-gnueabi.tar.gz=34d3e298c1efada6b6387f9cfaaeace82fb329de069f4c90ce63be0ed3cb5767 +dist/2025-02-20/clippy-1.85.0-arm-unknown-linux-gnueabi.tar.xz=5b719501f6ac1a1d9afdee0b6cdc89f60279d36519045fcc95d4b1adad22d068 +dist/2025-02-20/clippy-1.85.0-arm-unknown-linux-gnueabihf.tar.gz=7655de34fcc1d01f22fc5cc67a185f051dc3c60fb033dccb3b1df6e3956f78f2 +dist/2025-02-20/clippy-1.85.0-arm-unknown-linux-gnueabihf.tar.xz=06c24ea2e99a0a0b98828a09a3282bc8ecb3ac608f7feef0aff5bea7e79dc949 +dist/2025-02-20/clippy-1.85.0-armv7-unknown-linux-gnueabihf.tar.gz=23ea1d8c58e5e7300be464ef4aafa797539ad2a136782c8cf2a1e3b89887ac66 +dist/2025-02-20/clippy-1.85.0-armv7-unknown-linux-gnueabihf.tar.xz=69c6621aeb95f395f0c0f75a5b185d488a09ee356d803ad651f6d06bfdc2c791 +dist/2025-02-20/clippy-1.85.0-i686-pc-windows-gnu.tar.gz=560ccbafda99d36a6beff4a5188b1fdeeecdfc83ce4bc63ab3eb277380e2509c +dist/2025-02-20/clippy-1.85.0-i686-pc-windows-gnu.tar.xz=21278490f3fcbfe29b19f6b61af5a27c9c1413028a97957008c846757cd591f3 +dist/2025-02-20/clippy-1.85.0-i686-pc-windows-msvc.tar.gz=822fffc23696189e80bc935b9c641edc9d630541d96c4f92f9b0648c98763dcd +dist/2025-02-20/clippy-1.85.0-i686-pc-windows-msvc.tar.xz=73cfb1fb225d99f19f0de4964b08f89d07c758d5881278a4ba500210b0a48e3d +dist/2025-02-20/clippy-1.85.0-i686-unknown-linux-gnu.tar.gz=6dd37273efd01f42567bd9bedba601bf660b01212bea646c5c2a693cd61e9acf +dist/2025-02-20/clippy-1.85.0-i686-unknown-linux-gnu.tar.xz=74ed13a67c6ea0452c0d9e8697c6cfdd8280f983b207187ac93c287f72b65066 +dist/2025-02-20/clippy-1.85.0-loongarch64-unknown-linux-gnu.tar.gz=8bef98f745655ef12018629aa61cb071803eed253722690118a1f0536621dfcc +dist/2025-02-20/clippy-1.85.0-loongarch64-unknown-linux-gnu.tar.xz=d437b39465343a71ff475a65acb6c03bc0f800861f293f48accf1fa170458432 +dist/2025-02-20/clippy-1.85.0-loongarch64-unknown-linux-musl.tar.gz=bc081aaa4c5087580ce8694f519ad7b6c192027f286391aa7de95f33fd246d0c +dist/2025-02-20/clippy-1.85.0-loongarch64-unknown-linux-musl.tar.xz=ffbb28071420c67f3bf4d3a0281d5f562080428b134410f83a154f0379e28d37 +dist/2025-02-20/clippy-1.85.0-powerpc-unknown-linux-gnu.tar.gz=12d5314be59afd930ac8d126b93611e9ab15c888c29bc7550549343070bd4433 +dist/2025-02-20/clippy-1.85.0-powerpc-unknown-linux-gnu.tar.xz=497104d49803598cd3801749ac86cb26c88a2bd9c3a8c7bdc18fdf487f4650c0 +dist/2025-02-20/clippy-1.85.0-powerpc64-unknown-linux-gnu.tar.gz=32297424dd4d26ac7985cecb1f422dedcdbbc94d0f634d4fb82518869d73e5af +dist/2025-02-20/clippy-1.85.0-powerpc64-unknown-linux-gnu.tar.xz=29b63f23cd9af95846a246c9cc8349e514c3fb92ec0c840a38155e252d6cc668 +dist/2025-02-20/clippy-1.85.0-powerpc64le-unknown-linux-gnu.tar.gz=1886a72203b6e9e899cc2abbc6cf1484d54693ef4a7d40feff75dbb595844809 +dist/2025-02-20/clippy-1.85.0-powerpc64le-unknown-linux-gnu.tar.xz=d8c590bc2e6fc75800e41516427f5095ba0e15d7633167689499fcf6523dc61a +dist/2025-02-20/clippy-1.85.0-powerpc64le-unknown-linux-musl.tar.gz=fd97ce298255cfa614c77b31b2c9022d8d8e0bf717e26772c6cf9d0b8ca53afc +dist/2025-02-20/clippy-1.85.0-powerpc64le-unknown-linux-musl.tar.xz=7637e15037c9c3d3685b1cbcbe3239cc4ea83a5a463659f97c04978c25107a00 +dist/2025-02-20/clippy-1.85.0-riscv64gc-unknown-linux-gnu.tar.gz=ef5cc076acbf88ea155a03f0bb2707bf157a8d0d30c8ca74788ee0b1e691ee9c +dist/2025-02-20/clippy-1.85.0-riscv64gc-unknown-linux-gnu.tar.xz=9d21bc180196bccdb301e7e03034d3fd0df14b0c6520da0317bba7b1ce385fe8 +dist/2025-02-20/clippy-1.85.0-s390x-unknown-linux-gnu.tar.gz=ffa6794e85895515faec03ea97d6a24ba451bee8d0680260775cda1068ffdaa1 +dist/2025-02-20/clippy-1.85.0-s390x-unknown-linux-gnu.tar.xz=9780d8c4cfef9d05460b3e540aad142391b2e3994accf8cfc8afb87fefac6cf0 +dist/2025-02-20/clippy-1.85.0-x86_64-apple-darwin.tar.gz=4b72f007c94000378cdaf1664a0ddaf2cc0305dcd41efd7b11253197b5b65591 +dist/2025-02-20/clippy-1.85.0-x86_64-apple-darwin.tar.xz=76ce4f292195221fe1d5db9f3d38c55545d89ad79680b4cce9c59adf43d25e92 +dist/2025-02-20/clippy-1.85.0-x86_64-pc-windows-gnu.tar.gz=6446137f4478493139828f895c09d97f9c9f919a5b87433eb521095d2add2738 +dist/2025-02-20/clippy-1.85.0-x86_64-pc-windows-gnu.tar.xz=0b0ed376ae13d53341d74b396ced78e66009ed81380435e9e2b844fbc08932e9 +dist/2025-02-20/clippy-1.85.0-x86_64-pc-windows-msvc.tar.gz=8c5b9cdd5e01e1793bf7c8b4b0a4b80ef73573e3cd697b82f46322b7a7c129b0 +dist/2025-02-20/clippy-1.85.0-x86_64-pc-windows-msvc.tar.xz=401dd6c039b7bde98e0d9157c725e5b4085ece879a8bfa2275ca836381f332c3 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-freebsd.tar.gz=acd0da28c890b1e972b3063f57650cf23166d2e12e73addf767b2f6ed69c4c9f +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-freebsd.tar.xz=aa72807eaa3b841a672dc66d22a1c6646660b2e6e3ede26e106e79788d7f7d05 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-illumos.tar.gz=96ecd19e48db9b674250ba902baa2ca0a7b52f424b9011cf57c5acad4f0492d8 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-illumos.tar.xz=284d69f05e939f4c4dbc44bace07f8eaf28a3ea47582308eb30cc971a5bb0b23 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-linux-gnu.tar.gz=fe8fd47014b7c240e84d658057d1296c75f75717e00c58990871bb0fa8c1122c +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-linux-gnu.tar.xz=0dc3ca1708a6c9eed05d0802364377572b79ff079815b7bcbe8e3991f77c4117 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-linux-musl.tar.gz=9a7689e18454a2f27f4c472d22691d804dddc783a04eb86e2cd84318c9745604 +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-linux-musl.tar.xz=0dea1990c10352fdb8deeb15df887bc2740fdf0981ed0fb55951218fe01792ce +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-netbsd.tar.gz=724eb2da6a01984332eb838bc40beae6a264b8bea3cb823566f6b7f8e52d332d +dist/2025-02-20/clippy-1.85.0-x86_64-unknown-netbsd.tar.xz=4b5129defa661ec6161fc0838077a4ac280d37cb848e3e0b978e035b042214ed \ No newline at end of file From fc021746d5197107c690fabc7bbfb7f9a02801ec Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sun, 16 Feb 2025 21:13:01 +0100 Subject: [PATCH 05/64] Remove SSE ABI from i586-pc-windows-msvc As an i586 target, it should not have SSE. This caused the following warning to be emitted: ``` warning: target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly | = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #116344 warning: 1 warning emitted ``` (cherry picked from commit 1c66d5bed9e6444923c04937f5a28bfcec427ec0) --- compiler/rustc_target/src/spec/targets/i586_pc_windows_msvc.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_target/src/spec/targets/i586_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i586_pc_windows_msvc.rs index dd38f86bced2e..394e6f9e6bf65 100644 --- a/compiler/rustc_target/src/spec/targets/i586_pc_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/i586_pc_windows_msvc.rs @@ -2,6 +2,7 @@ use crate::spec::Target; pub(crate) fn target() -> Target { let mut base = super::i686_pc_windows_msvc::target(); + base.rustc_abi = None; // overwrite the SSE2 ABI set by the base target base.cpu = "pentium".into(); base.llvm_target = "i586-pc-windows-msvc".into(); base From 944862958c532950b9f4b0863c65e654c2dea73d Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 23 Feb 2025 22:30:42 -0500 Subject: [PATCH 06/64] [beta-1.86] Update cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index ce948f4616e3d..fcb465caf719e 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit ce948f4616e3d4277e30c75c8bb01e094910df39 +Subproject commit fcb465caf719e68f05671947db75a66ca7fadb2a From f8f8aeaef144610200d14b40ddc86d541a4e684d Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Fri, 14 Feb 2025 11:16:32 +0100 Subject: [PATCH 07/64] generate-copyright: pass the source root from bootstrap (cherry picked from commit 36c314cfb7999a66a49932822a336aea47f62292) --- src/bootstrap/src/core/build_steps/run.rs | 1 + src/tools/generate-copyright/src/main.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 167b8a5b168c9..84c94a268a38c 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -217,6 +217,7 @@ impl Step for GenerateCopyright { cmd.env("DEST", &dest); cmd.env("DEST_LIBSTD", &dest_libstd); cmd.env("OUT_DIR", &builder.out); + cmd.env("SRC_DIR", &builder.src); cmd.env("CARGO", &builder.initial_cargo); // it is important that generate-copyright runs from the root of the // source tree, because it uses relative paths diff --git a/src/tools/generate-copyright/src/main.rs b/src/tools/generate-copyright/src/main.rs index 7a014989e6880..677ac76439e88 100644 --- a/src/tools/generate-copyright/src/main.rs +++ b/src/tools/generate-copyright/src/main.rs @@ -18,6 +18,7 @@ fn main() -> Result<(), Error> { let dest_file = env_path("DEST")?; let libstd_dest_file = env_path("DEST_LIBSTD")?; let out_dir = env_path("OUT_DIR")?; + let src_dir = env_path("SRC_DIR")?; let cargo = env_path("CARGO")?; let license_metadata = env_path("LICENSE_METADATA")?; @@ -27,7 +28,7 @@ fn main() -> Result<(), Error> { let mut collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, &out_dir.join("vendor"), - &root_path, + &src_dir, &[ Path::new("./Cargo.toml"), Path::new("./src/tools/cargo/Cargo.toml"), @@ -38,7 +39,7 @@ fn main() -> Result<(), Error> { let library_collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, &out_dir.join("library-vendor"), - &root_path, + &src_dir, &[Path::new("./library/Cargo.toml")], )?; @@ -54,7 +55,7 @@ fn main() -> Result<(), Error> { let library_collected_tree_metadata = Metadata { files: collected_tree_metadata .files - .trim_clone(&Path::new("./library"), &Path::new(".")) + .trim_clone(&src_dir.join("library"), &src_dir) .unwrap(), }; From 27380b90c73b73de6fd6699743bcdbb12a4119a2 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Fri, 14 Feb 2025 11:16:47 +0100 Subject: [PATCH 08/64] generate-copyright: pass the list of manifests from bootstrap (cherry picked from commit 08b4f6d2c650d3e6e9010e8a27631962bf31dec7) --- src/bootstrap/src/core/build_steps/run.rs | 15 ++++++++ .../generate-copyright/src/cargo_metadata.rs | 6 ++-- src/tools/generate-copyright/src/main.rs | 35 +++++++++++++++---- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 84c94a268a38c..3f5e701e7e17a 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -9,6 +9,7 @@ use crate::Mode; use crate::core::build_steps::dist::distdir; use crate::core::build_steps::test; use crate::core::build_steps::tool::{self, SourceType, Tool}; +use crate::core::build_steps::vendor::default_paths_to_vendor; use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; use crate::core::config::flags::get_completion; @@ -212,7 +213,21 @@ impl Step for GenerateCopyright { let dest = builder.out.join("COPYRIGHT.html"); let dest_libstd = builder.out.join("COPYRIGHT-library.html"); + let paths_to_vendor = default_paths_to_vendor(builder); + for (_, submodules) in &paths_to_vendor { + for submodule in submodules { + builder.build.require_submodule(submodule, None); + } + } + let cargo_manifests = paths_to_vendor + .into_iter() + .map(|(path, _submodules)| path.to_str().unwrap().to_string()) + .inspect(|path| assert!(!path.contains(','), "{path} contains a comma in its name")) + .collect::>() + .join(","); + let mut cmd = builder.tool_cmd(Tool::GenerateCopyright); + cmd.env("CARGO_MANIFESTS", &cargo_manifests); cmd.env("LICENSE_METADATA", &license_metadata); cmd.env("DEST", &dest); cmd.env("DEST_LIBSTD", &dest_libstd); diff --git a/src/tools/generate-copyright/src/cargo_metadata.rs b/src/tools/generate-copyright/src/cargo_metadata.rs index 51e353e9b229f..16c5b5e7104e2 100644 --- a/src/tools/generate-copyright/src/cargo_metadata.rs +++ b/src/tools/generate-copyright/src/cargo_metadata.rs @@ -54,7 +54,7 @@ pub fn get_metadata_and_notices( cargo: &Path, vendor_path: &Path, root_path: &Path, - manifest_paths: &[&Path], + manifest_paths: &[PathBuf], ) -> Result, Error> { let mut output = get_metadata(cargo, root_path, manifest_paths)?; @@ -77,7 +77,7 @@ pub fn get_metadata_and_notices( pub fn get_metadata( cargo: &Path, root_path: &Path, - manifest_paths: &[&Path], + manifest_paths: &[PathBuf], ) -> Result, Error> { let mut output = BTreeMap::new(); // Look at the metadata for each manifest @@ -114,7 +114,7 @@ pub fn get_metadata( } /// Run cargo-vendor, fetching into the given dir -fn run_cargo_vendor(cargo: &Path, dest: &Path, manifest_paths: &[&Path]) -> Result<(), Error> { +fn run_cargo_vendor(cargo: &Path, dest: &Path, manifest_paths: &[PathBuf]) -> Result<(), Error> { let mut vendor_command = std::process::Command::new(cargo); vendor_command.env("RUSTC_BOOTSTRAP", "1"); vendor_command.arg("vendor"); diff --git a/src/tools/generate-copyright/src/main.rs b/src/tools/generate-copyright/src/main.rs index 677ac76439e88..7b7cf0f4b6991 100644 --- a/src/tools/generate-copyright/src/main.rs +++ b/src/tools/generate-copyright/src/main.rs @@ -22,25 +22,35 @@ fn main() -> Result<(), Error> { let cargo = env_path("CARGO")?; let license_metadata = env_path("LICENSE_METADATA")?; - let root_path = std::path::absolute(".")?; + let cargo_manifests = env_string("CARGO_MANIFESTS")? + .split(",") + .map(|manifest| manifest.into()) + .collect::>(); + let library_manifests = cargo_manifests + .iter() + .filter(|path| { + if let Ok(stripped) = path.strip_prefix(&src_dir) { + stripped.starts_with("library") + } else { + panic!("manifest {path:?} not relative to source dir {src_dir:?}"); + } + }) + .cloned() + .collect::>(); // Scan Cargo dependencies let mut collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, &out_dir.join("vendor"), &src_dir, - &[ - Path::new("./Cargo.toml"), - Path::new("./src/tools/cargo/Cargo.toml"), - Path::new("./library/Cargo.toml"), - ], + &cargo_manifests, )?; let library_collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, &out_dir.join("library-vendor"), &src_dir, - &[Path::new("./library/Cargo.toml")], + &library_manifests, )?; for (key, value) in collected_cargo_metadata.iter_mut() { @@ -194,6 +204,17 @@ struct License { copyright: Vec, } +/// Grab an environment variable as string, or fail nicely. +fn env_string(var: &str) -> Result { + match std::env::var(var) { + Ok(var) => Ok(var), + Err(std::env::VarError::NotUnicode(_)) => { + anyhow::bail!("environment variable {var} is not utf-8") + } + Err(std::env::VarError::NotPresent) => anyhow::bail!("missing environment variable {var}"), + } +} + /// Grab an environment variable as a PathBuf, or fail nicely. fn env_path(var: &str) -> Result { if let Some(var) = std::env::var_os(var) { From 9e285bac0b3a12145a54e2e425ffeb5726e56f88 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Mon, 17 Feb 2025 10:20:14 +0100 Subject: [PATCH 09/64] generate-copyright: pass the vendored sources from bootstrap (cherry picked from commit 33e7f9bc6681e32cc3b3b26ea85e21da225b89ee) --- src/bootstrap/src/core/build_steps/run.rs | 17 +++++++- src/bootstrap/src/core/build_steps/vendor.rs | 14 +++++-- src/bootstrap/src/core/builder/cargo.rs | 3 +- src/bootstrap/src/lib.rs | 7 ++++ .../generate-copyright/src/cargo_metadata.rs | 40 ++----------------- src/tools/generate-copyright/src/main.rs | 12 ++---- 6 files changed, 41 insertions(+), 52 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 3f5e701e7e17a..2b17e02cae5a4 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -9,7 +9,7 @@ use crate::Mode; use crate::core::build_steps::dist::distdir; use crate::core::build_steps::test; use crate::core::build_steps::tool::{self, SourceType, Tool}; -use crate::core::build_steps::vendor::default_paths_to_vendor; +use crate::core::build_steps::vendor::{Vendor, default_paths_to_vendor}; use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; use crate::core::config::flags::get_completion; @@ -226,13 +226,26 @@ impl Step for GenerateCopyright { .collect::>() .join(","); + let vendored_sources = if let Some(path) = builder.vendored_crates_path() { + path + } else { + let cache_dir = builder.out.join("tmp").join("generate-copyright-vendor"); + builder.ensure(Vendor { + sync_args: Vec::new(), + versioned_dirs: true, + root_dir: builder.src.clone(), + output_dir: cache_dir.clone(), + }); + cache_dir + }; + let mut cmd = builder.tool_cmd(Tool::GenerateCopyright); cmd.env("CARGO_MANIFESTS", &cargo_manifests); cmd.env("LICENSE_METADATA", &license_metadata); cmd.env("DEST", &dest); cmd.env("DEST_LIBSTD", &dest_libstd); - cmd.env("OUT_DIR", &builder.out); cmd.env("SRC_DIR", &builder.src); + cmd.env("VENDOR_DIR", &vendored_sources); cmd.env("CARGO", &builder.initial_cargo); // it is important that generate-copyright runs from the root of the // source tree, because it uses relative paths diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index 26d0f100ffd52..c68b55f358941 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -4,6 +4,8 @@ use crate::core::build_steps::tool::SUBMODULES_FOR_RUSTBOOK; use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; use crate::utils::exec::command; +pub const VENDOR_DIR: &str = "vendor"; + /// Returns the cargo workspaces to vendor for `x vendor` and dist tarballs. /// /// Returns a `Vec` of `(path_to_manifest, submodules_required)` where @@ -29,9 +31,10 @@ pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'sta #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub(crate) struct Vendor { - sync_args: Vec, - versioned_dirs: bool, - root_dir: PathBuf, + pub(crate) sync_args: Vec, + pub(crate) versioned_dirs: bool, + pub(crate) root_dir: PathBuf, + pub(crate) output_dir: PathBuf, } impl Step for Vendor { @@ -48,10 +51,13 @@ impl Step for Vendor { sync_args: run.builder.config.cmd.vendor_sync_args(), versioned_dirs: run.builder.config.cmd.vendor_versioned_dirs(), root_dir: run.builder.src.clone(), + output_dir: run.builder.src.join(VENDOR_DIR), }); } fn run(self, builder: &Builder<'_>) -> Self::Output { + builder.info(&format!("Vendoring sources to {:?}", self.root_dir)); + let mut cmd = command(&builder.initial_cargo); cmd.arg("vendor"); @@ -81,7 +87,7 @@ impl Step for Vendor { // which uses the unstable `public-dependency` feature. cmd.env("RUSTC_BOOTSTRAP", "1"); - cmd.current_dir(self.root_dir); + cmd.current_dir(self.root_dir).arg(&self.output_dir); cmd.run(builder); } diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 59680af00622f..1ec3e601cad19 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -924,8 +924,7 @@ impl Builder<'_> { if self.config.rust_remap_debuginfo { let mut env_var = OsString::new(); - if self.config.vendor { - let vendor = self.build.src.join("vendor"); + if let Some(vendor) = self.build.vendored_crates_path() { env_var.push(vendor); env_var.push("=/rust/deps"); } else { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 7cd8aacf0d6c8..e4a6e2b55e73d 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -50,6 +50,8 @@ pub use utils::change_tracker::{ CONFIG_CHANGE_HISTORY, find_recent_config_change_ids, human_readable_changes, }; +use crate::core::build_steps::vendor::VENDOR_DIR; + const LLVM_TOOLS: &[&str] = &[ "llvm-cov", // used to generate coverage report "llvm-nm", // used to inspect binaries; it shows symbol names, their sizes and visibility @@ -782,6 +784,11 @@ impl Build { self.out.join(target).join("md-doc") } + /// Path to the vendored Rust crates. + fn vendored_crates_path(&self) -> Option { + if self.config.vendor { Some(self.src.join(VENDOR_DIR)) } else { None } + } + /// Returns `true` if this is an external version of LLVM not managed by bootstrap. /// In particular, we expect llvm sources to be available when this is false. /// diff --git a/src/tools/generate-copyright/src/cargo_metadata.rs b/src/tools/generate-copyright/src/cargo_metadata.rs index 16c5b5e7104e2..b717bd53eb1a7 100644 --- a/src/tools/generate-copyright/src/cargo_metadata.rs +++ b/src/tools/generate-copyright/src/cargo_metadata.rs @@ -11,10 +11,6 @@ pub enum Error { Io(#[from] std::io::Error), #[error("Failed get output from cargo-metadata: {0:?}")] GettingMetadata(#[from] cargo_metadata::Error), - #[error("Failed to run cargo vendor: {0:?}")] - LaunchingVendor(std::io::Error), - #[error("Failed to complete cargo vendor")] - RunningVendor, #[error("Bad path {0:?} whilst scraping files")] Scraping(PathBuf), } @@ -43,13 +39,11 @@ pub struct PackageMetadata { pub is_in_libstd: Option, } -/// Use `cargo metadata` and `cargo vendor` to get a list of dependencies and their license data. +/// Use `cargo metadata` to get a list of dependencies and their license data. License files will +/// also be pulled from the vendor path (generated by bootstrap). /// -/// This will involve running `cargo vendor` into `vendor_path` so we can -/// grab the license files. -/// -/// Any dependency with a path beginning with `root_path` is ignored, as we -/// assume `reuse` has covered it already. +/// Any dependency with a path beginning with `root_path` is ignored, as we assume `reuse` has +/// covered it already. pub fn get_metadata_and_notices( cargo: &Path, vendor_path: &Path, @@ -58,10 +52,6 @@ pub fn get_metadata_and_notices( ) -> Result, Error> { let mut output = get_metadata(cargo, root_path, manifest_paths)?; - // Now do a cargo-vendor and grab everything - println!("Vendoring deps into {}...", vendor_path.display()); - run_cargo_vendor(cargo, &vendor_path, manifest_paths)?; - // Now for each dependency we found, go and grab any important looking files for (package, metadata) in output.iter_mut() { load_important_files(package, metadata, &vendor_path)?; @@ -113,28 +103,6 @@ pub fn get_metadata( Ok(output) } -/// Run cargo-vendor, fetching into the given dir -fn run_cargo_vendor(cargo: &Path, dest: &Path, manifest_paths: &[PathBuf]) -> Result<(), Error> { - let mut vendor_command = std::process::Command::new(cargo); - vendor_command.env("RUSTC_BOOTSTRAP", "1"); - vendor_command.arg("vendor"); - vendor_command.arg("--quiet"); - vendor_command.arg("--versioned-dirs"); - for manifest_path in manifest_paths { - vendor_command.arg("-s"); - vendor_command.arg(manifest_path); - } - vendor_command.arg(dest); - - let vendor_status = vendor_command.status().map_err(Error::LaunchingVendor)?; - - if !vendor_status.success() { - return Err(Error::RunningVendor); - } - - Ok(()) -} - /// Add important files off disk into this dependency. /// /// Maybe one-day Cargo.toml will contain enough information that we don't need diff --git a/src/tools/generate-copyright/src/main.rs b/src/tools/generate-copyright/src/main.rs index 7b7cf0f4b6991..79e90d88f4446 100644 --- a/src/tools/generate-copyright/src/main.rs +++ b/src/tools/generate-copyright/src/main.rs @@ -17,8 +17,8 @@ mod cargo_metadata; fn main() -> Result<(), Error> { let dest_file = env_path("DEST")?; let libstd_dest_file = env_path("DEST_LIBSTD")?; - let out_dir = env_path("OUT_DIR")?; let src_dir = env_path("SRC_DIR")?; + let vendor_dir = env_path("VENDOR_DIR")?; let cargo = env_path("CARGO")?; let license_metadata = env_path("LICENSE_METADATA")?; @@ -39,16 +39,12 @@ fn main() -> Result<(), Error> { .collect::>(); // Scan Cargo dependencies - let mut collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( - &cargo, - &out_dir.join("vendor"), - &src_dir, - &cargo_manifests, - )?; + let mut collected_cargo_metadata = + cargo_metadata::get_metadata_and_notices(&cargo, &vendor_dir, &src_dir, &cargo_manifests)?; let library_collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, - &out_dir.join("library-vendor"), + &vendor_dir, &src_dir, &library_manifests, )?; From 935005bf0a75dec0822788c6d308cfed2d5cb80a Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Mon, 17 Feb 2025 10:29:51 +0100 Subject: [PATCH 10/64] use the shared vendor impl for plan source tarballs (cherry picked from commit 92f31b95c92cb0a34413a52793a50c7d4334dbb2) --- src/bootstrap/src/core/build_steps/dist.rs | 28 +++++++------------- src/bootstrap/src/core/build_steps/vendor.rs | 10 +++++-- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index ae3761a97e50f..c33f11f684f4d 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -19,7 +19,7 @@ use object::read::archive::ArchiveFile; use crate::core::build_steps::doc::DocumentationFormat; use crate::core::build_steps::tool::{self, Tool}; -use crate::core::build_steps::vendor::default_paths_to_vendor; +use crate::core::build_steps::vendor::{VENDOR_DIR, Vendor}; use crate::core::build_steps::{compile, llvm}; use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; @@ -1050,19 +1050,6 @@ impl Step for PlainSourceTarball { if builder.config.dist_vendor { builder.require_and_update_all_submodules(); - // Vendor all Cargo dependencies - let mut cmd = command(&builder.initial_cargo); - cmd.arg("vendor").arg("--versioned-dirs"); - - for (p, _) in default_paths_to_vendor(builder) { - cmd.arg("--sync").arg(p); - } - - cmd - // Will read the libstd Cargo.toml which uses the unstable `public-dependency` feature. - .env("RUSTC_BOOTSTRAP", "1") - .current_dir(plain_dst_src); - // Vendor packages that are required by opt-dist to collect PGO profiles. let pkgs_for_pgo_training = build_helper::LLVM_PGO_CRATES .iter() @@ -1074,15 +1061,18 @@ impl Step for PlainSourceTarball { manifest_path.push("Cargo.toml"); manifest_path }); - for manifest_path in pkgs_for_pgo_training { - cmd.arg("--sync").arg(manifest_path); - } - let config = cmd.run_capture(builder).stdout(); + // Vendor all Cargo dependencies + let vendor = builder.ensure(Vendor { + sync_args: pkgs_for_pgo_training.collect(), + versioned_dirs: true, + root_dir: plain_dst_src.into(), + output_dir: VENDOR_DIR.into(), + }); let cargo_config_dir = plain_dst_src.join(".cargo"); builder.create_dir(&cargo_config_dir); - builder.create(&cargo_config_dir.join("config.toml"), &config); + builder.create(&cargo_config_dir.join("config.toml"), &vendor.config); } // Delete extraneous directories diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index c68b55f358941..410dbc04f0306 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -38,7 +38,7 @@ pub(crate) struct Vendor { } impl Step for Vendor { - type Output = (); + type Output = VendorOutput; const DEFAULT: bool = true; const ONLY_HOSTS: bool = true; @@ -89,6 +89,12 @@ impl Step for Vendor { cmd.current_dir(self.root_dir).arg(&self.output_dir); - cmd.run(builder); + let config = cmd.run_capture_stdout(builder); + VendorOutput { config: config.stdout() } } } + +#[derive(Debug, Clone)] +pub(crate) struct VendorOutput { + pub(crate) config: String, +} From f32d360dc77390cfd635fe7c5ab8fecb8e180bc4 Mon Sep 17 00:00:00 2001 From: Li Keqing Date: Wed, 19 Feb 2025 18:05:37 +0800 Subject: [PATCH 11/64] Fix `*-win7-windows-msvc` target since 26eeac1a1e9fe46ffd80dd0d3dafdd2c2a644306 (cherry picked from commit 35febd7a6d57179f41cb5b4a37f9545915e4d7a5) --- library/std/src/sys/pal/windows/c.rs | 4 ++-- library/std/src/sys/random/windows.rs | 2 +- library/std/src/sys/sync/mutex/windows7.rs | 2 +- library/std/src/sys/sync/thread_parking/windows7.rs | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 8dc61edb603f4..4fbdc839939c9 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -204,7 +204,7 @@ compat_fn_with_fallback! { pub fn NtReleaseKeyedEvent( EventHandle: HANDLE, Key: *const c_void, - Alertable: BOOLEAN, + Alertable: bool, Timeout: *mut i64 ) -> NTSTATUS { panic!("keyed events not available") @@ -213,7 +213,7 @@ compat_fn_with_fallback! { pub fn NtWaitForKeyedEvent( EventHandle: HANDLE, Key: *const c_void, - Alertable: BOOLEAN, + Alertable: bool, Timeout: *mut i64 ) -> NTSTATUS { panic!("keyed events not available") diff --git a/library/std/src/sys/random/windows.rs b/library/std/src/sys/random/windows.rs index 7566000f9e6ff..f5da637f56ca9 100644 --- a/library/std/src/sys/random/windows.rs +++ b/library/std/src/sys/random/windows.rs @@ -14,7 +14,7 @@ pub fn fill_bytes(mut bytes: &mut [u8]) { while !bytes.is_empty() { let len = bytes.len().try_into().unwrap_or(u32::MAX); let ret = unsafe { c::RtlGenRandom(bytes.as_mut_ptr().cast(), len) }; - assert_ne!(ret, 0, "failed to generate random data"); + assert!(ret, "failed to generate random data"); bytes = &mut bytes[len as usize..]; } } diff --git a/library/std/src/sys/sync/mutex/windows7.rs b/library/std/src/sys/sync/mutex/windows7.rs index 689dba10f01ed..0b57de78ba6dd 100644 --- a/library/std/src/sys/sync/mutex/windows7.rs +++ b/library/std/src/sys/sync/mutex/windows7.rs @@ -44,7 +44,7 @@ impl Mutex { #[inline] pub fn try_lock(&self) -> bool { - unsafe { c::TryAcquireSRWLockExclusive(raw(self)) != 0 } + unsafe { c::TryAcquireSRWLockExclusive(raw(self)) } } #[inline] diff --git a/library/std/src/sys/sync/thread_parking/windows7.rs b/library/std/src/sys/sync/thread_parking/windows7.rs index f7585e882f055..a1a0f8427cd83 100644 --- a/library/std/src/sys/sync/thread_parking/windows7.rs +++ b/library/std/src/sys/sync/thread_parking/windows7.rs @@ -195,7 +195,7 @@ mod keyed_events { pub unsafe fn park(parker: Pin<&Parker>) { // Wait for unpark() to produce this event. - c::NtWaitForKeyedEvent(keyed_event_handle(), parker.ptr(), 0, ptr::null_mut()); + c::NtWaitForKeyedEvent(keyed_event_handle(), parker.ptr(), false, ptr::null_mut()); // Set the state back to EMPTY (from either PARKED or NOTIFIED). // Note that we don't just write EMPTY, but use swap() to also // include an acquire-ordered read to synchronize with unpark()'s @@ -218,7 +218,7 @@ mod keyed_events { // Wait for unpark() to produce this event. let unparked = - c::NtWaitForKeyedEvent(handle, parker.ptr(), 0, &mut timeout) == c::STATUS_SUCCESS; + c::NtWaitForKeyedEvent(handle, parker.ptr(), false, &mut timeout) == c::STATUS_SUCCESS; // Set the state back to EMPTY (from either PARKED or NOTIFIED). let prev_state = parker.state.swap(EMPTY, Acquire); @@ -228,7 +228,7 @@ mod keyed_events { // was set to NOTIFIED, which means we *just* missed an // unpark(), which is now blocked on us to wait for it. // Wait for it to consume the event and unblock that thread. - c::NtWaitForKeyedEvent(handle, parker.ptr(), 0, ptr::null_mut()); + c::NtWaitForKeyedEvent(handle, parker.ptr(), false, ptr::null_mut()); } } pub unsafe fn unpark(parker: Pin<&Parker>) { @@ -239,7 +239,7 @@ mod keyed_events { // To prevent this thread from blocking indefinitely in that case, // park_impl() will, after seeing the state set to NOTIFIED after // waking up, call NtWaitForKeyedEvent again to unblock us. - c::NtReleaseKeyedEvent(keyed_event_handle(), parker.ptr(), 0, ptr::null_mut()); + c::NtReleaseKeyedEvent(keyed_event_handle(), parker.ptr(), false, ptr::null_mut()); } fn keyed_event_handle() -> c::HANDLE { From 4b9df12d34b775f85fbf0041940ff8abe4ffdeb2 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 20 Feb 2025 22:48:39 +0300 Subject: [PATCH 12/64] skip submodule updating logics on tarballs Signed-off-by: onur-ozkan (cherry picked from commit d2203ad59c67a6acb2968ea77e1e9dea5530e518) --- src/bootstrap/src/core/config/config.rs | 2 +- src/bootstrap/src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 62625fc3660f9..65f286a05bd5c 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2748,7 +2748,7 @@ impl Config { /// used instead to provide a nice error to the user if the submodule is /// missing. pub(crate) fn update_submodule(&self, relative_path: &str) { - if !self.submodules() { + if self.rust_info.is_from_tarball() || !self.submodules() { return; } diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index e4a6e2b55e73d..21b02a3b541a1 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -472,6 +472,10 @@ impl Build { /// The given `err_hint` will be shown to the user if the submodule is not /// checked out and submodule management is disabled. pub fn require_submodule(&self, submodule: &str, err_hint: Option<&str>) { + if self.rust_info().is_from_tarball() { + return; + } + // When testing bootstrap itself, it is much faster to ignore // submodules. Almost all Steps work fine without their submodules. if cfg!(test) && !self.config.submodules() { From fd12db26f29dbb2cb0ceaa0604a4ac0403ba9f11 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 22 Feb 2025 22:05:48 +0000 Subject: [PATCH 13/64] Improve behavior of IF_LET_RESCOPE around temporaries and place expressions (cherry picked from commit bab03bf1768fea8512ece42dea6d66f6f4743145) --- compiler/rustc_lint/src/if_let_rescope.rs | 140 ++++++++---------- .../lint-if-let-rescope-false-positives.rs | 29 ++++ 2 files changed, 92 insertions(+), 77 deletions(-) create mode 100644 tests/ui/drop/lint-if-let-rescope-false-positives.rs diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index 869dab6799d02..6e338356ddcbf 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -1,7 +1,7 @@ use std::iter::repeat; use std::ops::ControlFlow; -use hir::intravisit::Visitor; +use hir::intravisit::{self, Visitor}; use rustc_ast::Recovered; use rustc_errors::{ Applicability, Diag, EmissionGuarantee, SubdiagMessageOp, Subdiagnostic, SuggestionStyle, @@ -9,6 +9,7 @@ use rustc_errors::{ use rustc_hir::{self as hir, HirIdSet}; use rustc_macros::LintDiagnostic; use rustc_middle::ty::TyCtxt; +use rustc_middle::ty::adjustment::Adjust; use rustc_session::lint::{FutureIncompatibilityReason, LintId}; use rustc_session::{declare_lint, impl_lint_pass}; use rustc_span::Span; @@ -160,7 +161,7 @@ impl IfLetRescope { let lifetime_end = source_map.end_point(conseq.span); if let ControlFlow::Break(significant_dropper) = - (FindSignificantDropper { cx }).visit_expr(init) + (FindSignificantDropper { cx }).check_if_let_scrutinee(init) { first_if_to_lint = first_if_to_lint.or_else(|| Some((span, expr.hir_id))); significant_droppers.push(significant_dropper); @@ -363,96 +364,81 @@ enum SingleArmMatchBegin { WithoutOpenBracket(Span), } -struct FindSignificantDropper<'tcx, 'a> { +struct FindSignificantDropper<'a, 'tcx> { cx: &'a LateContext<'tcx>, } -impl<'tcx, 'a> Visitor<'tcx> for FindSignificantDropper<'tcx, 'a> { - type Result = ControlFlow; +impl<'tcx> FindSignificantDropper<'_, 'tcx> { + fn check_if_let_scrutinee(&mut self, init: &'tcx hir::Expr<'tcx>) -> ControlFlow { + self.check_promoted_temp_with_drop(init)?; + self.visit_expr(init) + } - fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) -> Self::Result { - if self + // Check that an expression is not a promoted temporary with a significant + // drop impl. + // + // An expression is a promoted temporary if it has an addr taken (i.e. `&expr`) + // or is the scrutinee of the `if let`, *and* the expression is not a place + // expr, and it has a significant drop. + fn check_promoted_temp_with_drop(&self, expr: &'tcx hir::Expr<'tcx>) -> ControlFlow { + if !expr.is_place_expr(|base| { + self.cx + .typeck_results() + .adjustments() + .get(base.hir_id) + .is_some_and(|x| x.iter().any(|adj| matches!(adj.kind, Adjust::Deref(_)))) + }) && self .cx .typeck_results() .expr_ty(expr) .has_significant_drop(self.cx.tcx, self.cx.typing_env()) { - return ControlFlow::Break(expr.span); + ControlFlow::Break(expr.span) + } else { + ControlFlow::Continue(()) } - match expr.kind { - hir::ExprKind::ConstBlock(_) - | hir::ExprKind::Lit(_) - | hir::ExprKind::Path(_) - | hir::ExprKind::Assign(_, _, _) - | hir::ExprKind::AssignOp(_, _, _) - | hir::ExprKind::Break(_, _) - | hir::ExprKind::Continue(_) - | hir::ExprKind::Ret(_) - | hir::ExprKind::Become(_) - | hir::ExprKind::InlineAsm(_) - | hir::ExprKind::OffsetOf(_, _) - | hir::ExprKind::Repeat(_, _) - | hir::ExprKind::Err(_) - | hir::ExprKind::Struct(_, _, _) - | hir::ExprKind::Closure(_) - | hir::ExprKind::Block(_, _) - | hir::ExprKind::DropTemps(_) - | hir::ExprKind::Loop(_, _, _, _) => ControlFlow::Continue(()), + } +} - hir::ExprKind::Tup(exprs) | hir::ExprKind::Array(exprs) => { - for expr in exprs { - self.visit_expr(expr)?; - } - ControlFlow::Continue(()) - } - hir::ExprKind::Call(callee, args) => { - self.visit_expr(callee)?; - for expr in args { - self.visit_expr(expr)?; - } - ControlFlow::Continue(()) - } - hir::ExprKind::MethodCall(_, receiver, args, _) => { - self.visit_expr(receiver)?; - for expr in args { - self.visit_expr(expr)?; +impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { + type Result = ControlFlow; + + fn visit_block(&mut self, b: &'tcx hir::Block<'tcx>) -> Self::Result { + // Blocks introduce temporary terminating scope for all of its + // statements, so just visit the tail expr. + if let Some(expr) = b.expr { self.visit_expr(expr) } else { ControlFlow::Continue(()) } + } + + fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) -> Self::Result { + // Check for promoted temporaries from autoref, e.g. + // `if let None = TypeWithDrop.as_ref() {} else {}` + // where `fn as_ref(&self) -> Option<...>`. + for adj in self.cx.typeck_results().expr_adjustments(expr) { + match adj.kind { + Adjust::Deref(_) => break, + Adjust::Borrow(_) => { + self.check_promoted_temp_with_drop(expr)?; } - ControlFlow::Continue(()) - } - hir::ExprKind::Index(left, right, _) | hir::ExprKind::Binary(_, left, right) => { - self.visit_expr(left)?; - self.visit_expr(right) + _ => {} } - hir::ExprKind::Unary(_, expr) - | hir::ExprKind::Cast(expr, _) - | hir::ExprKind::Type(expr, _) - | hir::ExprKind::UnsafeBinderCast(_, expr, _) - | hir::ExprKind::Yield(expr, _) - | hir::ExprKind::AddrOf(_, _, expr) - | hir::ExprKind::Match(expr, _, _) - | hir::ExprKind::Field(expr, _) - | hir::ExprKind::Let(&hir::LetExpr { - init: expr, - span: _, - pat: _, - ty: _, - recovered: Recovered::No, - }) => self.visit_expr(expr), - hir::ExprKind::Let(_) => ControlFlow::Continue(()), + } - hir::ExprKind::If(cond, _, _) => { - if let hir::ExprKind::Let(hir::LetExpr { - init, - span: _, - pat: _, - ty: _, - recovered: Recovered::No, - }) = cond.kind - { - self.visit_expr(init)?; - } - ControlFlow::Continue(()) + match expr.kind { + // Check for cases like `if let None = Some(&Drop) {} else {}`. + hir::ExprKind::AddrOf(_, _, expr) => { + self.check_promoted_temp_with_drop(expr)?; + intravisit::walk_expr(self, expr) } + // If always introduces a temporary terminating scope for its cond and arms, + // so don't visit them. + hir::ExprKind::If(..) => ControlFlow::Continue(()), + // Match introduces temporary terminating scopes for arms, so don't visit + // them, and only visit the scrutinee to account for cases like: + // `if let None = match &Drop { _ => Some(1) } {} else {}`. + hir::ExprKind::Match(scrut, _, _) => self.visit_expr(scrut), + // Self explanatory. + hir::ExprKind::DropTemps(_) => ControlFlow::Continue(()), + _ => intravisit::walk_expr(self, expr), } } } diff --git a/tests/ui/drop/lint-if-let-rescope-false-positives.rs b/tests/ui/drop/lint-if-let-rescope-false-positives.rs new file mode 100644 index 0000000000000..533d0f2f982b3 --- /dev/null +++ b/tests/ui/drop/lint-if-let-rescope-false-positives.rs @@ -0,0 +1,29 @@ +//@ edition: 2021 +//@ check-pass + +#![deny(if_let_rescope)] + +struct Drop; +impl std::ops::Drop for Drop { + fn drop(&mut self) { + println!("drop") + } +} + +impl Drop { + fn as_ref(&self) -> Option { + Some(1) + } +} + +fn consume(_: impl Sized) -> Option { Some(1) } + +fn main() { + let drop = Drop; + + // Make sure we don't drop if we don't actually make a temporary. + if let None = drop.as_ref() {} else {} + + // Make sure we don't lint if we consume the droppy value. + if let None = consume(Drop) {} else {} +} From 0180dd9a5aa1f1c75454ea12071be47b6c0c7d36 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 22 Feb 2025 22:13:23 +0000 Subject: [PATCH 14/64] More comments (cherry picked from commit 2797936f6dcd29777f236a5d966d487a7f4cbbb3) --- compiler/rustc_lint/src/if_let_rescope.rs | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index 6e338356ddcbf..10e052dbfb008 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -369,17 +369,22 @@ struct FindSignificantDropper<'a, 'tcx> { } impl<'tcx> FindSignificantDropper<'_, 'tcx> { + /// Check the scrutinee of an `if let` to see if it promotes any temporary values + /// that would change drop order in edition 2024. Specifically, it checks the value + /// of the scrutinee itself, and also recurses into the expression to find any ref + /// exprs (or autoref) which would promote temporaries that would be scoped to the + /// end of this `if`. fn check_if_let_scrutinee(&mut self, init: &'tcx hir::Expr<'tcx>) -> ControlFlow { self.check_promoted_temp_with_drop(init)?; self.visit_expr(init) } - // Check that an expression is not a promoted temporary with a significant - // drop impl. - // - // An expression is a promoted temporary if it has an addr taken (i.e. `&expr`) - // or is the scrutinee of the `if let`, *and* the expression is not a place - // expr, and it has a significant drop. + /// Check that an expression is not a promoted temporary with a significant + /// drop impl. + /// + /// An expression is a promoted temporary if it has an addr taken (i.e. `&expr` or autoref) + /// or is the scrutinee of the `if let`, *and* the expression is not a place + /// expr, and it has a significant drop. fn check_promoted_temp_with_drop(&self, expr: &'tcx hir::Expr<'tcx>) -> ControlFlow { if !expr.is_place_expr(|base| { self.cx @@ -405,7 +410,8 @@ impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { fn visit_block(&mut self, b: &'tcx hir::Block<'tcx>) -> Self::Result { // Blocks introduce temporary terminating scope for all of its - // statements, so just visit the tail expr. + // statements, so just visit the tail expr, skipping over any + // statements. This prevents false positives like `{ let x = &Drop; }`. if let Some(expr) = b.expr { self.visit_expr(expr) } else { ControlFlow::Continue(()) } } @@ -415,6 +421,7 @@ impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { // where `fn as_ref(&self) -> Option<...>`. for adj in self.cx.typeck_results().expr_adjustments(expr) { match adj.kind { + // Skip when we hit the first deref expr. Adjust::Deref(_) => break, Adjust::Borrow(_) => { self.check_promoted_temp_with_drop(expr)?; @@ -424,7 +431,7 @@ impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { } match expr.kind { - // Check for cases like `if let None = Some(&Drop) {} else {}`. + // Account for cases like `if let None = Some(&Drop) {} else {}`. hir::ExprKind::AddrOf(_, _, expr) => { self.check_promoted_temp_with_drop(expr)?; intravisit::walk_expr(self, expr) @@ -438,6 +445,7 @@ impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { hir::ExprKind::Match(scrut, _, _) => self.visit_expr(scrut), // Self explanatory. hir::ExprKind::DropTemps(_) => ControlFlow::Continue(()), + // Otherwise, walk into the expr's parts. _ => intravisit::walk_expr(self, expr), } } From f54fe46cec0bdee2289577e8f323b3d049120710 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 23 Feb 2025 01:09:51 +0000 Subject: [PATCH 15/64] Consider lvalues of field and index as possibly temporary places (cherry picked from commit bad8e98c7d0ed217b58362e61ae4357e5344d995) --- compiler/rustc_lint/src/if_let_rescope.rs | 8 +++++++ .../lint-if-let-rescope-false-positives.rs | 4 ++++ tests/ui/drop/lint-if-let-rescope.fixed | 6 +++++ tests/ui/drop/lint-if-let-rescope.rs | 6 +++++ tests/ui/drop/lint-if-let-rescope.stderr | 23 ++++++++++++++++++- 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index 10e052dbfb008..297559f012832 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -436,6 +436,14 @@ impl<'tcx> Visitor<'tcx> for FindSignificantDropper<'_, 'tcx> { self.check_promoted_temp_with_drop(expr)?; intravisit::walk_expr(self, expr) } + // `(Drop, ()).1` introduces a temporary and then moves out of + // part of it, therefore we should check it for temporaries. + // FIXME: This may have false positives if we move the part + // that actually has drop, but oh well. + hir::ExprKind::Index(expr, _, _) | hir::ExprKind::Field(expr, _) => { + self.check_promoted_temp_with_drop(expr)?; + intravisit::walk_expr(self, expr) + } // If always introduces a temporary terminating scope for its cond and arms, // so don't visit them. hir::ExprKind::If(..) => ControlFlow::Continue(()), diff --git a/tests/ui/drop/lint-if-let-rescope-false-positives.rs b/tests/ui/drop/lint-if-let-rescope-false-positives.rs index 533d0f2f982b3..77b7df4bc3bab 100644 --- a/tests/ui/drop/lint-if-let-rescope-false-positives.rs +++ b/tests/ui/drop/lint-if-let-rescope-false-positives.rs @@ -26,4 +26,8 @@ fn main() { // Make sure we don't lint if we consume the droppy value. if let None = consume(Drop) {} else {} + + // Make sure we don't lint on field exprs of place exprs. + let tup_place = (Drop, ()); + if let None = consume(tup_place.1) {} else {} } diff --git a/tests/ui/drop/lint-if-let-rescope.fixed b/tests/ui/drop/lint-if-let-rescope.fixed index 182190aa323bc..79858e6f225aa 100644 --- a/tests/ui/drop/lint-if-let-rescope.fixed +++ b/tests/ui/drop/lint-if-let-rescope.fixed @@ -94,6 +94,12 @@ fn main() { //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 } + match Some((droppy(), ()).1) { Some(_value) => {} _ => {}} + //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN: this changes meaning in Rust 2024 + //~| HELP: the value is now dropped here in Edition 2024 + //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + // We want to keep the `if let`s below as direct descendents of match arms, // so the formatting is suppressed. #[rustfmt::skip] diff --git a/tests/ui/drop/lint-if-let-rescope.rs b/tests/ui/drop/lint-if-let-rescope.rs index e1b38be0a0f50..9d873c65426f6 100644 --- a/tests/ui/drop/lint-if-let-rescope.rs +++ b/tests/ui/drop/lint-if-let-rescope.rs @@ -94,6 +94,12 @@ fn main() { //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 } + if let Some(_value) = Some((droppy(), ()).1) {} else {} + //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN: this changes meaning in Rust 2024 + //~| HELP: the value is now dropped here in Edition 2024 + //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + // We want to keep the `if let`s below as direct descendents of match arms, // so the formatting is suppressed. #[rustfmt::skip] diff --git a/tests/ui/drop/lint-if-let-rescope.stderr b/tests/ui/drop/lint-if-let-rescope.stderr index 2b0fcb7a938a6..b17239976cc0d 100644 --- a/tests/ui/drop/lint-if-let-rescope.stderr +++ b/tests/ui/drop/lint-if-let-rescope.stderr @@ -175,5 +175,26 @@ LL - while (if let Some(_value) = droppy().get() { false } else { true }) { LL + while (match droppy().get() { Some(_value) => { false } _ => { true }}) { | -error: aborting due to 7 previous errors +error: `if let` assigns a shorter lifetime since Edition 2024 + --> $DIR/lint-if-let-rescope.rs:97:8 + | +LL | if let Some(_value) = Some((droppy(), ()).1) {} else {} + | ^^^^^^^^^^^^^^^^^^^^^^^^--------------^^^ + | | + | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion + | + = warning: this changes meaning in Rust 2024 + = note: for more information, see +help: the value is now dropped here in Edition 2024 + --> $DIR/lint-if-let-rescope.rs:97:51 + | +LL | if let Some(_value) = Some((droppy(), ()).1) {} else {} + | ^ +help: a `match` with a single arm can preserve the drop order up to Edition 2021 + | +LL - if let Some(_value) = Some((droppy(), ()).1) {} else {} +LL + match Some((droppy(), ()).1) { Some(_value) => {} _ => {}} + | + +error: aborting due to 8 previous errors From 86e362f0a4c11dcd1fff4a949b4ea8eaaedceea1 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 23 Feb 2025 08:23:51 +0300 Subject: [PATCH 16/64] downgrade bootstrap `cc` Signed-off-by: onur-ozkan (cherry picked from commit e4ca11f87ffca8c63aa56d45b46e62b6acc58bd7) --- src/bootstrap/Cargo.lock | 4 ++-- src/bootstrap/Cargo.toml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index a47f3af60cbd5..890e64e2babbc 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.0" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" +checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" dependencies = [ "shlex", ] diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index ed51862390d40..2c1d85b01e6af 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -37,7 +37,9 @@ test = false # Most of the time updating these dependencies requires modifications to the # bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565); # otherwise, some targets will fail. That's why these dependencies are explicitly pinned. -cc = "=1.2.0" +# +# Do not upgrade this crate unless https://github.com/rust-lang/cc-rs/issues/1317 is fixed. +cc = "=1.1.22" cmake = "=0.1.48" build_helper = { path = "../build_helper" } From 4f0b4a42e4e8a905f1531fcc7bbba94df13d2a33 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 27 Feb 2025 21:50:30 +0000 Subject: [PATCH 17/64] Remove Win SDK 10.0.26100.0 from CI (cherry picked from commit 25617c7e695d716d0ecb3cf2366d371441505e47) --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0934e42b277e4..1c11984742107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,6 +173,20 @@ jobs: - name: ensure the stable version number is correct run: src/ci/scripts/verify-stable-version-number.sh + # Temporary fix to unblock CI + # Remove the latest Windows SDK for 32-bit Windows MSVC builds. + # See issue https://github.com/rust-lang/rust/issues/137733 for more details. + - name: Remove Windows SDK 10.0.26100.0 + shell: powershell + if: ${{ matrix.name == 'i686-msvc-1' || matrix.name == 'i686-msvc-2' || matrix.name == 'dist-i686-msvc' }} + run: | + $kits = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots').KitsRoot10 + $sdk_version = "10.0.26100.0" + + foreach ($kind in 'Bin', 'Lib', 'Include') { + Remove-Item -Force -Recurse $kits\$kind\$sdk_version -ErrorAction Continue + } + - name: run the build # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs. run: src/ci/scripts/run-build-from-ci.sh 2>&1 From 4746aaf1745378051dbb9e48d633fe3f252a19e7 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sat, 1 Mar 2025 00:08:57 -0500 Subject: [PATCH 18/64] [beta-1.86] Update cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index fcb465caf719e..adf9b6ad14cfa 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit fcb465caf719e68f05671947db75a66ca7fadb2a +Subproject commit adf9b6ad14cfa10ff680d5806741a144f7163698 From 98ec2473879a1c9456116cb1b4c9caef793c8c1d Mon Sep 17 00:00:00 2001 From: DianQK Date: Wed, 26 Feb 2025 19:54:34 +0800 Subject: [PATCH 19/64] Add a test case for #137646 (cherry picked from commit 28d3fef3991d52cf7bf3908944191d86b487a815) --- tests/ui/virtual-call-attrs-issue-137646.rs | 47 +++++++++++++++++++ ...virtual-call-attrs-issue-137646.run.stderr | 20 ++++++++ 2 files changed, 67 insertions(+) create mode 100644 tests/ui/virtual-call-attrs-issue-137646.rs create mode 100644 tests/ui/virtual-call-attrs-issue-137646.run.stderr diff --git a/tests/ui/virtual-call-attrs-issue-137646.rs b/tests/ui/virtual-call-attrs-issue-137646.rs new file mode 100644 index 0000000000000..055dc6ea4f2dc --- /dev/null +++ b/tests/ui/virtual-call-attrs-issue-137646.rs @@ -0,0 +1,47 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/137646. +//! FIXME: The parameter value at all calls to `check` should be `(1, 1, 1)`. + +//@ run-pass +//@ check-run-results + +use std::hint::black_box; + +type T = (i32, i32, i32); + +pub trait Trait { + fn m(&self, _: T, _: T) {} +} + +impl Trait for () { + fn m(&self, mut _v1: T, v2: T) { + _v1 = (0, 0, 0); + check(v2); + } +} + +pub fn run_1(trait_: &dyn Trait) { + let v1 = (1, 1, 1); + let v2 = (1, 1, 1); + trait_.m(v1, v2); +} + +pub fn run_2(trait_: &dyn Trait) { + let v1 = (1, 1, 1); + let v2 = (1, 1, 1); + trait_.m(v1, v2); + check(v1); + check(v2); +} + +#[inline(never)] +fn check(v: T) { + dbg!(v); + // assert_eq!(v, (1, 1, 1)); +} + +fn main() { + black_box(run_1 as fn(&dyn Trait)); + black_box(run_2 as fn(&dyn Trait)); + run_1(&()); + run_2(&()); +} diff --git a/tests/ui/virtual-call-attrs-issue-137646.run.stderr b/tests/ui/virtual-call-attrs-issue-137646.run.stderr new file mode 100644 index 0000000000000..445975e1e54e6 --- /dev/null +++ b/tests/ui/virtual-call-attrs-issue-137646.run.stderr @@ -0,0 +1,20 @@ +[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( + 498486832, + 22093, + 498491440, +) +[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( + 0, + 0, + 0, +) +[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( + 0, + 0, + 0, +) +[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( + 0, + 0, + 0, +) From 8f9c7df8e6fe5510dfd8a5a5e4a94ec822871629 Mon Sep 17 00:00:00 2001 From: DianQK Date: Wed, 26 Feb 2025 19:54:34 +0800 Subject: [PATCH 20/64] Don't infer attributes of virtual calls based on the function body (cherry picked from commit 8089fce101f4ac2ed68c8df080c61102b0210429) --- compiler/rustc_middle/src/ty/instance.rs | 5 +- compiler/rustc_ty_utils/src/abi.rs | 63 +++++++++---------- .../virtual-call-attrs-issue-137646.rs | 18 ++++++ tests/ui/virtual-call-attrs-issue-137646.rs | 6 +- ...virtual-call-attrs-issue-137646.run.stderr | 20 ------ 5 files changed, 52 insertions(+), 60 deletions(-) create mode 100644 tests/codegen/virtual-call-attrs-issue-137646.rs delete mode 100644 tests/ui/virtual-call-attrs-issue-137646.run.stderr diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index e9c19331e4a0b..98ca71b86be07 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -111,8 +111,9 @@ pub enum InstanceKind<'tcx> { /// Dynamic dispatch to `::fn`. /// - /// This `InstanceKind` does not have callable MIR. Calls to `Virtual` instances must be - /// codegen'd as virtual calls through the vtable. + /// This `InstanceKind` may have a callable MIR as the default implementation. + /// Calls to `Virtual` instances must be codegen'd as virtual calls through the vtable. + /// *This means we might not know exactly what is being called.* /// /// If this is reified to a `fn` pointer, a `ReifyShim` is used (see `ReifyShim` above for more /// details on that). diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index c5d2d0afbfad2..cb9475e7d5ddf 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -309,15 +309,11 @@ fn fn_abi_of_fn_ptr<'tcx>( query: ty::PseudoCanonicalInput<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List>)>, ) -> Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, &'tcx FnAbiError<'tcx>> { let ty::PseudoCanonicalInput { typing_env, value: (sig, extra_args) } = query; - - let cx = LayoutCx::new(tcx, typing_env); fn_abi_new_uncached( - &cx, + &LayoutCx::new(tcx, typing_env), tcx.instantiate_bound_regions_with_erased(sig), extra_args, None, - None, - false, ) } @@ -326,19 +322,11 @@ fn fn_abi_of_instance<'tcx>( query: ty::PseudoCanonicalInput<'tcx, (ty::Instance<'tcx>, &'tcx ty::List>)>, ) -> Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, &'tcx FnAbiError<'tcx>> { let ty::PseudoCanonicalInput { typing_env, value: (instance, extra_args) } = query; - - let sig = fn_sig_for_fn_abi(tcx, instance, typing_env); - - let caller_location = - instance.def.requires_caller_location(tcx).then(|| tcx.caller_location_ty()); - fn_abi_new_uncached( &LayoutCx::new(tcx, typing_env), - sig, + fn_sig_for_fn_abi(tcx, instance, typing_env), extra_args, - caller_location, - Some(instance.def_id()), - matches!(instance.def, ty::InstanceKind::Virtual(..)), + Some(instance), ) } @@ -549,19 +537,23 @@ fn fn_abi_sanity_check<'tcx>( fn_arg_sanity_check(cx, fn_abi, spec_abi, &fn_abi.ret); } -// FIXME(eddyb) perhaps group the signature/type-containing (or all of them?) -// arguments of this method, into a separate `struct`. -#[tracing::instrument(level = "debug", skip(cx, caller_location, fn_def_id, force_thin_self_ptr))] +#[tracing::instrument(level = "debug", skip(cx, instance))] fn fn_abi_new_uncached<'tcx>( cx: &LayoutCx<'tcx>, sig: ty::FnSig<'tcx>, extra_args: &[Ty<'tcx>], - caller_location: Option>, - fn_def_id: Option, - // FIXME(eddyb) replace this with something typed, like an `enum`. - force_thin_self_ptr: bool, + instance: Option>, ) -> Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, &'tcx FnAbiError<'tcx>> { let tcx = cx.tcx(); + let (caller_location, fn_def_id, is_virtual_call) = if let Some(instance) = instance { + ( + instance.def.requires_caller_location(tcx).then(|| tcx.caller_location_ty()), + Some(instance.def_id()), + matches!(instance.def, ty::InstanceKind::Virtual(..)), + ) + } else { + (None, None, false) + }; let sig = tcx.normalize_erasing_regions(cx.typing_env, sig); let conv = conv_from_spec_abi(cx.tcx(), sig.abi, sig.c_variadic); @@ -570,16 +562,11 @@ fn fn_abi_new_uncached<'tcx>( let extra_args = if sig.abi == ExternAbi::RustCall { assert!(!sig.c_variadic && extra_args.is_empty()); - if let Some(input) = sig.inputs().last() { - if let ty::Tuple(tupled_arguments) = input.kind() { - inputs = &sig.inputs()[0..sig.inputs().len() - 1]; - tupled_arguments - } else { - bug!( - "argument to function with \"rust-call\" ABI \ - is not a tuple" - ); - } + if let Some(input) = sig.inputs().last() + && let ty::Tuple(tupled_arguments) = input.kind() + { + inputs = &sig.inputs()[0..sig.inputs().len() - 1]; + tupled_arguments } else { bug!( "argument to function with \"rust-call\" ABI \ @@ -605,7 +592,7 @@ fn fn_abi_new_uncached<'tcx>( }); let layout = cx.layout_of(ty).map_err(|err| &*tcx.arena.alloc(FnAbiError::Layout(*err)))?; - let layout = if force_thin_self_ptr && arg_idx == Some(0) { + let layout = if is_virtual_call && arg_idx == Some(0) { // Don't pass the vtable, it's not an argument of the virtual fn. // Instead, pass just the data pointer, but give it the type `*const/mut dyn Trait` // or `&/&mut dyn Trait` because this is special-cased elsewhere in codegen @@ -650,7 +637,15 @@ fn fn_abi_new_uncached<'tcx>( conv, can_unwind: fn_can_unwind(cx.tcx(), fn_def_id, sig.abi), }; - fn_abi_adjust_for_abi(cx, &mut fn_abi, sig.abi, fn_def_id); + fn_abi_adjust_for_abi( + cx, + &mut fn_abi, + sig.abi, + // If this is a virtual call, we cannot pass the `fn_def_id`, as it might call other + // functions from vtable. Internally, `deduced_param_attrs` attempts to infer attributes by + // visit the function body. + fn_def_id.filter(|_| !is_virtual_call), + ); debug!("fn_abi_new_uncached = {:?}", fn_abi); fn_abi_sanity_check(cx, &fn_abi, sig.abi); Ok(tcx.arena.alloc(fn_abi)) diff --git a/tests/codegen/virtual-call-attrs-issue-137646.rs b/tests/codegen/virtual-call-attrs-issue-137646.rs new file mode 100644 index 0000000000000..72a25b7585694 --- /dev/null +++ b/tests/codegen/virtual-call-attrs-issue-137646.rs @@ -0,0 +1,18 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/137646. +//! Since we don't know the exact implementation of the virtual call, +//! it might write to parameters, we can't infer the readonly attribute. +//@ compile-flags: -C opt-level=3 -C no-prepopulate-passes + +#![crate_type = "lib"] + +pub trait Trait { + fn m(&self, _: (i32, i32, i32)) {} +} + +#[no_mangle] +pub fn foo(trait_: &dyn Trait) { + // CHECK-LABEL: @foo( + // CHECK: call void + // CHECK-NOT: readonly + trait_.m((1, 1, 1)); +} diff --git a/tests/ui/virtual-call-attrs-issue-137646.rs b/tests/ui/virtual-call-attrs-issue-137646.rs index 055dc6ea4f2dc..e80bd5768a429 100644 --- a/tests/ui/virtual-call-attrs-issue-137646.rs +++ b/tests/ui/virtual-call-attrs-issue-137646.rs @@ -1,8 +1,7 @@ //! Regression test for https://github.com/rust-lang/rust/issues/137646. -//! FIXME: The parameter value at all calls to `check` should be `(1, 1, 1)`. +//! The parameter value at all calls to `check` should be `(1, 1, 1)`. //@ run-pass -//@ check-run-results use std::hint::black_box; @@ -35,8 +34,7 @@ pub fn run_2(trait_: &dyn Trait) { #[inline(never)] fn check(v: T) { - dbg!(v); - // assert_eq!(v, (1, 1, 1)); + assert_eq!(v, (1, 1, 1)); } fn main() { diff --git a/tests/ui/virtual-call-attrs-issue-137646.run.stderr b/tests/ui/virtual-call-attrs-issue-137646.run.stderr deleted file mode 100644 index 445975e1e54e6..0000000000000 --- a/tests/ui/virtual-call-attrs-issue-137646.run.stderr +++ /dev/null @@ -1,20 +0,0 @@ -[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( - 498486832, - 22093, - 498491440, -) -[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( - 0, - 0, - 0, -) -[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( - 0, - 0, - 0, -) -[$DIR/virtual-call-attrs-issue-137646.rs:38:5] v = ( - 0, - 0, - 0, -) From e3e34e3d8a43742a79b2a010ffeda1d06090de23 Mon Sep 17 00:00:00 2001 From: DianQK Date: Thu, 27 Feb 2025 09:22:19 +0800 Subject: [PATCH 21/64] Don't infer unwinding of virtual calls based on the function attributes (cherry picked from commit fbe0075a86601e490ae217f3b291768759c39930) --- compiler/rustc_ty_utils/src/abi.rs | 19 +++++++++++++------ .../virtual-call-attrs-issue-137646.rs | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index cb9475e7d5ddf..606f0b5396ee2 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -545,11 +545,13 @@ fn fn_abi_new_uncached<'tcx>( instance: Option>, ) -> Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, &'tcx FnAbiError<'tcx>> { let tcx = cx.tcx(); - let (caller_location, fn_def_id, is_virtual_call) = if let Some(instance) = instance { + let (caller_location, determined_fn_def_id, is_virtual_call) = if let Some(instance) = instance + { + let is_virtual_call = matches!(instance.def, ty::InstanceKind::Virtual(..)); ( instance.def.requires_caller_location(tcx).then(|| tcx.caller_location_ty()), - Some(instance.def_id()), - matches!(instance.def, ty::InstanceKind::Virtual(..)), + if is_virtual_call { None } else { Some(instance.def_id()) }, + is_virtual_call, ) } else { (None, None, false) @@ -579,7 +581,7 @@ fn fn_abi_new_uncached<'tcx>( }; let is_drop_in_place = - fn_def_id.is_some_and(|def_id| tcx.is_lang_item(def_id, LangItem::DropInPlace)); + determined_fn_def_id.is_some_and(|def_id| tcx.is_lang_item(def_id, LangItem::DropInPlace)); let arg_of = |ty: Ty<'tcx>, arg_idx: Option| -> Result<_, &'tcx FnAbiError<'tcx>> { let span = tracing::debug_span!("arg_of"); @@ -635,7 +637,12 @@ fn fn_abi_new_uncached<'tcx>( c_variadic: sig.c_variadic, fixed_count: inputs.len() as u32, conv, - can_unwind: fn_can_unwind(cx.tcx(), fn_def_id, sig.abi), + can_unwind: fn_can_unwind( + tcx, + // Since `#[rustc_nounwind]` can change unwinding, we cannot infer unwinding by `fn_def_id` for a virtual call. + determined_fn_def_id, + sig.abi, + ), }; fn_abi_adjust_for_abi( cx, @@ -644,7 +651,7 @@ fn fn_abi_new_uncached<'tcx>( // If this is a virtual call, we cannot pass the `fn_def_id`, as it might call other // functions from vtable. Internally, `deduced_param_attrs` attempts to infer attributes by // visit the function body. - fn_def_id.filter(|_| !is_virtual_call), + determined_fn_def_id, ); debug!("fn_abi_new_uncached = {:?}", fn_abi); fn_abi_sanity_check(cx, &fn_abi, sig.abi); diff --git a/tests/codegen/virtual-call-attrs-issue-137646.rs b/tests/codegen/virtual-call-attrs-issue-137646.rs index 72a25b7585694..5e453947f27db 100644 --- a/tests/codegen/virtual-call-attrs-issue-137646.rs +++ b/tests/codegen/virtual-call-attrs-issue-137646.rs @@ -4,8 +4,10 @@ //@ compile-flags: -C opt-level=3 -C no-prepopulate-passes #![crate_type = "lib"] +#![feature(rustc_attrs)] pub trait Trait { + #[rustc_nounwind] fn m(&self, _: (i32, i32, i32)) {} } @@ -16,3 +18,20 @@ pub fn foo(trait_: &dyn Trait) { // CHECK-NOT: readonly trait_.m((1, 1, 1)); } + +#[no_mangle] +#[rustc_nounwind] +pub fn foo_nounwind(trait_: &dyn Trait) { + // CHECK-LABEL: @foo_nounwind( + // FIXME: Here should be invoke. + // COM: CHECK: invoke + trait_.m((1, 1, 1)); +} + +#[no_mangle] +pub extern "C" fn c_nounwind(trait_: &dyn Trait) { + // CHECK-LABEL: @c_nounwind( + // FIXME: Here should be invoke. + // COM: CHECK: invoke + trait_.m((1, 1, 1)); +} From 6be2e1ea86fadacd474127756370649d259d91ba Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 2 Mar 2025 18:41:28 +0000 Subject: [PATCH 22/64] Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin" This reverts commit a7a6c64a657f68113301c2ffe0745b49a16442d1, reversing changes made to ebbe63891f1fae21734cb97f2f863b08b1d44bf8. (cherry picked from commit a59a8f9e7579b4346eb6b00c3809d04986dcfcee) --- compiler/rustc_codegen_gcc/src/common.rs | 5 -- compiler/rustc_codegen_llvm/src/common.rs | 4 -- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 - compiler/rustc_codegen_ssa/src/mir/operand.rs | 59 +++++++------------ compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 26 +------- .../rustc_codegen_ssa/src/traits/consts.rs | 1 - .../src/mir/interpret/allocation.rs | 2 +- tests/codegen/slice-init.rs | 55 +---------------- 8 files changed, 28 insertions(+), 125 deletions(-) diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs index 20a3482aaa27f..2052a6aa21597 100644 --- a/compiler/rustc_codegen_gcc/src/common.rs +++ b/compiler/rustc_codegen_gcc/src/common.rs @@ -64,11 +64,6 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> { if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) } } - fn is_undef(&self, _val: RValue<'gcc>) -> bool { - // FIXME: actually check for undef - false - } - fn const_undef(&self, typ: Type<'gcc>) -> RValue<'gcc> { let local = self.current_func.borrow().expect("func").new_local(None, typ, "undefined"); if typ.is_struct().is_some() { diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs index 78b3a7f85417b..35ac6158e9772 100644 --- a/compiler/rustc_codegen_llvm/src/common.rs +++ b/compiler/rustc_codegen_llvm/src/common.rs @@ -126,10 +126,6 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { unsafe { llvm::LLVMGetUndef(t) } } - fn is_undef(&self, v: &'ll Value) -> bool { - unsafe { llvm::LLVMIsUndef(v) == True } - } - fn const_poison(&self, t: &'ll Type) -> &'ll Value { unsafe { llvm::LLVMGetPoison(t) } } diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 3b0187b9d37b1..7f6f82eae48f2 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1035,7 +1035,6 @@ unsafe extern "C" { pub(crate) fn LLVMMetadataTypeInContext(C: &Context) -> &Type; // Operations on all values - pub(crate) fn LLVMIsUndef(Val: &Value) -> Bool; pub(crate) fn LLVMTypeOf(Val: &Value) -> &Type; pub(crate) fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char; pub(crate) fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t); diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 9ca7d4f8f0047..19101ec2d1ba3 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -204,30 +204,14 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let alloc_align = alloc.inner().align; assert!(alloc_align >= layout.align.abi); - // Returns `None` when the value is partially undefined or any byte of it has provenance. - // Otherwise returns the value or (if the entire value is undef) returns an undef. let read_scalar = |start, size, s: abi::Scalar, ty| { - let range = alloc_range(start, size); match alloc.0.read_scalar( bx, - range, + alloc_range(start, size), /*read_provenance*/ matches!(s.primitive(), abi::Primitive::Pointer(_)), ) { - Ok(val) => Some(bx.scalar_to_backend(val, s, ty)), - Err(_) => { - // We may have failed due to partial provenance or unexpected provenance, - // continue down the normal code path if so. - if alloc.0.provenance().range_empty(range, &bx.tcx()) - // Since `read_scalar` failed, but there were no relocations involved, the - // bytes must be partially or fully uninitialized. Thus we can now unwrap the - // information about the range of uninit bytes and check if it's the full range. - && alloc.0.init_mask().is_range_initialized(range).unwrap_err() == range - { - Some(bx.const_undef(ty)) - } else { - None - } - } + Ok(val) => bx.scalar_to_backend(val, s, ty), + Err(_) => bx.const_poison(ty), } }; @@ -238,14 +222,16 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { // check that walks over the type of `mplace` to make sure it is truly correct to treat this // like a `Scalar` (or `ScalarPair`). match layout.backend_repr { - BackendRepr::Scalar(s) => { + BackendRepr::Scalar(s @ abi::Scalar::Initialized { .. }) => { let size = s.size(bx); assert_eq!(size, layout.size, "abi::Scalar size does not match layout size"); - if let Some(val) = read_scalar(offset, size, s, bx.immediate_backend_type(layout)) { - return OperandRef { val: OperandValue::Immediate(val), layout }; - } + let val = read_scalar(offset, size, s, bx.immediate_backend_type(layout)); + OperandRef { val: OperandValue::Immediate(val), layout } } - BackendRepr::ScalarPair(a, b) => { + BackendRepr::ScalarPair( + a @ abi::Scalar::Initialized { .. }, + b @ abi::Scalar::Initialized { .. }, + ) => { let (a_size, b_size) = (a.size(bx), b.size(bx)); let b_offset = (offset + a_size).align_to(b.align(bx).abi); assert!(b_offset.bytes() > 0); @@ -261,21 +247,20 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { b, bx.scalar_pair_element_backend_type(layout, 1, true), ); - if let (Some(a_val), Some(b_val)) = (a_val, b_val) { - return OperandRef { val: OperandValue::Pair(a_val, b_val), layout }; - } + OperandRef { val: OperandValue::Pair(a_val, b_val), layout } + } + _ if layout.is_zst() => OperandRef::zero_sized(layout), + _ => { + // Neither a scalar nor scalar pair. Load from a place + // FIXME: should we cache `const_data_from_alloc` to avoid repeating this for the + // same `ConstAllocation`? + let init = bx.const_data_from_alloc(alloc); + let base_addr = bx.static_addr_of(init, alloc_align, None); + + let llval = bx.const_ptr_byte_offset(base_addr, offset); + bx.load_operand(PlaceRef::new_sized(llval, layout)) } - _ if layout.is_zst() => return OperandRef::zero_sized(layout), - _ => {} } - // Neither a scalar nor scalar pair. Load from a place - // FIXME: should we cache `const_data_from_alloc` to avoid repeating this for the - // same `ConstAllocation`? - let init = bx.const_data_from_alloc(alloc); - let base_addr = bx.static_addr_of(init, alloc_align, None); - - let llval = bx.const_ptr_byte_offset(base_addr, offset); - bx.load_operand(PlaceRef::new_sized(llval, layout)) } /// Asserts that this operand refers to a scalar and returns diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 4c5b183cfe92a..63f421243acfe 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -8,7 +8,7 @@ use rustc_middle::ty::{self, Instance, Ty, TyCtxt}; use rustc_middle::{bug, mir, span_bug}; use rustc_session::config::OptLevel; use rustc_span::{DUMMY_SP, Span}; -use tracing::{debug, instrument, trace}; +use tracing::{debug, instrument}; use super::operand::{OperandRef, OperandValue}; use super::place::PlaceRef; @@ -93,8 +93,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { return; } - // If `v` is an integer constant whose value is just a single byte repeated N times, - // emit a `memset` filling the entire `dest` with that byte. let try_init_all_same = |bx: &mut Bx, v| { let start = dest.val.llval; let size = bx.const_usize(dest.layout.size.bytes()); @@ -119,33 +117,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { false }; - trace!(?cg_elem.val); match cg_elem.val { OperandValue::Immediate(v) => { if try_init_all_same(bx, v) { return; } } - OperandValue::Pair(a, b) => { - let a_is_undef = bx.cx().is_undef(a); - match (a_is_undef, bx.cx().is_undef(b)) { - // Can happen for uninit unions - (true, true) => { - // FIXME: can we produce better output here? - } - (false, true) | (true, false) => { - let val = if a_is_undef { b } else { a }; - if try_init_all_same(bx, val) { - return; - } - } - (false, false) => { - // FIXME: if both are the same value, use try_init_all_same - } - } - } - OperandValue::ZeroSized => unreachable!("checked above"), - OperandValue::Ref(..) => {} + _ => (), } let count = self diff --git a/compiler/rustc_codegen_ssa/src/traits/consts.rs b/compiler/rustc_codegen_ssa/src/traits/consts.rs index 5cfb56ebacee8..dc6b68ceff7d8 100644 --- a/compiler/rustc_codegen_ssa/src/traits/consts.rs +++ b/compiler/rustc_codegen_ssa/src/traits/consts.rs @@ -9,7 +9,6 @@ pub trait ConstCodegenMethods<'tcx>: BackendTypes { /// Generate an uninitialized value (matching uninitialized memory in MIR). /// Whether memory is initialized or not is tracked byte-for-byte. fn const_undef(&self, t: Self::Type) -> Self::Value; - fn is_undef(&self, v: Self::Value) -> bool; /// Generate a fake value. Poison always affects the entire value, even if just a single byte is /// poison. This can only be used in codepaths that are already UB, i.e., UB-free Rust code /// (including code that e.g. copies uninit memory with `MaybeUninit`) can never encounter a diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs index 95bc9b71fe0ad..697a0e6592df0 100644 --- a/compiler/rustc_middle/src/mir/interpret/allocation.rs +++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs @@ -222,7 +222,7 @@ impl AllocError { } /// The information that makes up a memory access: offset and size. -#[derive(Copy, Clone, PartialEq)] +#[derive(Copy, Clone)] pub struct AllocRange { pub start: Size, pub size: Size, diff --git a/tests/codegen/slice-init.rs b/tests/codegen/slice-init.rs index b36a5b5de3d41..1c2dd3e887555 100644 --- a/tests/codegen/slice-init.rs +++ b/tests/codegen/slice-init.rs @@ -2,8 +2,6 @@ #![crate_type = "lib"] -use std::mem::MaybeUninit; - // CHECK-LABEL: @zero_sized_elem #[no_mangle] pub fn zero_sized_elem() { @@ -78,64 +76,17 @@ pub fn u16_init_one_bytes() -> [u16; N] { [const { u16::from_be_bytes([1, 1]) }; N] } +// FIXME: undef bytes can just be initialized with the same value as the +// defined bytes, if the defines bytes are all the same. // CHECK-LABEL: @option_none_init #[no_mangle] pub fn option_none_init() -> [Option; N] { - // CHECK-NOT: select - // CHECK-NOT: br - // CHECK-NOT: switch - // CHECK-NOT: icmp - // CHECK: call void @llvm.memset.p0 - [const { None }; N] -} - -// If there is partial provenance or some bytes are initialized and some are not, -// we can't really do better than initialize bytes or groups of bytes together. -// CHECK-LABEL: @option_maybe_uninit_init -#[no_mangle] -pub fn option_maybe_uninit_init() -> [MaybeUninit; N] { - // CHECK-NOT: select - // CHECK: br label %repeat_loop_header{{.*}} - // CHECK-NOT: switch - // CHECK: icmp - // CHECK-NOT: call void @llvm.memset.p0 - [const { - let mut val: MaybeUninit = MaybeUninit::uninit(); - let ptr = val.as_mut_ptr() as *mut u8; - unsafe { - ptr.write(0); - } - val - }; N] -} - -#[repr(packed)] -struct Packed { - start: u8, - ptr: &'static (), - rest: u16, - rest2: u8, -} - -// If there is partial provenance or some bytes are initialized and some are not, -// we can't really do better than initialize bytes or groups of bytes together. -// CHECK-LABEL: @option_maybe_uninit_provenance -#[no_mangle] -pub fn option_maybe_uninit_provenance() -> [MaybeUninit; N] { // CHECK-NOT: select // CHECK: br label %repeat_loop_header{{.*}} // CHECK-NOT: switch // CHECK: icmp // CHECK-NOT: call void @llvm.memset.p0 - [const { - let mut val: MaybeUninit = MaybeUninit::uninit(); - unsafe { - let ptr = &raw mut (*val.as_mut_ptr()).ptr; - static HAS_ADDR: () = (); - ptr.write_unaligned(&HAS_ADDR); - } - val - }; N] + [None; N] } // Use an opaque function to prevent rustc from removing useless drops. From cd87b034d23269ae6cd4b9bba1a4d016e96b404b Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 2 Mar 2025 18:52:33 +0000 Subject: [PATCH 23/64] Add a test (cherry picked from commit 5f575bc4bca3f18e4798110b05e059a840c0fd49) --- tests/codegen/slice-init.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/codegen/slice-init.rs b/tests/codegen/slice-init.rs index 1c2dd3e887555..950e0b0c10db7 100644 --- a/tests/codegen/slice-init.rs +++ b/tests/codegen/slice-init.rs @@ -89,6 +89,20 @@ pub fn option_none_init() -> [Option; N] { [None; N] } +use std::mem::MaybeUninit; + +// FIXME: This could be optimized into a memset. +// Regression test for . +#[no_mangle] +pub fn half_uninit() -> [(u128, MaybeUninit); N] { + // CHECK-NOT: select + // CHECK: br label %repeat_loop_header{{.*}} + // CHECK-NOT: switch + // CHECK: icmp + // CHECK-NOT: call void @llvm.memset.p0 + [const { (0, MaybeUninit::uninit()) }; N] +} + // Use an opaque function to prevent rustc from removing useless drops. #[inline(never)] pub fn opaque(_: impl Sized) {} From 0bd07383074854e3458763b4193d6d14f4683a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 3 Mar 2025 19:49:35 +0100 Subject: [PATCH 24/64] Do not use rustup to build Rust for Linux (cherry picked from commit e3117e6e1834838bce446517d7541dda395032d8) --- src/ci/docker/scripts/rfl-build.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ci/docker/scripts/rfl-build.sh b/src/ci/docker/scripts/rfl-build.sh index 3eb85ab215e0b..22468d84678f9 100755 --- a/src/ci/docker/scripts/rfl-build.sh +++ b/src/ci/docker/scripts/rfl-build.sh @@ -8,16 +8,10 @@ LINUX_VERSION=50e57739141b41f731ab31f8380821c7969f9dc4 ../x.py build --stage 2 library rustdoc clippy rustfmt ../x.py build --stage 0 cargo -# Install rustup so that we can use the built toolchain easily, and also -# install bindgen in an easy way. -curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs -sh rustup.sh -y --default-toolchain none +BUILD_DIR=$(realpath ./build/x86_64-unknown-linux-gnu) -source /cargo/env - -BUILD_DIR=$(realpath ./build) -rustup toolchain link local "${BUILD_DIR}"/x86_64-unknown-linux-gnu/stage2 -rustup default local +# Provide path to rustc, rustdoc, clippy-driver and rustfmt to RfL +export PATH=${PATH}:${BUILD_DIR}/stage2/bin mkdir -p rfl cd rfl @@ -33,10 +27,14 @@ git -C linux fetch --depth 1 origin ${LINUX_VERSION} git -C linux checkout FETCH_HEAD # Install bindgen -"${BUILD_DIR}"/x86_64-unknown-linux-gnu/stage0/bin/cargo install \ +"${BUILD_DIR}"/stage0/bin/cargo install \ --version $(linux/scripts/min-tool-version.sh bindgen) \ + --root ${BUILD_DIR}/bindgen \ bindgen-cli +# Provide path to bindgen to RfL +export PATH=${PATH}:${BUILD_DIR}/bindgen/bin + # Configure Rust for Linux cat < linux/kernel/configs/rfl-for-rust-ci.config # CONFIG_WERROR is not set From 882139c088cef9ba9d3ea79f52ed6444d9e8f1b4 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Mon, 24 Feb 2025 03:48:12 +0000 Subject: [PATCH 25/64] Windows: Use MoveFileEx by default in `fs:rename` (cherry picked from commit 0dfe2ae3fb72c50ea369286131c73daede13d7e5) --- library/std/src/sys/pal/windows/fs.rs | 181 ++++++++------------------ 1 file changed, 56 insertions(+), 125 deletions(-) diff --git a/library/std/src/sys/pal/windows/fs.rs b/library/std/src/sys/pal/windows/fs.rs index 62d4d727432c3..8ef565ec048af 100644 --- a/library/std/src/sys/pal/windows/fs.rs +++ b/library/std/src/sys/pal/windows/fs.rs @@ -1,10 +1,10 @@ use super::api::{self, WinError}; use super::{IoResult, to_u16s}; -use crate::alloc::{alloc, handle_alloc_error}; +use crate::alloc::{Layout, alloc, dealloc, handle_alloc_error}; use crate::borrow::Cow; use crate::ffi::{OsStr, OsString, c_void}; use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom}; -use crate::mem::{self, MaybeUninit}; +use crate::mem::{self, MaybeUninit, offset_of}; use crate::os::windows::io::{AsHandle, BorrowedHandle}; use crate::os::windows::prelude::*; use crate::path::{Path, PathBuf}; @@ -1252,141 +1252,72 @@ pub fn rename(old: &Path, new: &Path) -> io::Result<()> { let old = maybe_verbatim(old)?; let new = maybe_verbatim(new)?; - let new_len_without_nul_in_bytes = (new.len() - 1).try_into().unwrap(); - - // The last field of FILE_RENAME_INFO, the file name, is unsized, - // and FILE_RENAME_INFO has two padding bytes. - // Therefore we need to make sure to not allocate less than - // size_of::() bytes, which would be the case with - // 0 or 1 character paths + a null byte. - let struct_size = mem::size_of::() - .max(mem::offset_of!(c::FILE_RENAME_INFO, FileName) + new.len() * mem::size_of::()); - - let struct_size: u32 = struct_size.try_into().unwrap(); - - let create_file = |extra_access, extra_flags| { - let handle = unsafe { - HandleOrInvalid::from_raw_handle(c::CreateFileW( - old.as_ptr(), - c::SYNCHRONIZE | c::DELETE | extra_access, - c::FILE_SHARE_READ | c::FILE_SHARE_WRITE | c::FILE_SHARE_DELETE, - ptr::null(), - c::OPEN_EXISTING, - c::FILE_ATTRIBUTE_NORMAL | c::FILE_FLAG_BACKUP_SEMANTICS | extra_flags, - ptr::null_mut(), - )) - }; - - OwnedHandle::try_from(handle).map_err(|_| io::Error::last_os_error()) - }; - - // The following code replicates `MoveFileEx`'s behavior as reverse-engineered from its disassembly. - // If `old` refers to a mount point, we move it instead of the target. - let handle = match create_file(c::FILE_READ_ATTRIBUTES, c::FILE_FLAG_OPEN_REPARSE_POINT) { - Ok(handle) => { - let mut file_attribute_tag_info: MaybeUninit = - MaybeUninit::uninit(); - - let result = unsafe { - cvt(c::GetFileInformationByHandleEx( - handle.as_raw_handle(), - c::FileAttributeTagInfo, - file_attribute_tag_info.as_mut_ptr().cast(), - mem::size_of::().try_into().unwrap(), - )) + if unsafe { c::MoveFileExW(old.as_ptr(), new.as_ptr(), c::MOVEFILE_REPLACE_EXISTING) } == 0 { + let err = api::get_last_error(); + // if `MoveFileExW` fails with ERROR_ACCESS_DENIED then try to move + // the file while ignoring the readonly attribute. + // This is accomplished by calling `SetFileInformationByHandle` with `FileRenameInfoEx`. + if err == WinError::ACCESS_DENIED { + let mut opts = OpenOptions::new(); + opts.access_mode(c::DELETE); + opts.custom_flags(c::FILE_FLAG_OPEN_REPARSE_POINT | c::FILE_FLAG_BACKUP_SEMANTICS); + let Ok(f) = File::open_native(&old, &opts) else { return Err(err).io_result() }; + + // Calculate the layout of the `FILE_RENAME_INFO` we pass to `SetFileInformation` + // This is a dynamically sized struct so we need to get the position of the last field to calculate the actual size. + let Ok(new_len_without_nul_in_bytes): Result = ((new.len() - 1) * 2).try_into() + else { + return Err(err).io_result(); }; - - if let Err(err) = result { - if err.raw_os_error() == Some(c::ERROR_INVALID_PARAMETER as _) - || err.raw_os_error() == Some(c::ERROR_INVALID_FUNCTION as _) - { - // `GetFileInformationByHandleEx` documents that not all underlying drivers support all file information classes. - // Since we know we passed the correct arguments, this means the underlying driver didn't understand our request; - // `MoveFileEx` proceeds by reopening the file without inhibiting reparse point behavior. - None - } else { - Some(Err(err)) - } - } else { - // SAFETY: The struct has been initialized by GetFileInformationByHandleEx - let file_attribute_tag_info = unsafe { file_attribute_tag_info.assume_init() }; - let file_type = FileType::new( - file_attribute_tag_info.FileAttributes, - file_attribute_tag_info.ReparseTag, - ); - - if file_type.is_symlink() { - // The file is a mount point, junction point or symlink so - // don't reopen the file so that the link gets renamed. - Some(Ok(handle)) - } else { - // Otherwise reopen the file without inhibiting reparse point behavior. - None + let offset: u32 = offset_of!(c::FILE_RENAME_INFO, FileName).try_into().unwrap(); + let struct_size = offset + new_len_without_nul_in_bytes + 2; + let layout = + Layout::from_size_align(struct_size as usize, align_of::()) + .unwrap(); + + // SAFETY: We allocate enough memory for a full FILE_RENAME_INFO struct and a filename. + let file_rename_info; + unsafe { + file_rename_info = alloc(layout).cast::(); + if file_rename_info.is_null() { + handle_alloc_error(layout); } - } - } - // The underlying driver may not support `FILE_FLAG_OPEN_REPARSE_POINT`: Retry without it. - Err(err) if err.raw_os_error() == Some(c::ERROR_INVALID_PARAMETER as _) => None, - Err(err) => Some(Err(err)), - } - .unwrap_or_else(|| create_file(0, 0))?; - - let layout = core::alloc::Layout::from_size_align( - struct_size as _, - mem::align_of::(), - ) - .unwrap(); - - let file_rename_info = unsafe { alloc(layout) } as *mut c::FILE_RENAME_INFO; - - if file_rename_info.is_null() { - handle_alloc_error(layout); - } - // SAFETY: file_rename_info is a non-null pointer pointing to memory allocated by the global allocator. - let mut file_rename_info = unsafe { Box::from_raw(file_rename_info) }; + (&raw mut (*file_rename_info).Anonymous).write(c::FILE_RENAME_INFO_0 { + Flags: c::FILE_RENAME_FLAG_REPLACE_IF_EXISTS + | c::FILE_RENAME_FLAG_POSIX_SEMANTICS, + }); - // SAFETY: We have allocated enough memory for a full FILE_RENAME_INFO struct and a filename. - unsafe { - (&raw mut (*file_rename_info).Anonymous).write(c::FILE_RENAME_INFO_0 { - Flags: c::FILE_RENAME_FLAG_REPLACE_IF_EXISTS | c::FILE_RENAME_FLAG_POSIX_SEMANTICS, - }); - - (&raw mut (*file_rename_info).RootDirectory).write(ptr::null_mut()); - (&raw mut (*file_rename_info).FileNameLength).write(new_len_without_nul_in_bytes); - - new.as_ptr() - .copy_to_nonoverlapping((&raw mut (*file_rename_info).FileName) as *mut u16, new.len()); - } - - // We don't use `set_file_information_by_handle` here as `FILE_RENAME_INFO` is used for both `FileRenameInfo` and `FileRenameInfoEx`. - let result = unsafe { - cvt(c::SetFileInformationByHandle( - handle.as_raw_handle(), - c::FileRenameInfoEx, - (&raw const *file_rename_info).cast::(), - struct_size, - )) - }; + (&raw mut (*file_rename_info).RootDirectory).write(ptr::null_mut()); + // Don't include the NULL in the size + (&raw mut (*file_rename_info).FileNameLength).write(new_len_without_nul_in_bytes); - if let Err(err) = result { - if err.raw_os_error() == Some(c::ERROR_INVALID_PARAMETER as _) { - // FileRenameInfoEx and FILE_RENAME_FLAG_POSIX_SEMANTICS were added in Windows 10 1607; retry with FileRenameInfo. - file_rename_info.Anonymous.ReplaceIfExists = true; + new.as_ptr().copy_to_nonoverlapping( + (&raw mut (*file_rename_info).FileName).cast::(), + new.len(), + ); + } - cvt(unsafe { + let result = unsafe { c::SetFileInformationByHandle( - handle.as_raw_handle(), - c::FileRenameInfo, - (&raw const *file_rename_info).cast::(), + f.as_raw_handle(), + c::FileRenameInfoEx, + file_rename_info.cast::(), struct_size, ) - })?; + }; + unsafe { dealloc(file_rename_info.cast::(), layout) }; + if result == 0 { + if api::get_last_error() == WinError::DIR_NOT_EMPTY { + return Err(WinError::DIR_NOT_EMPTY).io_result(); + } else { + return Err(err).io_result(); + } + } } else { - return Err(err); + return Err(err).io_result(); } } - Ok(()) } From 9b20ca1cfc8af049c6c6ad0f1c23a77d5ea53f91 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 6 Mar 2025 14:18:18 +0000 Subject: [PATCH 26/64] Return OutOfMemoryError and update docs (cherry picked from commit 3cb53df1feaba73b84344c8c0e3dc4120ad8c95b) --- library/std/src/fs.rs | 2 +- library/std/src/sys/pal/windows/fs.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 83b009c86dc08..793946692312b 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -2425,7 +2425,7 @@ pub fn symlink_metadata>(path: P) -> io::Result { /// # Platform-specific behavior /// /// This function currently corresponds to the `rename` function on Unix -/// and the `SetFileInformationByHandle` function on Windows. +/// and the `MoveFileExW` or `SetFileInformationByHandle` function on Windows. /// /// Because of this, the behavior when both `from` and `to` exist differs. On /// Unix, if `from` is a directory, `to` must also be an (empty) directory. If diff --git a/library/std/src/sys/pal/windows/fs.rs b/library/std/src/sys/pal/windows/fs.rs index 8ef565ec048af..7ae36ba943ba1 100644 --- a/library/std/src/sys/pal/windows/fs.rs +++ b/library/std/src/sys/pal/windows/fs.rs @@ -1,6 +1,6 @@ use super::api::{self, WinError}; use super::{IoResult, to_u16s}; -use crate::alloc::{Layout, alloc, dealloc, handle_alloc_error}; +use crate::alloc::{Layout, alloc, dealloc}; use crate::borrow::Cow; use crate::ffi::{OsStr, OsString, c_void}; use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom}; @@ -1280,7 +1280,7 @@ pub fn rename(old: &Path, new: &Path) -> io::Result<()> { unsafe { file_rename_info = alloc(layout).cast::(); if file_rename_info.is_null() { - handle_alloc_error(layout); + return Err(io::ErrorKind::OutOfMemory.into()); } (&raw mut (*file_rename_info).Anonymous).write(c::FILE_RENAME_INFO_0 { From 10d5f6727a3785544690e3176c59177b3e6ba36c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 25 Feb 2025 20:26:12 +0100 Subject: [PATCH 27/64] rustdoc: disable forbidden #[target_feature] check (cherry picked from commit b6f22400002f7921feed13e35852e3041cf2b145) --- compiler/rustc_codegen_ssa/src/target_features.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index d8b9bdb55da69..28c6932dd5b9c 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -87,7 +87,10 @@ pub(crate) fn from_target_feature_attr( // But ensure the ABI does not forbid enabling this. // Here we do assume that LLVM doesn't add even more implied features // we don't know about, at least no features that would have ABI effects! - if abi_feature_constraints.incompatible.contains(&name.as_str()) { + // We skip this check in rustdoc, like we skip all target feature related checks. + if !tcx.sess.opts.actually_rustdoc + && abi_feature_constraints.incompatible.contains(&name.as_str()) + { tcx.dcx().emit_err(errors::ForbiddenTargetFeatureAttr { span: item.span(), feature: name.as_str(), @@ -142,8 +145,11 @@ pub(crate) fn provide(providers: &mut Providers) { rust_target_features: |tcx, cnum| { assert_eq!(cnum, LOCAL_CRATE); if tcx.sess.opts.actually_rustdoc { - // rustdoc needs to be able to document functions that use all the features, so - // whitelist them all + // HACK: rustdoc would like to pretend that we have all the target features, so we + // have to merge all the lists into one. The result has a "random" stability + // (depending on the order in which we consider features); all places that check + // target stability are expected to check `actually_rustdoc` and do nothing when + // that is set. rustc_target::target_features::all_rust_features() .map(|(a, b)| (a.to_string(), b)) .collect() From 17d569c25b34ca6a44807d0b9720111387fd7a7b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 25 Feb 2025 20:38:13 +0100 Subject: [PATCH 28/64] also fix potential issues with mixed stable/unstable target features in rustdoc (cherry picked from commit 039af88e09f4f4beb47406f4771bffc2e61d800a) --- .../rustc_codegen_ssa/src/target_features.rs | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index 28c6932dd5b9c..a63e1877e4533 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -10,7 +10,7 @@ use rustc_middle::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::parse::feature_err; use rustc_span::{Span, Symbol, sym}; -use rustc_target::target_features; +use rustc_target::target_features::{self, Stability}; use crate::errors; @@ -87,10 +87,7 @@ pub(crate) fn from_target_feature_attr( // But ensure the ABI does not forbid enabling this. // Here we do assume that LLVM doesn't add even more implied features // we don't know about, at least no features that would have ABI effects! - // We skip this check in rustdoc, like we skip all target feature related checks. - if !tcx.sess.opts.actually_rustdoc - && abi_feature_constraints.incompatible.contains(&name.as_str()) - { + if abi_feature_constraints.incompatible.contains(&name.as_str()) { tcx.dcx().emit_err(errors::ForbiddenTargetFeatureAttr { span: item.span(), feature: name.as_str(), @@ -146,13 +143,37 @@ pub(crate) fn provide(providers: &mut Providers) { assert_eq!(cnum, LOCAL_CRATE); if tcx.sess.opts.actually_rustdoc { // HACK: rustdoc would like to pretend that we have all the target features, so we - // have to merge all the lists into one. The result has a "random" stability - // (depending on the order in which we consider features); all places that check - // target stability are expected to check `actually_rustdoc` and do nothing when - // that is set. - rustc_target::target_features::all_rust_features() - .map(|(a, b)| (a.to_string(), b)) - .collect() + // have to merge all the lists into one. To ensure an unstable target never prevents + // a stable one from working, we merge the stability info of all instances of the + // same target feature name, with the "most stable" taking precedence. And then we + // hope that this doesn't cause issues anywhere else in the compiler... + let mut result: UnordMap = Default::default(); + for (name, stability) in rustc_target::target_features::all_rust_features() { + use std::collections::hash_map::Entry; + match result.entry(name.to_owned()) { + Entry::Vacant(vacant_entry) => { + vacant_entry.insert(stability); + } + Entry::Occupied(mut occupied_entry) => { + // Merge the two stabilities, "more stable" taking precedence. + match (occupied_entry.get(), stability) { + (Stability::Stable, _) + | ( + Stability::Unstable { .. }, + Stability::Unstable { .. } | Stability::Forbidden { .. }, + ) + | (Stability::Forbidden { .. }, Stability::Forbidden { .. }) => { + // The stability in the entry is at least as good as the new one, just keep it. + } + _ => { + // Overwrite stabilite. + occupied_entry.insert(stability); + } + } + } + } + } + result } else { tcx.sess .target From 871f01db2d4814b37dbe7654204305e46eea60ca Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 28 Feb 2025 16:51:53 +0100 Subject: [PATCH 29/64] add test (cherry picked from commit dc04c0ca48c7285d74a0489354ed7d013dc25799) --- tests/rustdoc-ui/target-feature-stability.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/rustdoc-ui/target-feature-stability.rs diff --git a/tests/rustdoc-ui/target-feature-stability.rs b/tests/rustdoc-ui/target-feature-stability.rs new file mode 100644 index 0000000000000..4ade9690310e3 --- /dev/null +++ b/tests/rustdoc-ui/target-feature-stability.rs @@ -0,0 +1,18 @@ +//! This is a regression test for , ensuring +//! that we can use the `neon` target feature on ARM-32 targets in rustdoc despite there +//! being a "forbidden" feature of the same name for aarch64, and rustdoc merging the +//! target features of all targets. +//@ check-pass +//@ compile-flags: --target armv7-unknown-linux-gnueabihf + +#![crate_type = "lib"] +#![feature(no_core, lang_items)] +#![feature(arm_target_feature)] +#![no_core] + +#[lang = "sized"] +pub trait Sized {} + +// `fp-armv8` is "forbidden" on aarch64 as we tie it to `neon`. +#[target_feature(enable = "fp-armv8")] +pub fn fun() {} From 6f5cf7d368c648da0c4400b158490e10ba09d6b4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 28 Feb 2025 16:56:36 +0100 Subject: [PATCH 30/64] also skip abi_required_features check in rustdoc (cherry picked from commit 4c939db0e775df21a0b409b7603eaaf0056e8f86) --- .../rustc_codegen_ssa/src/target_features.rs | 17 +++++++++++------ tests/rustdoc-ui/target-feature-stability.rs | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index a63e1877e4533..95a5e96fe46e4 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -87,12 +87,17 @@ pub(crate) fn from_target_feature_attr( // But ensure the ABI does not forbid enabling this. // Here we do assume that LLVM doesn't add even more implied features // we don't know about, at least no features that would have ABI effects! - if abi_feature_constraints.incompatible.contains(&name.as_str()) { - tcx.dcx().emit_err(errors::ForbiddenTargetFeatureAttr { - span: item.span(), - feature: name.as_str(), - reason: "this feature is incompatible with the target ABI", - }); + // We skip this logic in rustdoc, where we want to allow all target features of + // all targets, so we can't check their ABI compatibility and anyway we are not + // generating code so "it's fine". + if !tcx.sess.opts.actually_rustdoc { + if abi_feature_constraints.incompatible.contains(&name.as_str()) { + tcx.dcx().emit_err(errors::ForbiddenTargetFeatureAttr { + span: item.span(), + feature: name.as_str(), + reason: "this feature is incompatible with the target ABI", + }); + } } target_features.push(TargetFeature { name, implied: name != feature_sym }) } diff --git a/tests/rustdoc-ui/target-feature-stability.rs b/tests/rustdoc-ui/target-feature-stability.rs index 4ade9690310e3..17fa3ccfe3e89 100644 --- a/tests/rustdoc-ui/target-feature-stability.rs +++ b/tests/rustdoc-ui/target-feature-stability.rs @@ -1,9 +1,13 @@ //! This is a regression test for , ensuring -//! that we can use the `neon` target feature on ARM-32 targets in rustdoc despite there +//! that we can use the `neon` target feature on ARM32 targets in rustdoc despite there //! being a "forbidden" feature of the same name for aarch64, and rustdoc merging the //! target features of all targets. //@ check-pass -//@ compile-flags: --target armv7-unknown-linux-gnueabihf +//@ revisions: arm aarch64 +//@[arm] compile-flags: --target armv7-unknown-linux-gnueabihf +//@[arm] needs-llvm-components: arm +//@[aarch64] compile-flags: --target aarch64-unknown-none-softfloat +//@[aarch64] needs-llvm-components: aarch64 #![crate_type = "lib"] #![feature(no_core, lang_items)] @@ -15,4 +19,10 @@ pub trait Sized {} // `fp-armv8` is "forbidden" on aarch64 as we tie it to `neon`. #[target_feature(enable = "fp-armv8")] -pub fn fun() {} +pub fn fun1() {} + +// This would usually be rejected as it changes the ABI. +// But we disable that check in rustdoc since we are building "for all targets" and the +// check can't really handle that. +#[target_feature(enable = "soft-float")] +pub fn fun2() {} From 6416d208a290fbe7c3b9803e7346e747c9345487 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 2 Mar 2025 14:33:29 -0700 Subject: [PATCH 31/64] doctests: fix merging on stable Fixes #137898 The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them. Since tests that use crate attrs don't be merged, there's no way to use nightly-only features on it anyway. (cherry picked from commit 5d6eeea5f969a5a3478de3904e9e02df68ce8b89) --- src/librustdoc/doctest.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 4a379b4235ff0..9c6cfb0311005 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -550,7 +550,12 @@ fn run_test( } compiler.arg("--edition").arg(doctest.edition.to_string()); - if !doctest.is_multiple_tests { + if doctest.is_multiple_tests { + // The merged test harness uses the `test` crate, so we need to actually allow it. + // This will not expose nightly features on stable, because crate attrs disable + // merging, and `#![feature]` is required to be a crate attr. + compiler.env("RUSTC_BOOTSTRAP", "1"); + } else { // Setting these environment variables is unneeded if this is a merged doctest. compiler.env("UNSTABLE_RUSTDOC_TEST_PATH", &doctest.test_opts.path); compiler.env( From ad393e3d2c4d3ddea6e877f57eda2d6e0fc47bb0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 2 Mar 2025 19:37:40 -0700 Subject: [PATCH 32/64] doctests: build test bundle and harness separately This prevents the included test case from getting at nightly-only features when run on stable. The harness builds with RUSTC_BOOTSTRAP, but the bundle doesn't. (cherry picked from commit 9cf531d26f474917f21a750d8b5fb61bbbae8faa) --- src/librustdoc/doctest.rs | 175 +++++++++++++----- src/librustdoc/doctest/runner.rs | 37 ++-- tests/run-make/doctests-merge/rmake.rs | 1 - tests/rustdoc-ui/doctest/doctest-output.rs | 2 +- ...iled-doctest-test-crate.edition2015.stdout | 28 +++ ...iled-doctest-test-crate.edition2024.stdout | 25 +++ .../doctest/failed-doctest-test-crate.rs | 17 ++ 7 files changed, 221 insertions(+), 64 deletions(-) create mode 100644 tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2015.stdout create mode 100644 tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2024.stdout create mode 100644 tests/rustdoc-ui/doctest/failed-doctest-test-crate.rs diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 9c6cfb0311005..211f4d524e463 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -96,7 +96,7 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) -> .map_err(|error| format!("failed to create args file: {error:?}"))?; // We now put the common arguments into the file we created. - let mut content = vec!["--crate-type=bin".to_string()]; + let mut content = vec![]; for cfg in &options.cfgs { content.push(format!("--cfg={cfg}")); @@ -513,12 +513,18 @@ pub(crate) struct RunnableDocTest { line: usize, edition: Edition, no_run: bool, - is_multiple_tests: bool, + merged_test_code: Option, } impl RunnableDocTest { - fn path_for_merged_doctest(&self) -> PathBuf { - self.test_opts.outdir.path().join(format!("doctest_{}.rs", self.edition)) + fn path_for_merged_doctest_bundle(&self) -> PathBuf { + self.test_opts.outdir.path().join(format!("doctest_bundle_{}.rs", self.edition)) + } + fn path_for_merged_doctest_runner(&self) -> PathBuf { + self.test_opts.outdir.path().join(format!("doctest_runner_{}.rs", self.edition)) + } + fn is_multiple_tests(&self) -> bool { + self.merged_test_code.is_some() } } @@ -537,96 +543,108 @@ fn run_test( let rust_out = add_exe_suffix("rust_out".to_owned(), &rustdoc_options.target); let output_file = doctest.test_opts.outdir.path().join(rust_out); - let rustc_binary = rustdoc_options - .test_builder - .as_deref() - .unwrap_or_else(|| rustc_interface::util::rustc_path().expect("found rustc")); - let mut compiler = wrapped_rustc_command(&rustdoc_options.test_builder_wrappers, rustc_binary); + // Common arguments used for compiling the doctest runner. + // On merged doctests, the compiler is invoked twice: once for the test code itself, + // and once for the runner wrapper (which needs to use `#![feature]` on stable). + let mut compiler_args = vec![]; - compiler.arg(format!("@{}", doctest.global_opts.args_file.display())); + compiler_args.push(format!("@{}", doctest.global_opts.args_file.display())); if let Some(sysroot) = &rustdoc_options.maybe_sysroot { - compiler.arg(format!("--sysroot={}", sysroot.display())); + compiler_args.push(format!("--sysroot={}", sysroot.display())); } - compiler.arg("--edition").arg(doctest.edition.to_string()); - if doctest.is_multiple_tests { - // The merged test harness uses the `test` crate, so we need to actually allow it. - // This will not expose nightly features on stable, because crate attrs disable - // merging, and `#![feature]` is required to be a crate attr. - compiler.env("RUSTC_BOOTSTRAP", "1"); - } else { - // Setting these environment variables is unneeded if this is a merged doctest. - compiler.env("UNSTABLE_RUSTDOC_TEST_PATH", &doctest.test_opts.path); - compiler.env( - "UNSTABLE_RUSTDOC_TEST_LINE", - format!("{}", doctest.line as isize - doctest.full_test_line_offset as isize), - ); - } - compiler.arg("-o").arg(&output_file); + compiler_args.extend_from_slice(&["--edition".to_owned(), doctest.edition.to_string()]); if langstr.test_harness { - compiler.arg("--test"); + compiler_args.push("--test".to_owned()); } if rustdoc_options.json_unused_externs.is_enabled() && !langstr.compile_fail { - compiler.arg("--error-format=json"); - compiler.arg("--json").arg("unused-externs"); - compiler.arg("-W").arg("unused_crate_dependencies"); - compiler.arg("-Z").arg("unstable-options"); + compiler_args.push("--error-format=json".to_owned()); + compiler_args.extend_from_slice(&["--json".to_owned(), "unused-externs".to_owned()]); + compiler_args.extend_from_slice(&["-W".to_owned(), "unused_crate_dependencies".to_owned()]); + compiler_args.extend_from_slice(&["-Z".to_owned(), "unstable-options".to_owned()]); } if doctest.no_run && !langstr.compile_fail && rustdoc_options.persist_doctests.is_none() { // FIXME: why does this code check if it *shouldn't* persist doctests // -- shouldn't it be the negation? - compiler.arg("--emit=metadata"); + compiler_args.push("--emit=metadata".to_owned()); } - compiler.arg("--target").arg(match &rustdoc_options.target { - TargetTuple::TargetTuple(s) => s, - TargetTuple::TargetJson { path_for_rustdoc, .. } => { - path_for_rustdoc.to_str().expect("target path must be valid unicode") - } - }); + compiler_args.extend_from_slice(&[ + "--target".to_owned(), + match &rustdoc_options.target { + TargetTuple::TargetTuple(s) => s.clone(), + TargetTuple::TargetJson { path_for_rustdoc, .. } => { + path_for_rustdoc.to_str().expect("target path must be valid unicode").to_owned() + } + }, + ]); if let ErrorOutputType::HumanReadable(kind, color_config) = rustdoc_options.error_format { let short = kind.short(); let unicode = kind == HumanReadableErrorType::Unicode; if short { - compiler.arg("--error-format").arg("short"); + compiler_args.extend_from_slice(&["--error-format".to_owned(), "short".to_owned()]); } if unicode { - compiler.arg("--error-format").arg("human-unicode"); + compiler_args + .extend_from_slice(&["--error-format".to_owned(), "human-unicode".to_owned()]); } match color_config { ColorConfig::Never => { - compiler.arg("--color").arg("never"); + compiler_args.extend_from_slice(&["--color".to_owned(), "never".to_owned()]); } ColorConfig::Always => { - compiler.arg("--color").arg("always"); + compiler_args.extend_from_slice(&["--color".to_owned(), "always".to_owned()]); } ColorConfig::Auto => { - compiler.arg("--color").arg(if supports_color { "always" } else { "never" }); + compiler_args.extend_from_slice(&[ + "--color".to_owned(), + if supports_color { "always" } else { "never" }.to_owned(), + ]); } } } + let rustc_binary = rustdoc_options + .test_builder + .as_deref() + .unwrap_or_else(|| rustc_interface::util::rustc_path().expect("found rustc")); + let mut compiler = wrapped_rustc_command(&rustdoc_options.test_builder_wrappers, rustc_binary); + + compiler.args(&compiler_args); + // If this is a merged doctest, we need to write it into a file instead of using stdin // because if the size of the merged doctests is too big, it'll simply break stdin. - if doctest.is_multiple_tests { + if doctest.is_multiple_tests() { // It makes the compilation failure much faster if it is for a combined doctest. compiler.arg("--error-format=short"); - let input_file = doctest.path_for_merged_doctest(); + let input_file = doctest.path_for_merged_doctest_bundle(); if std::fs::write(&input_file, &doctest.full_test_code).is_err() { // If we cannot write this file for any reason, we leave. All combined tests will be // tested as standalone tests. return Err(TestFailure::CompileError); } - compiler.arg(input_file); if !rustdoc_options.nocapture { // If `nocapture` is disabled, then we don't display rustc's output when compiling // the merged doctests. compiler.stderr(Stdio::null()); } + // bundled tests are an rlib, loaded by a separate runner executable + compiler + .arg("--crate-type=lib") + .arg("--out-dir") + .arg(doctest.test_opts.outdir.path()) + .arg(input_file); } else { + compiler.arg("--crate-type=bin").arg("-o").arg(&output_file); + // Setting these environment variables is unneeded if this is a merged doctest. + compiler.env("UNSTABLE_RUSTDOC_TEST_PATH", &doctest.test_opts.path); + compiler.env( + "UNSTABLE_RUSTDOC_TEST_LINE", + format!("{}", doctest.line as isize - doctest.full_test_line_offset as isize), + ); compiler.arg("-"); compiler.stdin(Stdio::piped()); compiler.stderr(Stdio::piped()); @@ -635,8 +653,65 @@ fn run_test( debug!("compiler invocation for doctest: {compiler:?}"); let mut child = compiler.spawn().expect("Failed to spawn rustc process"); - let output = if doctest.is_multiple_tests { + let output = if let Some(merged_test_code) = &doctest.merged_test_code { + // compile-fail tests never get merged, so this should always pass let status = child.wait().expect("Failed to wait"); + + // the actual test runner is a separate component, built with nightly-only features; + // build it now + let runner_input_file = doctest.path_for_merged_doctest_runner(); + + let mut runner_compiler = + wrapped_rustc_command(&rustdoc_options.test_builder_wrappers, rustc_binary); + // the test runner does not contain any user-written code, so this doesn't allow + // the user to exploit nightly-only features on stable + runner_compiler.env("RUSTC_BOOTSTRAP", "1"); + runner_compiler.args(compiler_args); + runner_compiler.args(&["--crate-type=bin", "-o"]).arg(&output_file); + let mut extern_path = std::ffi::OsString::from(format!( + "--extern=doctest_bundle_{edition}=", + edition = doctest.edition + )); + for extern_str in &rustdoc_options.extern_strs { + if let Some((_cratename, path)) = extern_str.split_once('=') { + // Direct dependencies of the tests themselves are + // indirect dependencies of the test runner. + // They need to be in the library search path. + let dir = Path::new(path) + .parent() + .filter(|x| x.components().count() > 0) + .unwrap_or(Path::new(".")); + runner_compiler.arg("-L").arg(dir); + } + } + let output_bundle_file = doctest + .test_opts + .outdir + .path() + .join(format!("libdoctest_bundle_{edition}.rlib", edition = doctest.edition)); + extern_path.push(&output_bundle_file); + runner_compiler.arg(extern_path); + runner_compiler.arg(&runner_input_file); + if std::fs::write(&runner_input_file, &merged_test_code).is_err() { + // If we cannot write this file for any reason, we leave. All combined tests will be + // tested as standalone tests. + return Err(TestFailure::CompileError); + } + if !rustdoc_options.nocapture { + // If `nocapture` is disabled, then we don't display rustc's output when compiling + // the merged doctests. + runner_compiler.stderr(Stdio::null()); + } + runner_compiler.arg("--error-format=short"); + debug!("compiler invocation for doctest runner: {runner_compiler:?}"); + + let status = if !status.success() { + status + } else { + let mut child_runner = runner_compiler.spawn().expect("Failed to spawn rustc process"); + child_runner.wait().expect("Failed to wait") + }; + process::Output { status, stdout: Vec::new(), stderr: Vec::new() } } else { let stdin = child.stdin.as_mut().expect("Failed to open stdin"); @@ -713,7 +788,7 @@ fn run_test( cmd.arg(&output_file); } else { cmd = Command::new(&output_file); - if doctest.is_multiple_tests { + if doctest.is_multiple_tests() { cmd.env("RUSTDOC_DOCTEST_BIN_PATH", &output_file); } } @@ -721,7 +796,7 @@ fn run_test( cmd.current_dir(run_directory); } - let result = if doctest.is_multiple_tests || rustdoc_options.nocapture { + let result = if doctest.is_multiple_tests() || rustdoc_options.nocapture { cmd.status().map(|status| process::Output { status, stdout: Vec::new(), @@ -1008,7 +1083,7 @@ fn doctest_run_fn( line: scraped_test.line, edition: scraped_test.edition(&rustdoc_options), no_run: scraped_test.no_run(&rustdoc_options), - is_multiple_tests: false, + merged_test_code: None, }; let res = run_test(runnable_test, &rustdoc_options, doctest.supports_color, report_unused_externs); diff --git a/src/librustdoc/doctest/runner.rs b/src/librustdoc/doctest/runner.rs index 234f40c6c1ab2..58efa35711a0e 100644 --- a/src/librustdoc/doctest/runner.rs +++ b/src/librustdoc/doctest/runner.rs @@ -14,6 +14,7 @@ pub(crate) struct DocTestRunner { crate_attrs: FxIndexSet, ids: String, output: String, + output_merged_tests: String, supports_color: bool, nb_tests: usize, } @@ -24,6 +25,7 @@ impl DocTestRunner { crate_attrs: FxIndexSet::default(), ids: String::new(), output: String::new(), + output_merged_tests: String::new(), supports_color: true, nb_tests: 0, } @@ -55,7 +57,8 @@ impl DocTestRunner { scraped_test, ignore, self.nb_tests, - &mut self.output + &mut self.output, + &mut self.output_merged_tests, ), )); self.supports_color &= doctest.supports_color; @@ -78,9 +81,11 @@ impl DocTestRunner { " .to_string(); + let mut code_prefix = String::new(); + for crate_attr in &self.crate_attrs { - code.push_str(crate_attr); - code.push('\n'); + code_prefix.push_str(crate_attr); + code_prefix.push('\n'); } if opts.attrs.is_empty() { @@ -88,15 +93,16 @@ impl DocTestRunner { // lints that are commonly triggered in doctests. The crate-level test attributes are // commonly used to make tests fail in case they trigger warnings, so having this there in // that case may cause some tests to pass when they shouldn't have. - code.push_str("#![allow(unused)]\n"); + code_prefix.push_str("#![allow(unused)]\n"); } // Next, any attributes that came from the crate root via #![doc(test(attr(...)))]. for attr in &opts.attrs { - code.push_str(&format!("#![{attr}]\n")); + code_prefix.push_str(&format!("#![{attr}]\n")); } code.push_str("extern crate test;\n"); + writeln!(code, "extern crate doctest_bundle_{edition} as doctest_bundle;").unwrap(); let test_args = test_args.iter().fold(String::new(), |mut x, arg| { write!(x, "{arg:?}.to_string(),").unwrap(); @@ -161,12 +167,12 @@ the same process\"); std::process::Termination::report(test::test_main(test_args, Vec::from(TESTS), None)) }}", nb_tests = self.nb_tests, - output = self.output, + output = self.output_merged_tests, ids = self.ids, ) .expect("failed to generate test code"); let runnable_test = RunnableDocTest { - full_test_code: code, + full_test_code: format!("{code_prefix}{code}", code = self.output), full_test_line_offset: 0, test_opts: test_options, global_opts: opts.clone(), @@ -174,7 +180,7 @@ std::process::Termination::report(test::test_main(test_args, Vec::from(TESTS), N line: 0, edition, no_run: false, - is_multiple_tests: true, + merged_test_code: Some(code), }; let ret = run_test(runnable_test, rustdoc_options, self.supports_color, |_: UnusedExterns| {}); @@ -189,14 +195,15 @@ fn generate_mergeable_doctest( ignore: bool, id: usize, output: &mut String, + output_merged_tests: &mut String, ) -> String { let test_id = format!("__doctest_{id}"); if ignore { // We generate nothing else. - writeln!(output, "mod {test_id} {{\n").unwrap(); + writeln!(output, "pub mod {test_id} {{}}\n").unwrap(); } else { - writeln!(output, "mod {test_id} {{\n{}{}", doctest.crates, doctest.maybe_crate_attrs) + writeln!(output, "pub mod {test_id} {{\n{}{}", doctest.crates, doctest.maybe_crate_attrs) .unwrap(); if doctest.has_main_fn { output.push_str(&doctest.everything_else); @@ -216,11 +223,17 @@ fn main() {returns_result} {{ ) .unwrap(); } + writeln!( + output, + "\npub fn __main_fn() -> impl std::process::Termination {{ main() }} \n}}\n" + ) + .unwrap(); } let not_running = ignore || scraped_test.langstr.no_run; writeln!( - output, + output_merged_tests, " +mod {test_id} {{ pub const TEST: test::TestDescAndFn = test::TestDescAndFn::new_doctest( {test_name:?}, {ignore}, {file:?}, {line}, {no_run}, {should_panic}, test::StaticTestFn( @@ -242,7 +255,7 @@ test::StaticTestFn( if let Some(bin_path) = crate::__doctest_mod::doctest_path() {{ test::assert_test_result(crate::__doctest_mod::doctest_runner(bin_path, {id})) }} else {{ - test::assert_test_result(self::main()) + test::assert_test_result(doctest_bundle::{test_id}::__main_fn()) }} ", ) diff --git a/tests/run-make/doctests-merge/rmake.rs b/tests/run-make/doctests-merge/rmake.rs index a25da7403e24b..a88b050c50fa8 100644 --- a/tests/run-make/doctests-merge/rmake.rs +++ b/tests/run-make/doctests-merge/rmake.rs @@ -8,7 +8,6 @@ fn test_and_compare(input_file: &str, stdout_file: &str, edition: &str, dep: &Pa let output = cmd .input(input_file) .arg("--test") - .arg("-Zunstable-options") .edition(edition) .arg("--test-args=--test-threads=1") .extern_("foo", dep.display().to_string()) diff --git a/tests/rustdoc-ui/doctest/doctest-output.rs b/tests/rustdoc-ui/doctest/doctest-output.rs index fb4ab06800019..04bd1813b4c81 100644 --- a/tests/rustdoc-ui/doctest/doctest-output.rs +++ b/tests/rustdoc-ui/doctest/doctest-output.rs @@ -2,7 +2,7 @@ //@[edition2015]edition:2015 //@[edition2015]aux-build:extern_macros.rs //@[edition2015]compile-flags:--test --test-args=--test-threads=1 -//@[edition2024]edition:2015 +//@[edition2024]edition:2024 //@[edition2024]aux-build:extern_macros.rs //@[edition2024]compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" diff --git a/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2015.stdout b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2015.stdout new file mode 100644 index 0000000000000..ce767fb8443d8 --- /dev/null +++ b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2015.stdout @@ -0,0 +1,28 @@ + +running 1 test +test $DIR/failed-doctest-test-crate.rs - m (line 14) ... FAILED + +failures: + +---- $DIR/failed-doctest-test-crate.rs - m (line 14) stdout ---- +error[E0432]: unresolved import `test` + --> $DIR/failed-doctest-test-crate.rs:15:5 + | +LL | use test::*; + | ^^^^ use of unresolved module or unlinked crate `test` + | +help: you might be missing a crate named `test`, add it to your project and import it in your code + | +LL + extern crate test; + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0432`. +Couldn't compile the test. + +failures: + $DIR/failed-doctest-test-crate.rs - m (line 14) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2024.stdout b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2024.stdout new file mode 100644 index 0000000000000..80642e93bbde7 --- /dev/null +++ b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.edition2024.stdout @@ -0,0 +1,25 @@ + +running 1 test +test $DIR/failed-doctest-test-crate.rs - m (line 14) ... FAILED + +failures: + +---- $DIR/failed-doctest-test-crate.rs - m (line 14) stdout ---- +error[E0432]: unresolved import `test` + --> $DIR/failed-doctest-test-crate.rs:15:5 + | +LL | use test::*; + | ^^^^ use of unresolved module or unlinked crate `test` + | + = help: you might be missing a crate named `test` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0432`. +Couldn't compile the test. + +failures: + $DIR/failed-doctest-test-crate.rs - m (line 14) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/doctest/failed-doctest-test-crate.rs b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.rs new file mode 100644 index 0000000000000..6966d3df11ce7 --- /dev/null +++ b/tests/rustdoc-ui/doctest/failed-doctest-test-crate.rs @@ -0,0 +1,17 @@ +// FIXME: if/when the output of the test harness can be tested on its own, this test should be +// adapted to use that, and that normalize line can go away + +//@ revisions: edition2015 edition2024 +//@[edition2015]edition:2015 +//@[edition2024]edition:2024 +//@ compile-flags:--test +//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" +//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" +//@ failure-status: 101 + +/// +/// +/// ```rust +/// use test::*; +/// ``` +pub mod m {} From 4d1e502122b7d16091ca47a068b49c4a5159a91d Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 6 Mar 2025 18:17:10 +0000 Subject: [PATCH 33/64] Revert "Rollup merge of #136274 - compiler-errors:sized-wf, r=lcnr" This reverts commit a8ecb79d19e1bad732dae7f34f2481499db12f7c, reversing changes made to 40c4e05013c1805044ae2611ba0b95c0acecd331. (cherry picked from commit 9ea587e023dfa4458c5003ba74ae02bd146ec2df) --- .../rustc_hir_analysis/src/check/wfcheck.rs | 35 +-- compiler/rustc_hir_typeck/src/check.rs | 19 +- compiler/rustc_hir_typeck/src/lib.rs | 2 + .../traits/fulfillment_errors.rs | 5 + .../src/error_reporting/traits/overflow.rs | 1 + .../src/error_reporting/traits/suggestions.rs | 65 +++++- tests/crashes/134355.rs | 6 + .../primitives/primitive_impls.rs | 5 +- .../custom_code_classes_in_docs-warning3.rs | 5 +- ...ustom_code_classes_in_docs-warning3.stderr | 4 +- tests/rustdoc/cfg_doc_reexport.rs | 5 +- tests/rustdoc/cross-crate-primitive-doc.rs | 5 +- tests/rustdoc/intra-doc/no-doc-primitive.rs | 5 - .../reexport-trait-from-hidden-111064-2.rs | 5 +- tests/rustdoc/safe-intrinsic.rs | 5 +- tests/ui/associated-consts/issue-58022.stderr | 18 +- tests/ui/consts/const-slice-array-deref.rs | 1 + .../ui/consts/const-slice-array-deref.stderr | 13 +- tests/ui/consts/const-unsized.rs | 8 +- tests/ui/consts/const-unsized.stderr | 54 +++-- .../consts/const_refs_to_static-ice-121413.rs | 2 + .../const_refs_to_static-ice-121413.stderr | 11 +- tests/ui/error-codes/E0746.stderr | 4 +- tests/ui/extern-flag/empty-extern-arg.stderr | 4 - ...ible-trait-in-return-position-dyn-trait.rs | 2 +- ...-trait-in-return-position-dyn-trait.stderr | 38 ++-- .../dyn-trait-return-should-be-impl-trait.rs | 2 - ...n-trait-return-should-be-impl-trait.stderr | 204 ++++++++---------- ...-to-type-err-cause-on-impl-trait-return.rs | 6 +- ...type-err-cause-on-impl-trait-return.stderr | 118 +++++----- tests/ui/issues/issue-18107.rs | 2 +- tests/ui/issues/issue-18107.stderr | 2 +- tests/ui/issues/issue-5883.rs | 2 +- tests/ui/issues/issue-5883.stderr | 16 +- tests/ui/lang-items/lang-item-missing.stderr | 4 - tests/ui/privacy/privacy2.rs | 4 - tests/ui/privacy/privacy2.stderr | 38 +--- tests/ui/privacy/privacy3.rs | 4 - tests/ui/privacy/privacy3.stderr | 32 +-- .../issue-59191-replace-root-with-fn.stderr | 6 - tests/ui/static/issue-24446.rs | 1 + tests/ui/static/issue-24446.stderr | 16 +- tests/ui/statics/unsized_type2.stderr | 14 +- ...-incompatible-trait-references-self.stderr | 24 +-- .../ice-unsized-tuple-const-issue-121443.rs | 1 + ...ce-unsized-tuple-const-issue-121443.stderr | 15 +- .../const-traits/span-bug-issue-121418.stderr | 22 +- .../opaque-type-unsatisfied-bound.rs | 7 +- .../opaque-type-unsatisfied-bound.stderr | 26 +-- .../opaque-type-unsatisfied-fn-bound.rs | 2 +- .../opaque-type-unsatisfied-fn-bound.stderr | 6 +- tests/ui/typeck/issue-105946.rs | 1 - tests/ui/typeck/issue-105946.stderr | 23 +- tests/ui/unsized/box-instead-of-dyn-fn.rs | 2 +- tests/ui/unsized/box-instead-of-dyn-fn.stderr | 2 +- tests/ui/unsized/issue-91801.rs | 2 +- tests/ui/unsized/issue-91801.stderr | 2 +- tests/ui/unsized/issue-91803.rs | 2 +- tests/ui/unsized/issue-91803.stderr | 2 +- tests/ui/where-clauses/ignore-err-clauses.rs | 1 - .../where-clauses/ignore-err-clauses.stderr | 13 +- 61 files changed, 430 insertions(+), 521 deletions(-) create mode 100644 tests/crashes/134355.rs diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 4218f4ef0c157..dc7f9901c940e 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -1110,7 +1110,6 @@ fn check_associated_item( let ty = tcx.type_of(item.def_id).instantiate_identity(); let ty = wfcx.normalize(span, Some(WellFormedLoc::Ty(item_id)), ty); wfcx.register_wf_obligation(span, loc, ty.into()); - check_sized_if_body(wfcx, item.def_id.expect_local(), ty, Some(span)); Ok(()) } ty::AssocKind::Fn => { @@ -1235,7 +1234,7 @@ fn check_type_defn<'tcx>( ), wfcx.param_env, ty, - tcx.require_lang_item(LangItem::Sized, Some(hir_ty.span)), + tcx.require_lang_item(LangItem::Sized, None), ); } @@ -1360,7 +1359,7 @@ fn check_item_type( ), wfcx.param_env, item_ty, - tcx.require_lang_item(LangItem::Sized, Some(ty_span)), + tcx.require_lang_item(LangItem::Sized, None), ); } @@ -1690,36 +1689,6 @@ fn check_fn_or_method<'tcx>( ); } } - - // If the function has a body, additionally require that the return type is sized. - check_sized_if_body( - wfcx, - def_id, - sig.output(), - match hir_decl.output { - hir::FnRetTy::Return(ty) => Some(ty.span), - hir::FnRetTy::DefaultReturn(_) => None, - }, - ); -} - -fn check_sized_if_body<'tcx>( - wfcx: &WfCheckingCtxt<'_, 'tcx>, - def_id: LocalDefId, - ty: Ty<'tcx>, - maybe_span: Option, -) { - let tcx = wfcx.tcx(); - if let Some(body) = tcx.hir().maybe_body_owned_by(def_id) { - let span = maybe_span.unwrap_or(body.value.span); - - wfcx.register_bound( - ObligationCause::new(span, def_id, traits::ObligationCauseCode::SizedReturnType), - wfcx.param_env, - ty, - tcx.require_lang_item(LangItem::Sized, Some(span)), - ); - } } /// The `arbitrary_self_types_pointers` feature implies `arbitrary_self_types`. diff --git a/compiler/rustc_hir_typeck/src/check.rs b/compiler/rustc_hir_typeck/src/check.rs index 6fb5f6af0913a..fc63499677f33 100644 --- a/compiler/rustc_hir_typeck/src/check.rs +++ b/compiler/rustc_hir_typeck/src/check.rs @@ -117,17 +117,22 @@ pub(super) fn check_fn<'a, 'tcx>( fcx.typeck_results.borrow_mut().liberated_fn_sigs_mut().insert(fn_id, fn_sig); - // We checked the root's ret ty during wfcheck, but not the child. - if fcx.tcx.is_typeck_child(fn_def_id.to_def_id()) { - let return_or_body_span = match decl.output { - hir::FnRetTy::DefaultReturn(_) => body.value.span, - hir::FnRetTy::Return(ty) => ty.span, - }; + let return_or_body_span = match decl.output { + hir::FnRetTy::DefaultReturn(_) => body.value.span, + hir::FnRetTy::Return(ty) => ty.span, + }; + fcx.require_type_is_sized( + declared_ret_ty, + return_or_body_span, + ObligationCauseCode::SizedReturnType, + ); + // We checked the root's signature during wfcheck, but not the child. + if fcx.tcx.is_typeck_child(fn_def_id.to_def_id()) { fcx.require_type_is_sized( declared_ret_ty, return_or_body_span, - ObligationCauseCode::SizedReturnType, + ObligationCauseCode::WellFormed(None), ); } diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 02fbd46173c47..07e013e4afa67 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -186,6 +186,8 @@ fn typeck_with_inspect<'tcx>( let wf_code = ObligationCauseCode::WellFormed(Some(WellFormedLoc::Ty(def_id))); fcx.register_wf_obligation(expected_type.into(), body.value.span, wf_code); + fcx.require_type_is_sized(expected_type, body.value.span, ObligationCauseCode::ConstSized); + // Gather locals in statics (because of block expressions). GatherLocalsVisitor::new(&fcx).visit_body(body); diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 49fa21e50c059..57440d60de1f4 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -707,6 +707,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { }; self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); err.emit() } } @@ -809,6 +810,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { "Async", ); self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); return Some(err.emit()); } } @@ -854,6 +856,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { "", ); self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); return Some(err.emit()); } @@ -869,6 +872,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { kind: expected_kind.as_str(), }); self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); return Some(err.emit()); } } @@ -2829,6 +2833,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { err.span_note(self.tcx.def_span(def_id), "opaque type is declared here"); self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); self.dcx().try_steal_replace_and_emit_err(self.tcx.def_span(def_id), StashKey::Cycle, err) } diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs index c5ed74420d4d2..fad03b5e9bf5a 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs @@ -185,6 +185,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { suggest_increasing_limit, ); self.note_obligation_cause(&mut err, &obligation); + self.point_at_returns_when_relevant(&mut err, &obligation); err.emit() } } diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index 527d2e54e4327..21564c147a35d 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -1765,7 +1765,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { }; err.code(E0746); - err.primary_message("return type cannot be a trait object without pointer indirection"); + err.primary_message("return type cannot have an unboxed trait object"); err.children.clear(); let span = obligation.cause.span; @@ -1781,13 +1781,25 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } else { ("dyn ", span.shrink_to_lo()) }; - - err.span_suggestion_verbose( - impl_span, - "consider returning an `impl Trait` instead of a `dyn Trait`", - "impl ", - Applicability::MaybeIncorrect, - ); + let alternatively = if visitor + .returns + .iter() + .map(|expr| self.typeck_results.as_ref().unwrap().expr_ty_adjusted_opt(expr)) + .collect::>() + .len() + <= 1 + { + err.span_suggestion_verbose( + impl_span, + "consider returning an `impl Trait` instead of a `dyn Trait`", + "impl ", + Applicability::MaybeIncorrect, + ); + "alternatively, " + } else { + err.help("if there were a single returned type, you could use `impl Trait` instead"); + "" + }; let mut sugg = vec![ (span.shrink_to_lo(), format!("Box<{pre}")), @@ -1819,7 +1831,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { err.multipart_suggestion( format!( - "alternatively, box the return type, and wrap all of the returned values in \ + "{alternatively}box the return type, and wrap all of the returned values in \ `Box::new`", ), sugg, @@ -1829,6 +1841,41 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { true } + pub(super) fn point_at_returns_when_relevant( + &self, + err: &mut Diag<'_>, + obligation: &PredicateObligation<'tcx>, + ) { + match obligation.cause.code().peel_derives() { + ObligationCauseCode::SizedReturnType => {} + _ => return, + } + + let hir = self.tcx.hir(); + let node = self.tcx.hir_node_by_def_id(obligation.cause.body_id); + if let hir::Node::Item(hir::Item { + kind: hir::ItemKind::Fn { body: body_id, .. }, .. + }) = node + { + let body = hir.body(*body_id); + // Point at all the `return`s in the function as they have failed trait bounds. + let mut visitor = ReturnsVisitor::default(); + visitor.visit_body(body); + let typeck_results = self.typeck_results.as_ref().unwrap(); + for expr in &visitor.returns { + if let Some(returned_ty) = typeck_results.node_type_opt(expr.hir_id) { + let ty = self.resolve_vars_if_possible(returned_ty); + if ty.references_error() { + // don't print out the [type error] here + err.downgrade_to_delayed_bug(); + } else { + err.span_label(expr.span, format!("this returned value is of type `{ty}`")); + } + } + } + } + } + pub(super) fn report_closure_arg_mismatch( &self, span: Span, diff --git a/tests/crashes/134355.rs b/tests/crashes/134355.rs new file mode 100644 index 0000000000000..b662341e6b1b3 --- /dev/null +++ b/tests/crashes/134355.rs @@ -0,0 +1,6 @@ +//@ known-bug: #134355 + +//@compile-flags: --crate-type=lib +fn digit() -> str { + return { i32::MIN }; +} diff --git a/tests/rustdoc-json/primitives/primitive_impls.rs b/tests/rustdoc-json/primitives/primitive_impls.rs index 58c222ce4f0b1..77d1d68f8e4e2 100644 --- a/tests/rustdoc-json/primitives/primitive_impls.rs +++ b/tests/rustdoc-json/primitives/primitive_impls.rs @@ -1,4 +1,4 @@ -#![feature(no_core, lang_items)] +#![feature(no_core)] #![feature(rustc_attrs)] #![feature(rustdoc_internals)] #![no_core] @@ -6,9 +6,6 @@ //@ set impl_i32 = "$.index[*][?(@.docs=='Only core can do this')].id" -#[lang = "sized"] -trait Sized {} - /// Only core can do this impl i32 { //@ set identity = "$.index[*][?(@.docs=='Do Nothing')].id" diff --git a/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs b/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs index 18ac37280c0ef..6b1aa455d9818 100644 --- a/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs +++ b/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs @@ -2,12 +2,9 @@ // feature. #![deny(warnings)] -#![feature(no_core, lang_items)] +#![feature(no_core)] #![no_core] -#[lang = "sized"] -trait Sized {} - /// ```{class="} /// main; /// ``` diff --git a/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.stderr b/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.stderr index cc13cc0fe531b..385b2ccacc1b3 100644 --- a/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.stderr +++ b/tests/rustdoc-ui/custom_code_classes_in_docs-warning3.stderr @@ -1,5 +1,5 @@ error: unclosed quote string `"` - --> $DIR/custom_code_classes_in_docs-warning3.rs:11:1 + --> $DIR/custom_code_classes_in_docs-warning3.rs:8:1 | LL | / /// ```{class="} LL | | /// main; @@ -17,7 +17,7 @@ LL | #![deny(warnings)] = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]` error: unclosed quote string `"` - --> $DIR/custom_code_classes_in_docs-warning3.rs:11:1 + --> $DIR/custom_code_classes_in_docs-warning3.rs:8:1 | LL | / /// ```{class="} LL | | /// main; diff --git a/tests/rustdoc/cfg_doc_reexport.rs b/tests/rustdoc/cfg_doc_reexport.rs index 44ec366328413..f8101e2a95807 100644 --- a/tests/rustdoc/cfg_doc_reexport.rs +++ b/tests/rustdoc/cfg_doc_reexport.rs @@ -1,12 +1,9 @@ #![feature(doc_cfg)] -#![feature(no_core, lang_items)] +#![feature(no_core)] #![crate_name = "foo"] #![no_core] -#[lang = "sized"] -trait Sized {} - //@ has 'foo/index.html' //@ has - '//dt/*[@class="stab portability"]' 'foobar' //@ has - '//dt/*[@class="stab portability"]' 'bar' diff --git a/tests/rustdoc/cross-crate-primitive-doc.rs b/tests/rustdoc/cross-crate-primitive-doc.rs index 0ffde5b0f2d80..ca33dedcbaec7 100644 --- a/tests/rustdoc/cross-crate-primitive-doc.rs +++ b/tests/rustdoc/cross-crate-primitive-doc.rs @@ -2,12 +2,9 @@ //@ compile-flags: --extern-html-root-url=primitive_doc=../ -Z unstable-options //@ only-linux -#![feature(no_core, lang_items)] +#![feature(no_core)] #![no_core] -#[lang = "sized"] -trait Sized {} - extern crate primitive_doc; //@ has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize' diff --git a/tests/rustdoc/intra-doc/no-doc-primitive.rs b/tests/rustdoc/intra-doc/no-doc-primitive.rs index 79825643b98ce..1f8622ab867ce 100644 --- a/tests/rustdoc/intra-doc/no-doc-primitive.rs +++ b/tests/rustdoc/intra-doc/no-doc-primitive.rs @@ -6,13 +6,8 @@ #![rustc_coherence_is_core] #![crate_type = "rlib"] - //@ has no_doc_primitive/index.html //! A [`char`] and its [`char::len_utf8`]. - -#[lang = "sized"] -trait Sized {} - impl char { pub fn len_utf8(self) -> usize { 42 diff --git a/tests/rustdoc/reexport-trait-from-hidden-111064-2.rs b/tests/rustdoc/reexport-trait-from-hidden-111064-2.rs index 61060b3ff7c74..2b21f9862b447 100644 --- a/tests/rustdoc/reexport-trait-from-hidden-111064-2.rs +++ b/tests/rustdoc/reexport-trait-from-hidden-111064-2.rs @@ -1,11 +1,8 @@ // Regression test for . -#![feature(no_core, lang_items)] +#![feature(no_core)] #![no_core] #![crate_name = "foo"] -#[lang = "sized"] -trait Sized {} - //@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \ // 'visible']" //@ files "foo/hidden" "['inner']" diff --git a/tests/rustdoc/safe-intrinsic.rs b/tests/rustdoc/safe-intrinsic.rs index 1edc1d9f79b91..07af04ace6031 100644 --- a/tests/rustdoc/safe-intrinsic.rs +++ b/tests/rustdoc/safe-intrinsic.rs @@ -1,13 +1,10 @@ #![feature(intrinsics)] -#![feature(no_core, lang_items)] +#![feature(no_core)] #![feature(rustc_attrs)] #![no_core] #![crate_name = "foo"] -#[lang = "sized"] -trait Sized {} - //@ has 'foo/fn.abort.html' //@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !' #[rustc_intrinsic] diff --git a/tests/ui/associated-consts/issue-58022.stderr b/tests/ui/associated-consts/issue-58022.stderr index 37cb162b2b221..82cbc9ed3b094 100644 --- a/tests/ui/associated-consts/issue-58022.stderr +++ b/tests/ui/associated-consts/issue-58022.stderr @@ -1,3 +1,12 @@ +error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type + --> $DIR/issue-58022.rs:4:25 + | +LL | const SIZE: usize; + | ------------------ `Foo::SIZE` defined here +LL | +LL | fn new(slice: &[u8; Foo::SIZE]) -> Self; + | ^^^^^^^^^ cannot refer to the associated constant of trait + error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/issue-58022.rs:13:41 | @@ -12,15 +21,6 @@ LL | pub struct Bar(T); | ^^^ = note: the return type of a function must have a statically known size -error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type - --> $DIR/issue-58022.rs:4:25 - | -LL | const SIZE: usize; - | ------------------ `Foo::SIZE` defined here -LL | -LL | fn new(slice: &[u8; Foo::SIZE]) -> Self; - | ^^^^^^^^^ cannot refer to the associated constant of trait - error[E0423]: expected function, tuple struct or tuple variant, found trait `Foo` --> $DIR/issue-58022.rs:15:9 | diff --git a/tests/ui/consts/const-slice-array-deref.rs b/tests/ui/consts/const-slice-array-deref.rs index 99563ac968c91..9d84ed4bdb019 100644 --- a/tests/ui/consts/const-slice-array-deref.rs +++ b/tests/ui/consts/const-slice-array-deref.rs @@ -1,5 +1,6 @@ const ONE: [u16] = [1]; //~^ ERROR the size for values of type `[u16]` cannot be known at compilation time +//~| ERROR the size for values of type `[u16]` cannot be known at compilation time //~| ERROR mismatched types const TWO: &'static u16 = &ONE[0]; diff --git a/tests/ui/consts/const-slice-array-deref.stderr b/tests/ui/consts/const-slice-array-deref.stderr index 346685380cc6c..6e69744144ed9 100644 --- a/tests/ui/consts/const-slice-array-deref.stderr +++ b/tests/ui/consts/const-slice-array-deref.stderr @@ -12,13 +12,22 @@ error[E0308]: mismatched types LL | const ONE: [u16] = [1]; | ^^^ expected `[u16]`, found `[u16; 1]` +error[E0277]: the size for values of type `[u16]` cannot be known at compilation time + --> $DIR/const-slice-array-deref.rs:1:20 + | +LL | const ONE: [u16] = [1]; + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[u16]` + = note: constant expressions must have a statically known size + error[E0161]: cannot move a value of type `[u16]` - --> $DIR/const-slice-array-deref.rs:5:28 + --> $DIR/const-slice-array-deref.rs:6:28 | LL | const TWO: &'static u16 = &ONE[0]; | ^^^ the size of `[u16]` cannot be statically determined -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0161, E0277, E0308. For more information about an error, try `rustc --explain E0161`. diff --git a/tests/ui/consts/const-unsized.rs b/tests/ui/consts/const-unsized.rs index e8af3323cebfe..18682aa6eb61f 100644 --- a/tests/ui/consts/const-unsized.rs +++ b/tests/ui/consts/const-unsized.rs @@ -2,19 +2,19 @@ use std::fmt::Debug; const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference +//~| ERROR the size for values of type const CONST_FOO: str = *"foo"; //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference +//~| ERROR the size for values of type static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference +//~| ERROR the size for values of type static STATIC_BAR: str = *"bar"; //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference +//~| ERROR the size for values of type fn main() { println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); diff --git a/tests/ui/consts/const-unsized.stderr b/tests/ui/consts/const-unsized.stderr index 7931d7adafdb1..0b69cad96510c 100644 --- a/tests/ui/consts/const-unsized.stderr +++ b/tests/ui/consts/const-unsized.stderr @@ -6,6 +6,15 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); | = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` +error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time + --> $DIR/const-unsized.rs:3:35 + | +LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = note: constant expressions must have a statically known size + error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:7:18 | @@ -14,6 +23,15 @@ LL | const CONST_FOO: str = *"foo"; | = help: the trait `Sized` is not implemented for `str` +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/const-unsized.rs:7:24 + | +LL | const CONST_FOO: str = *"foo"; + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: constant expressions must have a statically known size + error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:11:18 | @@ -22,6 +40,15 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); | = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` +error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time + --> $DIR/const-unsized.rs:11:37 + | +LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = note: constant expressions must have a statically known size + error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:15:20 | @@ -30,29 +57,14 @@ LL | static STATIC_BAR: str = *"bar"; | = help: the trait `Sized` is not implemented for `str` -error[E0507]: cannot move out of a shared reference - --> $DIR/const-unsized.rs:3:35 - | -LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait - -error[E0507]: cannot move out of a shared reference - --> $DIR/const-unsized.rs:7:24 - | -LL | const CONST_FOO: str = *"foo"; - | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait - -error[E0507]: cannot move out of a shared reference - --> $DIR/const-unsized.rs:11:37 - | -LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait - -error[E0507]: cannot move out of a shared reference +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:15:26 | LL | static STATIC_BAR: str = *"bar"; - | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: constant expressions must have a statically known size error[E0161]: cannot move a value of type `str` --> $DIR/const-unsized.rs:20:48 @@ -68,5 +80,5 @@ LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATI error: aborting due to 10 previous errors -Some errors have detailed explanations: E0161, E0277, E0507. +Some errors have detailed explanations: E0161, E0277. For more information about an error, try `rustc --explain E0161`. diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.rs b/tests/ui/consts/const_refs_to_static-ice-121413.rs index 432ae1ad5e3be..7ef67d9a98462 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.rs +++ b/tests/ui/consts/const_refs_to_static-ice-121413.rs @@ -9,9 +9,11 @@ const REF_INTERIOR_MUT: &usize = { //~^ ERROR failed to resolve: use of undeclared type `AtomicUsize` //~| WARN trait objects without an explicit `dyn` are deprecated //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time + //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| HELP if this is a dyn-compatible trait, use `dyn` //~| HELP the trait `Sized` is not implemented for `(dyn Sync + 'static)` + //~| HELP the trait `Sized` is not implemented for `(dyn Sync + 'static)` unsafe { &*(&FOO as *const _ as *const usize) } }; pub fn main() {} diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.stderr b/tests/ui/consts/const_refs_to_static-ice-121413.stderr index 8665d9b685223..7beb43d84fb0f 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.stderr +++ b/tests/ui/consts/const_refs_to_static-ice-121413.stderr @@ -31,7 +31,16 @@ LL | static FOO: Sync = AtomicUsize::new(0); | = help: the trait `Sized` is not implemented for `(dyn Sync + 'static)` -error: aborting due to 2 previous errors; 1 warning emitted +error[E0277]: the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time + --> $DIR/const_refs_to_static-ice-121413.rs:8:24 + | +LL | static FOO: Sync = AtomicUsize::new(0); + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Sync + 'static)` + = note: constant expressions must have a statically known size + +error: aborting due to 3 previous errors; 1 warning emitted Some errors have detailed explanations: E0277, E0433. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/error-codes/E0746.stderr b/tests/ui/error-codes/E0746.stderr index 07d6b285f764a..7155f3d733cdf 100644 --- a/tests/ui/error-codes/E0746.stderr +++ b/tests/ui/error-codes/E0746.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/E0746.rs:8:13 | LL | fn foo() -> dyn Trait { Struct } @@ -14,7 +14,7 @@ help: alternatively, box the return type, and wrap all of the returned values in LL | fn foo() -> Box { Box::new(Struct) } | ++++ + +++++++++ + -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/E0746.rs:11:13 | LL | fn bar() -> dyn Trait { diff --git a/tests/ui/extern-flag/empty-extern-arg.stderr b/tests/ui/extern-flag/empty-extern-arg.stderr index b9a128e02e16b..2785b12a0aef4 100644 --- a/tests/ui/extern-flag/empty-extern-arg.stderr +++ b/tests/ui/extern-flag/empty-extern-arg.stderr @@ -8,10 +8,6 @@ error: unwinding panics are not supported without std = note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem error: requires `sized` lang_item - --> $DIR/empty-extern-arg.rs:6:11 - | -LL | fn main() {} - | ^^ error: aborting due to 4 previous errors diff --git a/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.rs b/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.rs index 901d4b39cf360..046ced072bac2 100644 --- a/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.rs +++ b/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.rs @@ -20,7 +20,7 @@ impl DynIncompatible for B { } fn car() -> dyn DynIncompatible { //~ ERROR the trait `DynIncompatible` is not dyn compatible -//~^ ERROR return type cannot be a trait object without pointer indirection +//~^ ERROR return type cannot have an unboxed trait object if true { return A; } diff --git a/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.stderr b/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.stderr index 2c314b07bcee9..2869702d7fc63 100644 --- a/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.stderr +++ b/tests/ui/impl-trait/dyn-incompatible-trait-in-return-position-dyn-trait.stderr @@ -26,27 +26,6 @@ help: alternatively, consider constraining `foo` so it does not apply to trait o LL | fn foo() -> Self where Self: Sized; | +++++++++++++++++ -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-incompatible-trait-in-return-position-dyn-trait.rs:22:13 - | -LL | fn car() -> dyn DynIncompatible { - | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn car() -> dyn DynIncompatible { -LL + fn car() -> impl DynIncompatible { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn car() -> Box { -LL | -LL | if true { -LL ~ return Box::new(A); -LL | } -LL ~ Box::new(B) - | - error[E0038]: the trait `DynIncompatible` is not dyn compatible --> $DIR/dyn-incompatible-trait-in-return-position-dyn-trait.rs:30:17 | @@ -75,6 +54,23 @@ help: alternatively, consider constraining `foo` so it does not apply to trait o LL | fn foo() -> Self where Self: Sized; | +++++++++++++++++ +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-incompatible-trait-in-return-position-dyn-trait.rs:22:13 + | +LL | fn car() -> dyn DynIncompatible { + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: if there were a single returned type, you could use `impl Trait` instead +help: box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn car() -> Box { +LL | +LL | if true { +LL ~ return Box::new(A); +LL | } +LL ~ Box::new(B) + | + error[E0038]: the trait `DynIncompatible` is not dyn compatible --> $DIR/dyn-incompatible-trait-in-return-position-dyn-trait.rs:32:16 | diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.rs b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.rs index ccf0a1ad3d443..af368203de021 100644 --- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.rs +++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.rs @@ -6,11 +6,9 @@ impl Trait for u32 {} fn fuz() -> (usize, Trait) { (42, Struct) } //~^ ERROR E0277 -//~| ERROR E0277 //~| ERROR E0308 fn bar() -> (usize, dyn Trait) { (42, Struct) } //~^ ERROR E0277 -//~| ERROR E0277 //~| ERROR E0308 fn bap() -> Trait { Struct } //~^ ERROR E0746 diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr index 304d7d43b78b3..db06363eb628d 100644 --- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr +++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr @@ -1,25 +1,49 @@ +error[E0308]: mismatched types + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:35 + | +LL | fn fuz() -> (usize, Trait) { (42, Struct) } + | ^^^^^^ expected `dyn Trait`, found `Struct` + | + = note: expected trait object `(dyn Trait + 'static)` + found struct `Struct` + = help: `Struct` implements `Trait` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well + error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:13 | LL | fn fuz() -> (usize, Trait) { (42, Struct) } - | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | ^^^^^^^^^^^^^^ ------------ this returned value is of type `(usize, (dyn Trait + 'static))` + | | + | doesn't have a size known at compile-time | = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` = note: required because it appears within the type `(usize, (dyn Trait + 'static))` = note: the return type of a function must have a statically known size +error[E0308]: mismatched types + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:10:39 + | +LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } + | ^^^^^^ expected `dyn Trait`, found `Struct` + | + = note: expected trait object `(dyn Trait + 'static)` + found struct `Struct` + = help: `Struct` implements `Trait` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well + error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:11:13 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:10:13 | LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } - | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | ^^^^^^^^^^^^^^^^^^ ------------ this returned value is of type `(usize, (dyn Trait + 'static))` + | | + | doesn't have a size known at compile-time | = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` = note: required because it appears within the type `(usize, (dyn Trait + 'static))` = note: the return type of a function must have a statically known size -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:15:13 +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:13:13 | LL | fn bap() -> Trait { Struct } | ^^^^^ doesn't have a size known at compile-time @@ -33,8 +57,8 @@ help: alternatively, box the return type, and wrap all of the returned values in LL | fn bap() -> Box { Box::new(Struct) } | +++++++ + +++++++++ + -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:17:13 +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:15:13 | LL | fn ban() -> dyn Trait { Struct } | ^^^^^^^^^ doesn't have a size known at compile-time @@ -49,8 +73,8 @@ help: alternatively, box the return type, and wrap all of the returned values in LL | fn ban() -> Box { Box::new(Struct) } | ++++ + +++++++++ + -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:19:13 +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:17:13 | LL | fn bak() -> dyn Trait { unimplemented!() } | ^^^^^^^^^ doesn't have a size known at compile-time @@ -65,18 +89,14 @@ help: alternatively, box the return type, and wrap all of the returned values in LL | fn bak() -> Box { Box::new(unimplemented!()) } | ++++ + +++++++++ + -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:21:13 +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:19:13 | LL | fn bal() -> dyn Trait { | ^^^^^^^^^ doesn't have a size known at compile-time | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn bal() -> dyn Trait { -LL + fn bal() -> impl Trait { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + = help: if there were a single returned type, you could use `impl Trait` instead +help: box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bal() -> Box { LL | if true { @@ -85,18 +105,14 @@ LL | } LL ~ Box::new(42) | -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:27:13 +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:25:13 | LL | fn bax() -> dyn Trait { | ^^^^^^^^^ doesn't have a size known at compile-time | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn bax() -> dyn Trait { -LL + fn bax() -> impl Trait { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + = help: if there were a single returned type, you could use `impl Trait` instead +help: box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bax() -> Box { LL | if true { @@ -105,88 +121,8 @@ LL | } else { LL ~ Box::new(42) | -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:62:13 - | -LL | fn bat() -> dyn Trait { - | ^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn bat() -> dyn Trait { -LL + fn bat() -> impl Trait { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn bat() -> Box { -LL | if true { -LL ~ return Box::new(0); -LL | } -LL ~ Box::new(42) - | - -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:68:13 - | -LL | fn bay() -> dyn Trait { - | ^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn bay() -> dyn Trait { -LL + fn bay() -> impl Trait { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn bay() -> Box { -LL | if true { -LL ~ Box::new(0) -LL | } else { -LL ~ Box::new(42) - | - -error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:35 - | -LL | fn fuz() -> (usize, Trait) { (42, Struct) } - | ^^^^^^ expected `dyn Trait`, found `Struct` - | - = note: expected trait object `(dyn Trait + 'static)` - found struct `Struct` - = help: `Struct` implements `Trait` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well - -error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:30 - | -LL | fn fuz() -> (usize, Trait) { (42, Struct) } - | ^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` - = note: required because it appears within the type `(usize, (dyn Trait + 'static))` - = note: tuples must have a statically known size to be initialized - -error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:11:39 - | -LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } - | ^^^^^^ expected `dyn Trait`, found `Struct` - | - = note: expected trait object `(dyn Trait + 'static)` - found struct `Struct` - = help: `Struct` implements `Trait` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well - -error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:11:34 - | -LL | fn bar() -> (usize, dyn Trait) { (42, Struct) } - | ^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)` - = note: required because it appears within the type `(usize, (dyn Trait + 'static))` - = note: tuples must have a statically known size to be initialized - error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:36:16 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:34:16 | LL | fn bam() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -203,7 +139,7 @@ LL | return Box::new(Struct); | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:38:5 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:36:5 | LL | fn bam() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -220,7 +156,7 @@ LL | Box::new(42) | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:42:16 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:40:16 | LL | fn baq() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -237,7 +173,7 @@ LL | return Box::new(0); | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:44:5 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:42:5 | LL | fn baq() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -254,7 +190,7 @@ LL | Box::new(42) | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:48:9 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:46:9 | LL | fn baz() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -271,7 +207,7 @@ LL | Box::new(Struct) | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:50:9 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:48:9 | LL | fn baz() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -288,7 +224,7 @@ LL | Box::new(42) | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:55:9 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:53:9 | LL | fn baw() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -305,7 +241,7 @@ LL | Box::new(0) | +++++++++ + error[E0308]: mismatched types - --> $DIR/dyn-trait-return-should-be-impl-trait.rs:57:9 + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:55:9 | LL | fn baw() -> Box { | -------------- expected `Box<(dyn Trait + 'static)>` because of return type @@ -321,7 +257,47 @@ help: store this in the heap by calling `Box::new` LL | Box::new(42) | +++++++++ + -error: aborting due to 21 previous errors +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:60:13 + | +LL | fn bat() -> dyn Trait { + | ^^^^^^^^^ doesn't have a size known at compile-time + | +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL - fn bat() -> dyn Trait { +LL + fn bat() -> impl Trait { + | +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn bat() -> Box { +LL | if true { +LL ~ return Box::new(0); +LL | } +LL ~ Box::new(42) + | + +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/dyn-trait-return-should-be-impl-trait.rs:66:13 + | +LL | fn bay() -> dyn Trait { + | ^^^^^^^^^ doesn't have a size known at compile-time + | +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL - fn bay() -> dyn Trait { +LL + fn bay() -> impl Trait { + | +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn bay() -> Box { +LL | if true { +LL ~ Box::new(0) +LL | } else { +LL ~ Box::new(42) + | + +error: aborting due to 19 previous errors Some errors have detailed explanations: E0277, E0308, E0746. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs index 719edd525dea9..a8a6288eb56fb 100644 --- a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs +++ b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs @@ -63,7 +63,7 @@ fn dog() -> impl std::fmt::Display { } } -fn hat() -> dyn std::fmt::Display { //~ ERROR return type cannot be a trait object without pointer indirection +fn hat() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object match 13 { 0 => { return 0i32; @@ -74,7 +74,7 @@ fn hat() -> dyn std::fmt::Display { //~ ERROR return type cannot be a trait obje } } -fn pug() -> dyn std::fmt::Display { //~ ERROR return type cannot be a trait object without pointer indirection +fn pug() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object match 13 { 0 => 0i32, 1 => 1u32, @@ -82,7 +82,7 @@ fn pug() -> dyn std::fmt::Display { //~ ERROR return type cannot be a trait obje } } -fn man() -> dyn std::fmt::Display { //~ ERROR return type cannot be a trait object without pointer indirection +fn man() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object if false { 0i32 } else { diff --git a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr index b2aa0e592df7a..041f343da9042 100644 --- a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr @@ -1,65 +1,3 @@ -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:66:13 - | -LL | fn hat() -> dyn std::fmt::Display { - | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn hat() -> dyn std::fmt::Display { -LL + fn hat() -> impl std::fmt::Display { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn hat() -> Box { -LL | match 13 { -LL | 0 => { -LL ~ return Box::new(0i32); -LL | } -LL | _ => { -LL ~ Box::new(1u32) - | - -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:77:13 - | -LL | fn pug() -> dyn std::fmt::Display { - | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn pug() -> dyn std::fmt::Display { -LL + fn pug() -> impl std::fmt::Display { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn pug() -> Box { -LL | match 13 { -LL ~ 0 => Box::new(0i32), -LL ~ 1 => Box::new(1u32), -LL ~ _ => Box::new(2u32), - | - -error[E0746]: return type cannot be a trait object without pointer indirection - --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:85:13 - | -LL | fn man() -> dyn std::fmt::Display { - | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -LL - fn man() -> dyn std::fmt::Display { -LL + fn man() -> impl std::fmt::Display { - | -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -LL ~ fn man() -> Box { -LL | if false { -LL ~ Box::new(0i32) -LL | } else { -LL ~ Box::new(1u32) - | - error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:5:5 | @@ -235,6 +173,62 @@ LL - 1u32 LL + 1i32 | +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:66:13 + | +LL | fn hat() -> dyn std::fmt::Display { + | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL | fn hat() -> impl std::fmt::Display { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn hat() -> Box { +LL | match 13 { +LL | 0 => { +LL ~ return Box::new(0i32); +LL | } +LL | _ => { +LL ~ Box::new(1u32) + | + +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:77:13 + | +LL | fn pug() -> dyn std::fmt::Display { + | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL | fn pug() -> impl std::fmt::Display { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn pug() -> Box { +LL | match 13 { +LL ~ 0 => Box::new(0i32), +LL ~ 1 => Box::new(1u32), +LL ~ _ => Box::new(2u32), + | + +error[E0746]: return type cannot have an unboxed trait object + --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:85:13 + | +LL | fn man() -> dyn std::fmt::Display { + | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: if there were a single returned type, you could use `impl Trait` instead +help: box the return type, and wrap all of the returned values in `Box::new` + | +LL ~ fn man() -> Box { +LL | if false { +LL ~ Box::new(0i32) +LL | } else { +LL ~ Box::new(1u32) + | + error: aborting due to 12 previous errors Some errors have detailed explanations: E0308, E0746. diff --git a/tests/ui/issues/issue-18107.rs b/tests/ui/issues/issue-18107.rs index b1b6ff4f7ad26..4bf5b6c0f3032 100644 --- a/tests/ui/issues/issue-18107.rs +++ b/tests/ui/issues/issue-18107.rs @@ -2,7 +2,7 @@ pub trait AbstractRenderer {} fn _create_render(_: &()) -> dyn AbstractRenderer -//~^ ERROR return type cannot be a trait object without pointer indirection +//~^ ERROR return type cannot have an unboxed trait object { match 0 { _ => unimplemented!() diff --git a/tests/ui/issues/issue-18107.stderr b/tests/ui/issues/issue-18107.stderr index 177ef2f1c33f7..dbf2889c22336 100644 --- a/tests/ui/issues/issue-18107.stderr +++ b/tests/ui/issues/issue-18107.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/issue-18107.rs:4:5 | LL | dyn AbstractRenderer diff --git a/tests/ui/issues/issue-5883.rs b/tests/ui/issues/issue-5883.rs index dd4753e0344a0..f9dd2c54d997f 100644 --- a/tests/ui/issues/issue-5883.rs +++ b/tests/ui/issues/issue-5883.rs @@ -6,7 +6,7 @@ struct Struct { fn new_struct( r: dyn A + 'static //~ ERROR the size for values of type -) -> Struct { //~ ERROR the size for values of type +) -> Struct { Struct { r: r } } diff --git a/tests/ui/issues/issue-5883.stderr b/tests/ui/issues/issue-5883.stderr index 2ca437b8c4735..7c51c0e17af13 100644 --- a/tests/ui/issues/issue-5883.stderr +++ b/tests/ui/issues/issue-5883.stderr @@ -1,17 +1,3 @@ -error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time - --> $DIR/issue-5883.rs:9:6 - | -LL | ) -> Struct { - | ^^^^^^ doesn't have a size known at compile-time - | - = help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)` -note: required because it appears within the type `Struct` - --> $DIR/issue-5883.rs:3:8 - | -LL | struct Struct { - | ^^^^^^ - = note: the return type of a function must have a statically known size - error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time --> $DIR/issue-5883.rs:8:8 | @@ -30,6 +16,6 @@ help: function arguments must have a statically known size, borrowed types alway LL | r: &dyn A + 'static | + -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/lang-items/lang-item-missing.stderr b/tests/ui/lang-items/lang-item-missing.stderr index 63bca95adf700..08e679a7c559a 100644 --- a/tests/ui/lang-items/lang-item-missing.stderr +++ b/tests/ui/lang-items/lang-item-missing.stderr @@ -1,8 +1,4 @@ error: requires `sized` lang_item - --> $DIR/lang-item-missing.rs:11:60 - | -LL | extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 { - | ^^^ error: aborting due to 1 previous error diff --git a/tests/ui/privacy/privacy2.rs b/tests/ui/privacy/privacy2.rs index c82cd4425596f..ab6d805544eeb 100644 --- a/tests/ui/privacy/privacy2.rs +++ b/tests/ui/privacy/privacy2.rs @@ -14,20 +14,16 @@ mod bar { } pub fn foo() {} -//~^ ERROR requires `sized` lang_item fn test1() { - //~^ ERROR requires `sized` lang_item use bar::foo; //~^ ERROR unresolved import `bar::foo` [E0432] //~| no `foo` in `bar` } fn test2() { - //~^ ERROR requires `sized` lang_item use bar::glob::foo; //~^ ERROR `foo` is private } fn main() {} -//~^ ERROR requires `sized` lang_item diff --git a/tests/ui/privacy/privacy2.stderr b/tests/ui/privacy/privacy2.stderr index 39bab67a6600a..46bb9823dbf8f 100644 --- a/tests/ui/privacy/privacy2.stderr +++ b/tests/ui/privacy/privacy2.stderr @@ -1,11 +1,11 @@ error[E0432]: unresolved import `bar::foo` - --> $DIR/privacy2.rs:21:9 + --> $DIR/privacy2.rs:19:9 | LL | use bar::foo; | ^^^^^^^^ no `foo` in `bar` error[E0603]: function import `foo` is private - --> $DIR/privacy2.rs:28:20 + --> $DIR/privacy2.rs:25:20 | LL | use bar::glob::foo; | ^^^ private function import @@ -22,40 +22,8 @@ LL | pub fn foo() {} | ^^^^^^^^^^^^ you could import this directly error: requires `sized` lang_item - --> $DIR/privacy2.rs:16:14 - | -LL | pub fn foo() {} - | ^^ - -error: requires `sized` lang_item - --> $DIR/privacy2.rs:19:12 - | -LL | fn test1() { - | ____________^ -LL | | -LL | | use bar::foo; -... | -LL | | } - | |_^ - -error: requires `sized` lang_item - --> $DIR/privacy2.rs:26:12 - | -LL | fn test2() { - | ____________^ -LL | | -LL | | use bar::glob::foo; -LL | | -LL | | } - | |_^ - -error: requires `sized` lang_item - --> $DIR/privacy2.rs:32:11 - | -LL | fn main() {} - | ^^ -error: aborting due to 6 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0432, E0603. For more information about an error, try `rustc --explain E0432`. diff --git a/tests/ui/privacy/privacy3.rs b/tests/ui/privacy/privacy3.rs index 2bb3c1b3c61dd..6298a6bc8cf85 100644 --- a/tests/ui/privacy/privacy3.rs +++ b/tests/ui/privacy/privacy3.rs @@ -11,15 +11,12 @@ mod bar { mod glob { fn gpriv() {} - //~^ ERROR requires `sized` lang_item } } pub fn foo() {} -//~^ ERROR requires `sized` lang_item fn test1() { - //~^ ERROR requires `sized` lang_item use bar::gpriv; //~^ ERROR unresolved import `bar::gpriv` [E0432] //~| no `gpriv` in `bar` @@ -30,4 +27,3 @@ fn test1() { } fn main() {} -//~^ ERROR requires `sized` lang_item diff --git a/tests/ui/privacy/privacy3.stderr b/tests/ui/privacy/privacy3.stderr index 06a287d35ea4b..df66c84751b74 100644 --- a/tests/ui/privacy/privacy3.stderr +++ b/tests/ui/privacy/privacy3.stderr @@ -1,39 +1,11 @@ error[E0432]: unresolved import `bar::gpriv` - --> $DIR/privacy3.rs:23:9 + --> $DIR/privacy3.rs:20:9 | LL | use bar::gpriv; | ^^^^^^^^^^ no `gpriv` in `bar` error: requires `sized` lang_item - --> $DIR/privacy3.rs:18:14 - | -LL | pub fn foo() {} - | ^^ - -error: requires `sized` lang_item - --> $DIR/privacy3.rs:21:12 - | -LL | fn test1() { - | ____________^ -LL | | -LL | | use bar::gpriv; -... | -LL | | gpriv(); -LL | | } - | |_^ - -error: requires `sized` lang_item - --> $DIR/privacy3.rs:32:11 - | -LL | fn main() {} - | ^^ - -error: requires `sized` lang_item - --> $DIR/privacy3.rs:13:20 - | -LL | fn gpriv() {} - | ^^ -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0432`. diff --git a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr index 2d0c92ff2974f..08e679a7c559a 100644 --- a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr +++ b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr @@ -1,10 +1,4 @@ error: requires `sized` lang_item - --> $DIR/issue-59191-replace-root-with-fn.rs:9:1 - | -LL | #![issue_59191::no_main] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the attribute macro `issue_59191::no_main` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 1 previous error diff --git a/tests/ui/static/issue-24446.rs b/tests/ui/static/issue-24446.rs index 830e373c189d7..6cf8846506d3e 100644 --- a/tests/ui/static/issue-24446.rs +++ b/tests/ui/static/issue-24446.rs @@ -2,6 +2,7 @@ fn main() { static foo: dyn Fn() -> u32 = || -> u32 { //~^ ERROR the size for values of type //~| ERROR cannot be shared between threads safely + //~| ERROR the size for values of type //~| ERROR mismatched types 0 }; diff --git a/tests/ui/static/issue-24446.stderr b/tests/ui/static/issue-24446.stderr index 033caf07d8e54..8cb034000beda 100644 --- a/tests/ui/static/issue-24446.stderr +++ b/tests/ui/static/issue-24446.stderr @@ -15,19 +15,33 @@ LL | static foo: dyn Fn() -> u32 = || -> u32 { | = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)` +error[E0277]: the size for values of type `(dyn Fn() -> u32 + 'static)` cannot be known at compilation time + --> $DIR/issue-24446.rs:2:35 + | +LL | static foo: dyn Fn() -> u32 = || -> u32 { + | ___________________________________^ +... | +LL | | 0 +LL | | }; + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)` + = note: constant expressions must have a statically known size + error[E0308]: mismatched types --> $DIR/issue-24446.rs:2:35 | LL | static foo: dyn Fn() -> u32 = || -> u32 { | ___________________________________^ ... | +LL | | 0 LL | | }; | |_____^ expected `dyn Fn`, found closure | = note: expected trait object `(dyn Fn() -> u32 + 'static)` found closure `{closure@$DIR/issue-24446.rs:2:35: 2:44}` -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/statics/unsized_type2.stderr b/tests/ui/statics/unsized_type2.stderr index ffbbe218c87a0..b18a99fab72cb 100644 --- a/tests/ui/statics/unsized_type2.stderr +++ b/tests/ui/statics/unsized_type2.stderr @@ -11,12 +11,6 @@ note: required because it appears within the type `Foo` LL | pub struct Foo { | ^^^ -error[E0308]: mismatched types - --> $DIR/unsized_type2.rs:14:45 - | -LL | pub static WITH_ERROR: Foo = Foo { version: 0 }; - | ^ expected `str`, found integer - error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/unsized_type2.rs:14:30 | @@ -29,7 +23,13 @@ note: required because it appears within the type `Foo` | LL | pub struct Foo { | ^^^ - = note: structs must have a statically known size to be initialized + = note: constant expressions must have a statically known size + +error[E0308]: mismatched types + --> $DIR/unsized_type2.rs:14:45 + | +LL | pub static WITH_ERROR: Foo = Foo { version: 0 }; + | ^ expected `str`, found integer error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/dyn-incompatible-trait-references-self.stderr b/tests/ui/suggestions/dyn-incompatible-trait-references-self.stderr index 4576017abaf45..ae009d260299a 100644 --- a/tests/ui/suggestions/dyn-incompatible-trait-references-self.stderr +++ b/tests/ui/suggestions/dyn-incompatible-trait-references-self.stderr @@ -33,18 +33,6 @@ LL | trait Other: Sized {} | | | this trait is not dyn compatible... -error[E0277]: the size for values of type `Self` cannot be known at compilation time - --> $DIR/dyn-incompatible-trait-references-self.rs:4:22 - | -LL | fn bat(&self) -> Self {} - | ^^^^ doesn't have a size known at compile-time - | - = note: the return type of a function must have a statically known size -help: consider further restricting `Self` - | -LL | fn bat(&self) -> Self where Self: Sized {} - | +++++++++++++++++ - error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/dyn-incompatible-trait-references-self.rs:2:22 | @@ -73,6 +61,18 @@ LL | fn bat(&self) -> Self {} = note: expected type parameter `Self` found unit type `()` +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/dyn-incompatible-trait-references-self.rs:4:22 + | +LL | fn bat(&self) -> Self {} + | ^^^^ doesn't have a size known at compile-time + | + = note: the return type of a function must have a statically known size +help: consider further restricting `Self` + | +LL | fn bat(&self) -> Self where Self: Sized {} + | +++++++++++++++++ + error: aborting due to 5 previous errors Some errors have detailed explanations: E0038, E0277, E0308. diff --git a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs index 5277de29464d7..c3a2ab82adc6a 100644 --- a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs +++ b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs @@ -8,6 +8,7 @@ type Fn = dyn FnOnce() -> u8; const TEST: Fn = some_fn; //~^ ERROR cannot find value `some_fn` in this scope //~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time const TEST2: (Fn, u8) = (TEST, 0); //~^ ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time //~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time diff --git a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr index 76e015a7238b5..0e92979ccd507 100644 --- a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr +++ b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr @@ -13,7 +13,16 @@ LL | const TEST: Fn = some_fn; = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time - --> $DIR/ice-unsized-tuple-const-issue-121443.rs:11:14 + --> $DIR/ice-unsized-tuple-const-issue-121443.rs:8:18 + | +LL | const TEST: Fn = some_fn; + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` + = note: constant expressions must have a statically known size + +error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time + --> $DIR/ice-unsized-tuple-const-issue-121443.rs:12:14 | LL | const TEST2: (Fn, u8) = (TEST, 0); | ^^^^^^^^ doesn't have a size known at compile-time @@ -22,7 +31,7 @@ LL | const TEST2: (Fn, u8) = (TEST, 0); = note: only the last element of a tuple may have a dynamically sized type error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time - --> $DIR/ice-unsized-tuple-const-issue-121443.rs:11:25 + --> $DIR/ice-unsized-tuple-const-issue-121443.rs:12:25 | LL | const TEST2: (Fn, u8) = (TEST, 0); | ^^^^^^^^^ doesn't have a size known at compile-time @@ -30,7 +39,7 @@ LL | const TEST2: (Fn, u8) = (TEST, 0); = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` = note: only the last element of a tuple may have a dynamically sized type -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0277, E0425. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr index 92cfecd054049..f41c19b457391 100644 --- a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr +++ b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr @@ -8,17 +8,6 @@ LL | impl const dyn T { | = note: only trait implementations may be annotated with `const` -error[E0277]: the size for values of type `(dyn T + 'static)` cannot be known at compilation time - --> $DIR/span-bug-issue-121418.rs:8:27 - | -LL | pub const fn new() -> std::sync::Mutex {} - | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: within `Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)` -note: required because it appears within the type `Mutex<(dyn T + 'static)>` - --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL - = note: the return type of a function must have a statically known size - error[E0308]: mismatched types --> $DIR/span-bug-issue-121418.rs:8:27 | @@ -30,6 +19,17 @@ LL | pub const fn new() -> std::sync::Mutex {} = note: expected struct `Mutex<(dyn T + 'static)>` found unit type `()` +error[E0277]: the size for values of type `(dyn T + 'static)` cannot be known at compilation time + --> $DIR/span-bug-issue-121418.rs:8:27 + | +LL | pub const fn new() -> std::sync::Mutex {} + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)` +note: required because it appears within the type `Mutex<(dyn T + 'static)>` + --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL + = note: the return type of a function must have a statically known size + error: aborting due to 3 previous errors Some errors have detailed explanations: E0277, E0308. diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs index ea6df93870474..cbd591eec96c0 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs @@ -13,9 +13,8 @@ fn main() { } fn weird0() -> impl Sized + !Sized {} -//~^ ERROR type mismatch resolving +//~^ ERROR the trait bound `(): !Sized` is not satisfied fn weird1() -> impl !Sized + Sized {} -//~^ ERROR type mismatch resolving +//~^ ERROR the trait bound `(): !Sized` is not satisfied fn weird2() -> impl !Sized {} -//~^ ERROR type mismatch resolving -//~| ERROR the size for values of type +//~^ ERROR the trait bound `(): !Sized` is not satisfied diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr index 41d9e74f8076e..3dad6d534fd83 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr @@ -1,29 +1,20 @@ -error[E0277]: the size for values of type `impl !Sized` cannot be known at compilation time - --> $DIR/opaque-type-unsatisfied-bound.rs:19:16 - | -LL | fn weird2() -> impl !Sized {} - | ^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `impl !Sized` - = note: the return type of a function must have a statically known size - -error[E0271]: type mismatch resolving `impl !Sized + Sized == ()` +error[E0277]: the trait bound `(): !Sized` is not satisfied --> $DIR/opaque-type-unsatisfied-bound.rs:15:16 | LL | fn weird0() -> impl Sized + !Sized {} - | ^^^^^^^^^^^^^^^^^^^ types differ + | ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied -error[E0271]: type mismatch resolving `impl !Sized + Sized == ()` +error[E0277]: the trait bound `(): !Sized` is not satisfied --> $DIR/opaque-type-unsatisfied-bound.rs:17:16 | LL | fn weird1() -> impl !Sized + Sized {} - | ^^^^^^^^^^^^^^^^^^^ types differ + | ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied -error[E0271]: type mismatch resolving `impl !Sized == ()` +error[E0277]: the trait bound `(): !Sized` is not satisfied --> $DIR/opaque-type-unsatisfied-bound.rs:19:16 | LL | fn weird2() -> impl !Sized {} - | ^^^^^^^^^^^ types differ + | ^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied --> $DIR/opaque-type-unsatisfied-bound.rs:12:13 @@ -39,7 +30,6 @@ note: required by a bound in `consume` LL | fn consume(_: impl Trait) {} | ^^^^^ required by this bound in `consume` -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0271, E0277. -For more information about an error, try `rustc --explain E0271`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs index ce42bce0ad4e4..39422914afcdd 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs @@ -3,6 +3,6 @@ #![feature(negative_bounds, unboxed_closures)] fn produce() -> impl !Fn<(u32,)> {} -//~^ ERROR type mismatch resolving +//~^ ERROR the trait bound `(): !Fn(u32)` is not satisfied fn main() {} diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr index e1b84e0df7a54..760e5aa62f2c1 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr @@ -1,9 +1,9 @@ -error[E0271]: type mismatch resolving `impl !Fn<(u32,)> == ()` +error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied --> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17 | LL | fn produce() -> impl !Fn<(u32,)> {} - | ^^^^^^^^^^^^^^^^ types differ + | ^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0271`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/typeck/issue-105946.rs b/tests/ui/typeck/issue-105946.rs index 0ee70f9346c8a..f53f31138f811 100644 --- a/tests/ui/typeck/issue-105946.rs +++ b/tests/ui/typeck/issue-105946.rs @@ -1,5 +1,4 @@ fn digit() -> str { - //~^ ERROR the size for values of type return {}; //~^ ERROR: mismatched types [E0308] } diff --git a/tests/ui/typeck/issue-105946.stderr b/tests/ui/typeck/issue-105946.stderr index 30fe2000a4619..33d4e0b141ab3 100644 --- a/tests/ui/typeck/issue-105946.stderr +++ b/tests/ui/typeck/issue-105946.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `_y` in this scope - --> $DIR/issue-105946.rs:7:10 + --> $DIR/issue-105946.rs:6:10 | LL | let [_y..] = [Box::new(1), Box::new(2)]; | ^^ not found in this scope @@ -10,7 +10,7 @@ LL | let [_y @ ..] = [Box::new(1), Box::new(2)]; | + error[E0658]: `X..` patterns in slices are experimental - --> $DIR/issue-105946.rs:7:10 + --> $DIR/issue-105946.rs:6:10 | LL | let [_y..] = [Box::new(1), Box::new(2)]; | ^^^^ @@ -19,28 +19,19 @@ LL | let [_y..] = [Box::new(1), Box::new(2)]; = help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/issue-105946.rs:1:15 - | -LL | fn digit() -> str { - | ^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - = note: the return type of a function must have a statically known size - error[E0308]: mismatched types - --> $DIR/issue-105946.rs:3:12 + --> $DIR/issue-105946.rs:2:12 | LL | return {}; | ^^ expected `str`, found `()` error[E0527]: pattern requires 1 element but array has 2 - --> $DIR/issue-105946.rs:7:9 + --> $DIR/issue-105946.rs:6:9 | LL | let [_y..] = [Box::new(1), Box::new(2)]; | ^^^^^^ expected 2 elements -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0277, E0308, E0425, E0527, E0658. -For more information about an error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0308, E0425, E0527, E0658. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.rs b/tests/ui/unsized/box-instead-of-dyn-fn.rs index 720176081d6f9..321c2ebf5a122 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.rs +++ b/tests/ui/unsized/box-instead-of-dyn-fn.rs @@ -3,7 +3,7 @@ use std::fmt::Debug; // Test to suggest boxing the return type, and the closure branch of the `if` fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { - //~^ ERROR return type cannot be a trait object without pointer indirection + //~^ ERROR return type cannot have an unboxed trait object if a % 2 == 0 { move || println!("{a}") } else { diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index b666718262da8..ed17ff69a1237 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/box-instead-of-dyn-fn.rs:5:56 | LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { diff --git a/tests/ui/unsized/issue-91801.rs b/tests/ui/unsized/issue-91801.rs index d906a08a55a21..096b1a93574fc 100644 --- a/tests/ui/unsized/issue-91801.rs +++ b/tests/ui/unsized/issue-91801.rs @@ -6,7 +6,7 @@ pub static ALL_VALIDATORS: &[(&'static str, &'static Validator)] = &[("validate that credits and debits balance", &validate_something)]; fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> { - //~^ ERROR return type cannot be a trait object without pointer indirection + //~^ ERROR return type cannot have an unboxed trait object return Box::new(move |something: &'_ Something| -> Result<(), ()> { first(something).or_else(|_| second(something)) }); diff --git a/tests/ui/unsized/issue-91801.stderr b/tests/ui/unsized/issue-91801.stderr index 28e10f9caa41a..e13cabbb81d6c 100644 --- a/tests/ui/unsized/issue-91801.stderr +++ b/tests/ui/unsized/issue-91801.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/issue-91801.rs:8:77 | LL | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> { diff --git a/tests/ui/unsized/issue-91803.rs b/tests/ui/unsized/issue-91803.rs index 8d35c7582b823..c74897cc4bc50 100644 --- a/tests/ui/unsized/issue-91803.rs +++ b/tests/ui/unsized/issue-91803.rs @@ -1,7 +1,7 @@ trait Foo<'a> {} fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { - //~^ ERROR return type cannot be a trait object without pointer indirection + //~^ ERROR return type cannot have an unboxed trait object return Box::new(panic!()); } diff --git a/tests/ui/unsized/issue-91803.stderr b/tests/ui/unsized/issue-91803.stderr index 037ec2ceaa546..812fac3585c8a 100644 --- a/tests/ui/unsized/issue-91803.stderr +++ b/tests/ui/unsized/issue-91803.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot be a trait object without pointer indirection +error[E0746]: return type cannot have an unboxed trait object --> $DIR/issue-91803.rs:3:43 | LL | fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { diff --git a/tests/ui/where-clauses/ignore-err-clauses.rs b/tests/ui/where-clauses/ignore-err-clauses.rs index 428ebf4b40836..c76f0e1a8b2b5 100644 --- a/tests/ui/where-clauses/ignore-err-clauses.rs +++ b/tests/ui/where-clauses/ignore-err-clauses.rs @@ -1,7 +1,6 @@ use std::ops::Add; fn dbl(x: T) -> ::Output -//~^ ERROR type annotations needed where T: Copy + Add, UUU: Copy, diff --git a/tests/ui/where-clauses/ignore-err-clauses.stderr b/tests/ui/where-clauses/ignore-err-clauses.stderr index fbf1b99334f42..4cf553da4c5fc 100644 --- a/tests/ui/where-clauses/ignore-err-clauses.stderr +++ b/tests/ui/where-clauses/ignore-err-clauses.stderr @@ -1,16 +1,9 @@ error[E0412]: cannot find type `UUU` in this scope - --> $DIR/ignore-err-clauses.rs:7:5 + --> $DIR/ignore-err-clauses.rs:6:5 | LL | UUU: Copy, | ^^^ not found in this scope -error[E0282]: type annotations needed - --> $DIR/ignore-err-clauses.rs:3:14 - | -LL | fn dbl(x: T) -> ::Output - | ^ cannot infer type for type parameter `T` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0282, E0412. -For more information about an error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0412`. From ea14c4a48f92797c8c7434034acc56a47d85c0dc Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 6 Mar 2025 18:50:49 +0000 Subject: [PATCH 34/64] Fix revert fallout (cherry picked from commit 81d6660d28c2288606dbbf1e2aa238b1309eb6aa) --- tests/crashes/134355.rs | 6 ------ ...ype-whensubstituting-in-region-112823.next.stderr | 12 ++++++++++-- ...d-param-type-whensubstituting-in-region-112823.rs | 3 ++- ...int-to-type-err-cause-on-impl-trait-return.stderr | 10 ++++++---- 4 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 tests/crashes/134355.rs diff --git a/tests/crashes/134355.rs b/tests/crashes/134355.rs deleted file mode 100644 index b662341e6b1b3..0000000000000 --- a/tests/crashes/134355.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: #134355 - -//@compile-flags: --crate-type=lib -fn digit() -> str { - return { i32::MIN }; -} diff --git a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.next.stderr b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.next.stderr index ce64a022214ea..e49c8c92d8396 100644 --- a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.next.stderr +++ b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.next.stderr @@ -17,12 +17,20 @@ LL | type LineStream<'c, 'd> = impl Stream; | | | found 0 type parameters -error[E0271]: type mismatch resolving `::LineStreamFut<'a, Repr> == ()` +error[E0271]: type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to ()` --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:28:43 | LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ +error[E0271]: type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to _` + --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:28:43 + | +LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ + | + = note: the return type of a function must have a statically known size + error[E0271]: type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to _` --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:28:73 | @@ -35,7 +43,7 @@ error[E0271]: type mismatch resolving `::LineStreamFut<'a, Repr> normali LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors Some errors have detailed explanations: E0049, E0271, E0407. For more information about an error, try `rustc --explain E0049`. diff --git a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs index cb32723b22dd1..bb0c6215de291 100644 --- a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs +++ b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs @@ -28,9 +28,10 @@ impl X for Y { fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} //~^ method `line_stream` is not a member of trait `X` //[current]~^^ ERROR `()` is not a future - //[next]~^^^ ERROR type mismatch resolving `::LineStreamFut<'a, Repr> == ()` //[next]~| ERROR type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to _` //[next]~| ERROR type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to _` + //[next]~| ERROR type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to ()` + //[next]~| ERROR type mismatch resolving `::LineStreamFut<'a, Repr> normalizes-to _` } pub fn main() {} diff --git a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr index 041f343da9042..f59be2febeb3c 100644 --- a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr @@ -181,8 +181,9 @@ LL | fn hat() -> dyn std::fmt::Display { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn hat() -> impl std::fmt::Display { - | ~~~~ +LL - fn hat() -> dyn std::fmt::Display { +LL + fn hat() -> impl std::fmt::Display { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn hat() -> Box { @@ -202,8 +203,9 @@ LL | fn pug() -> dyn std::fmt::Display { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn pug() -> impl std::fmt::Display { - | ~~~~ +LL - fn pug() -> dyn std::fmt::Display { +LL + fn pug() -> impl std::fmt::Display { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn pug() -> Box { From 27fb3e67872f2bcfc4a24f7a3102284ee12af9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 12 Feb 2025 10:31:55 +0100 Subject: [PATCH 35/64] Update GCC submodule --- src/gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gcc b/src/gcc index fd3498bff0b93..e607be166673a 160000 --- a/src/gcc +++ b/src/gcc @@ -1 +1 @@ -Subproject commit fd3498bff0b939dda91d56960acc33d55f2f9cdf +Subproject commit e607be166673a8de9fc07f6f02c60426e556c5f2 From cdd16a1fbd3e728408118b135242f2fb1ef0ec43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 30 Jan 2025 15:07:24 +0100 Subject: [PATCH 36/64] Improve GCC build in bootstrap --- src/bootstrap/src/core/build_steps/compile.rs | 9 ++++ src/bootstrap/src/core/build_steps/gcc.rs | 51 ++++++++++++++----- src/bootstrap/src/core/build_steps/test.rs | 7 ++- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 479327d63695c..44469da1e648f 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -17,6 +17,7 @@ use std::{env, fs, str}; use serde_derive::Deserialize; +use crate::core::build_steps::gcc::{Gcc, add_cg_gcc_cargo_flags}; use crate::core::build_steps::tool::SourceType; use crate::core::build_steps::{dist, llvm}; use crate::core::builder; @@ -1500,6 +1501,14 @@ impl Step for CodegenBackend { .arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml"))); rustc_cargo_env(builder, &mut cargo, target, compiler.stage); + // Ideally, we'd have a separate step for the individual codegen backends, + // like we have in tests (test::CodegenGCC) but that would require a lot of restructuring. + // If the logic gets more complicated, it should probably be done. + if backend == "gcc" { + let gcc = builder.ensure(Gcc { target }); + add_cg_gcc_cargo_flags(&mut cargo, &gcc); + } + let tmp_stamp = BuildStamp::new(&out_dir).with_prefix("tmp"); let _guard = builder.msg_build(compiler, format_args!("codegen backend {backend}"), target); diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 98b8635132b0d..3edca8834e063 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -9,13 +9,13 @@ //! ensure that they're always in place if needed. use std::fs; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::sync::OnceLock; use build_helper::ci::CiEnv; use crate::Kind; -use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; +use crate::core::builder::{Builder, Cargo, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; use crate::utils::build_stamp::{BuildStamp, generate_smart_stamp_hash}; use crate::utils::exec::command; @@ -29,7 +29,8 @@ pub struct Meta { } pub enum GccBuildStatus { - AlreadyBuilt, + /// libgccjit is already built at this path + AlreadyBuilt(PathBuf), ShouldBuild(Meta), } @@ -41,9 +42,6 @@ pub fn prebuilt_gcc_config(builder: &Builder<'_>, target: TargetSelection) -> Gc // Initialize the gcc submodule if not initialized already. builder.config.update_submodule("src/gcc"); - // FIXME (GuillaumeGomez): To be done once gccjit has been built in the CI. - // builder.config.maybe_download_ci_gcc(); - let root = builder.src.join("src/gcc"); let out_dir = builder.gcc_out(target).join("build"); let install_dir = builder.gcc_out(target).join("install"); @@ -70,19 +68,37 @@ pub fn prebuilt_gcc_config(builder: &Builder<'_>, target: TargetSelection) -> Gc stamp.path().display() )); } - return GccBuildStatus::AlreadyBuilt; + let path = libgccjit_built_path(&install_dir); + if path.is_file() { + return GccBuildStatus::AlreadyBuilt(path); + } else { + builder.info(&format!( + "GCC stamp is up-to-date, but the libgccjit.so file was not found at `{}`", + path.display(), + )); + } } GccBuildStatus::ShouldBuild(Meta { stamp, out_dir, install_dir, root }) } +/// Returns the path to a libgccjit.so file in the install directory of GCC. +fn libgccjit_built_path(install_dir: &Path) -> PathBuf { + install_dir.join("lib/libgccjit.so") +} + #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct Gcc { pub target: TargetSelection, } +#[derive(Clone)] +pub struct GccOutput { + pub libgccjit: PathBuf, +} + impl Step for Gcc { - type Output = bool; + type Output = GccOutput; const ONLY_HOSTS: bool = true; @@ -94,14 +110,14 @@ impl Step for Gcc { run.builder.ensure(Gcc { target: run.target }); } - /// Compile GCC for `target`. - fn run(self, builder: &Builder<'_>) -> bool { + /// Compile GCC (specifically `libgccjit`) for `target`. + fn run(self, builder: &Builder<'_>) -> Self::Output { let target = self.target; // If GCC has already been built, we avoid building it again. let Meta { stamp, out_dir, install_dir, root } = match prebuilt_gcc_config(builder, target) { - GccBuildStatus::AlreadyBuilt => return true, + GccBuildStatus::AlreadyBuilt(path) => return GccOutput { libgccjit: path }, GccBuildStatus::ShouldBuild(m) => m, }; @@ -110,8 +126,9 @@ impl Step for Gcc { let _time = helpers::timeit(builder); t!(fs::create_dir_all(&out_dir)); + let libgccjit_path = libgccjit_built_path(&install_dir); if builder.config.dry_run() { - return true; + return GccOutput { libgccjit: libgccjit_path }; } // GCC creates files (e.g. symlinks to the downloaded dependencies) @@ -173,11 +190,17 @@ impl Step for Gcc { let lib_alias = install_dir.join("lib/libgccjit.so.0"); if !lib_alias.exists() { - t!(builder.symlink_file(install_dir.join("lib/libgccjit.so"), lib_alias,)); + t!(builder.symlink_file(&libgccjit_path, lib_alias)); } t!(stamp.write()); - true + GccOutput { libgccjit: libgccjit_path } } } + +/// Configures a Cargo invocation so that it can build the GCC codegen backend. +pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) { + // Add the path to libgccjit.so to the linker search paths. + cargo.rustflag(&format!("-L{}", gcc.libgccjit.parent().unwrap().display())); +} diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 26ed0e5deaa05..c3eceda0d1a6b 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -12,6 +12,7 @@ use clap_complete::shells; use crate::core::build_steps::compile::run_cargo; use crate::core::build_steps::doc::DocumentationFormat; +use crate::core::build_steps::gcc::{Gcc, add_cg_gcc_cargo_flags}; use crate::core::build_steps::llvm::get_llvm_version; use crate::core::build_steps::synthetic_targets::MirOptPanicAbortSyntheticTarget; use crate::core::build_steps::tool::{self, SourceType, Tool}; @@ -3520,6 +3521,8 @@ impl Step for CodegenGCC { let compiler = self.compiler; let target = self.target; + let gcc = builder.ensure(Gcc { target }); + builder.ensure( compile::Std::new(compiler, target) .extra_rust_args(&["-Csymbol-mangling-version=v0", "-Cpanic=abort"]), @@ -3546,6 +3549,7 @@ impl Step for CodegenGCC { .arg("--manifest-path") .arg(builder.src.join("compiler/rustc_codegen_gcc/build_system/Cargo.toml")); compile::rustc_cargo_env(builder, &mut cargo, target, compiler.stage); + add_cg_gcc_cargo_flags(&mut cargo, &gcc); // Avoid incremental cache issues when changing rustc cargo.env("CARGO_BUILD_INCREMENTAL", "false"); @@ -3578,9 +3582,10 @@ impl Step for CodegenGCC { .env("CG_RUSTFLAGS", "-Alinker-messages") .arg("--") .arg("test") - .arg("--use-system-gcc") .arg("--use-backend") .arg("gcc") + .arg("--gcc-path") + .arg(gcc.libgccjit.parent().unwrap()) .arg("--out-dir") .arg(builder.stage_out(compiler, Mode::ToolRustc).join("cg_gcc")) .arg("--release") From 2db0710a9d7fc8c284f3e0ffa59d2d0877c9d4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 14 Feb 2025 18:46:52 +0100 Subject: [PATCH 37/64] Install bzip2 It is apparently required to download GCC dependencies. --- src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile index 0a58f337d9ddb..707b8d67b81a7 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ g++ \ gcc-multilib \ make \ From 262848a9ad7a0f98d4ce476407fae8c5ab5668ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 15 Feb 2025 11:54:46 +0100 Subject: [PATCH 38/64] Update license metadata --- license-metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/license-metadata.json b/license-metadata.json index 4cf9bea2861d4..4fb59210854e9 100644 --- a/license-metadata.json +++ b/license-metadata.json @@ -13,7 +13,8 @@ "directories": [], "files": [ "analyzer-decls.h", - "malloc-macro.h" + "malloc-macro.h", + "sarif-path-role.h" ], "license": { "copyright": [ From b711bca0a84053725f36427069dd8431eab76b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 17 Feb 2025 12:34:43 +0100 Subject: [PATCH 39/64] Changed `.display()` to `.to_str()` --- src/bootstrap/src/core/build_steps/gcc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 3edca8834e063..e8b6a577cea5b 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -202,5 +202,5 @@ impl Step for Gcc { /// Configures a Cargo invocation so that it can build the GCC codegen backend. pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) { // Add the path to libgccjit.so to the linker search paths. - cargo.rustflag(&format!("-L{}", gcc.libgccjit.parent().unwrap().display())); + cargo.rustflag(&format!("-L{}", gcc.libgccjit.parent().unwrap().to_str().unwrap())); } From f9a450b907a104442c5437cf256dcdf0aba2149d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 11 Mar 2025 09:07:18 +0100 Subject: [PATCH 40/64] Add missing unsafe block --- src/bootstrap/src/utils/job.rs | 61 ++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/bootstrap/src/utils/job.rs b/src/bootstrap/src/utils/job.rs index 10efed130d624..471636515296f 100644 --- a/src/bootstrap/src/utils/job.rs +++ b/src/bootstrap/src/utils/job.rs @@ -59,38 +59,41 @@ mod for_windows { use crate::Build; pub unsafe fn setup(build: &mut Build) { - // Enable the Windows Error Reporting dialog which msys disables, - // so we can JIT debug rustc - let mode = SetErrorMode(THREAD_ERROR_MODE::default()); - let mode = THREAD_ERROR_MODE(mode); - SetErrorMode(mode & !SEM_NOGPFAULTERRORBOX); + // SAFETY: pretty much everything below is unsafe + unsafe { + // Enable the Windows Error Reporting dialog which msys disables, + // so we can JIT debug rustc + let mode = SetErrorMode(THREAD_ERROR_MODE::default()); + let mode = THREAD_ERROR_MODE(mode); + SetErrorMode(mode & !SEM_NOGPFAULTERRORBOX); - // Create a new job object for us to use - let job = CreateJobObjectW(None, PCWSTR::null()).unwrap(); + // Create a new job object for us to use + let job = CreateJobObjectW(None, PCWSTR::null()).unwrap(); - // Indicate that when all handles to the job object are gone that all - // process in the object should be killed. Note that this includes our - // entire process tree by default because we've added ourselves and our - // children will reside in the job by default. - let mut info = JOBOBJECT_EXTENDED_LIMIT_INFORMATION::default(); - info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; - if build.config.low_priority { - info.BasicLimitInformation.LimitFlags |= JOB_OBJECT_LIMIT_PRIORITY_CLASS; - info.BasicLimitInformation.PriorityClass = BELOW_NORMAL_PRIORITY_CLASS.0; - } - let r = SetInformationJobObject( - job, - JobObjectExtendedLimitInformation, - &info as *const _ as *const c_void, - mem::size_of_val(&info) as u32, - ); - assert!(r.is_ok(), "{}", io::Error::last_os_error()); + // Indicate that when all handles to the job object are gone that all + // process in the object should be killed. Note that this includes our + // entire process tree by default because we've added ourselves and our + // children will reside in the job by default. + let mut info = JOBOBJECT_EXTENDED_LIMIT_INFORMATION::default(); + info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + if build.config.low_priority { + info.BasicLimitInformation.LimitFlags |= JOB_OBJECT_LIMIT_PRIORITY_CLASS; + info.BasicLimitInformation.PriorityClass = BELOW_NORMAL_PRIORITY_CLASS.0; + } + let r = SetInformationJobObject( + job, + JobObjectExtendedLimitInformation, + &info as *const _ as *const c_void, + size_of_val(&info) as u32, + ); + assert!(r.is_ok(), "{}", io::Error::last_os_error()); - // Assign our process to this job object. - let r = AssignProcessToJobObject(job, GetCurrentProcess()); - if r.is_err() { - CloseHandle(job).ok(); - return; + // Assign our process to this job object. + let r = AssignProcessToJobObject(job, GetCurrentProcess()); + if r.is_err() { + CloseHandle(job).ok(); + return; + } } // Note: we intentionally leak the job object handle. When our process exits From 69cea2db59b3e4ddaf882559a8c0084368096114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 26 Feb 2025 09:23:52 +0100 Subject: [PATCH 41/64] Update gcc submodule To add support for the x87 feature. --- src/gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gcc b/src/gcc index e607be166673a..48664a6cab29d 160000 --- a/src/gcc +++ b/src/gcc @@ -1 +1 @@ -Subproject commit e607be166673a8de9fc07f6f02c60426e556c5f2 +Subproject commit 48664a6cab29d48138ffa004b7978d52ef73e3ac From f7f52103bd8d0422128120da1599736411769ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 26 Feb 2025 11:59:00 +0100 Subject: [PATCH 42/64] Add `dist:Gcc` build step To distribute the prebuilt libgccjit.so from CI. --- src/bootstrap/src/core/build_steps/dist.rs | 27 ++++++++++++++++++++++ src/bootstrap/src/core/builder/mod.rs | 1 + src/tools/opt-dist/src/main.rs | 1 + 3 files changed, 29 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index c33f11f684f4d..a136f115807fb 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -2450,3 +2450,30 @@ impl Step for ReproducibleArtifacts { if added_anything { Some(tarball.generate()) } else { None } } } + +/// Tarball containing a prebuilt version of the libgccjit library, +/// needed as a dependency for the GCC codegen backend (similarly to the LLVM +/// backend needing a prebuilt libLLVM). +#[derive(Clone, Debug, Eq, Hash, PartialEq)] +pub struct Gcc { + pub target: TargetSelection, +} + +impl Step for Gcc { + type Output = GeneratedTarball; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.alias("gcc") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(Gcc { target: run.target }); + } + + fn run(self, builder: &Builder<'_>) -> Self::Output { + let tarball = Tarball::new(builder, "gcc", &self.target.triple); + let output = builder.ensure(super::gcc::Gcc { target: self.target }); + tarball.add_file(output.libgccjit, ".", 0o644); + tarball.generate() + } +} diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index ecec589fc32eb..f4f4c3d79425e 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1066,6 +1066,7 @@ impl<'a> Builder<'a> { dist::PlainSourceTarball, dist::BuildManifest, dist::ReproducibleArtifacts, + dist::Gcc ), Kind::Install => describe!( install::Docs, diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index 565721a909344..3111149f2ae20 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -389,6 +389,7 @@ fn main() -> anyhow::Result<()> { "clippy", "miri", "rustfmt", + "gcc", ] { build_args.extend(["--skip".to_string(), target.to_string()]); } From 0953073a4db84156dc1843d07e44a296dcb148f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 28 Feb 2025 09:43:05 +0100 Subject: [PATCH 43/64] Build GCC on the Linux x64 dist runner --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 0b4682ac32ba0..f54ecef1e308a 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -101,7 +101,7 @@ ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ --host $HOSTS --target $HOSTS \ --include-default-paths \ - build-manifest bootstrap + build-manifest bootstrap gcc ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang # This is the only builder which will create source tarballs From c1e778dd4de69f6b99710e15c42f7c30803451f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 5 Mar 2025 10:16:22 +0100 Subject: [PATCH 44/64] Add `gcc` bootstrap config section --- config.example.toml | 5 +++++ src/bootstrap/src/core/config/config.rs | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml index f5395375afe4c..e8d66fd1cfb95 100644 --- a/config.example.toml +++ b/config.example.toml @@ -163,6 +163,11 @@ # Custom CMake defines to set when building LLVM. #build-config = {} +# ============================================================================= +# Tweaking how GCC is compiled +# ============================================================================= +[gcc] + # ============================================================================= # General build configuration options # ============================================================================= diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 65f286a05bd5c..76507c558232e 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -670,6 +670,7 @@ pub(crate) struct TomlConfig { build: Option, install: Option, llvm: Option, + gcc: Option, rust: Option, target: Option>, dist: Option, @@ -704,7 +705,7 @@ trait Merge { impl Merge for TomlConfig { fn merge( &mut self, - TomlConfig { build, install, llvm, rust, dist, target, profile, change_id }: Self, + TomlConfig { build, install, llvm, gcc, rust, dist, target, profile, change_id }: Self, replace: ReplaceOpt, ) { fn do_merge(x: &mut Option, y: Option, replace: ReplaceOpt) { @@ -723,6 +724,7 @@ impl Merge for TomlConfig { do_merge(&mut self.build, build, replace); do_merge(&mut self.install, install, replace); do_merge(&mut self.llvm, llvm, replace); + do_merge(&mut self.gcc, gcc, replace); do_merge(&mut self.rust, rust, replace); do_merge(&mut self.dist, dist, replace); @@ -988,6 +990,11 @@ define_config! { } } +define_config! { + /// TOML representation of how the GCC build is configured. + struct Gcc {} +} + define_config! { struct Dist { sign_folder: Option = "sign-folder", From 81b089ce24197d6b1f695b5b595016665d269a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 5 Mar 2025 11:26:16 +0100 Subject: [PATCH 45/64] Add `[gcc] download-ci-gcc` option --- config.example.toml | 5 +++++ src/bootstrap/src/core/config/config.rs | 28 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml index e8d66fd1cfb95..48fc62b077bb0 100644 --- a/config.example.toml +++ b/config.example.toml @@ -167,6 +167,11 @@ # Tweaking how GCC is compiled # ============================================================================= [gcc] +# Download GCC from CI instead of building it locally. +# Note that this will attempt to download GCC even if there are local +# modifications to the `src/gcc` submodule. +# Currently, this is only supported for the `x86_64-unknown-linux-gnu` target. +# download-ci-gcc = false # ============================================================================= # General build configuration options diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 76507c558232e..2e834fba35097 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -171,6 +171,17 @@ impl LldMode { } } +/// Determines how will GCC be provided. +#[derive(Default, Clone)] +pub enum GccCiMode { + /// Build GCC from the local `src/gcc` submodule. + #[default] + BuildLocally, + /// Try to download GCC from CI. + /// If it is not available on CI, it will be built locally instead. + DownloadFromCi, +} + /// Global configuration for the entire build and/or bootstrap. /// /// This structure is parsed from `config.toml`, and some of the fields are inferred from `git` or build-time parameters. @@ -281,6 +292,9 @@ pub struct Config { pub llvm_ldflags: Option, pub llvm_use_libcxx: bool, + // gcc codegen options + pub gcc_ci_mode: GccCiMode, + // rust codegen options pub rust_optimize: RustOptimize, pub rust_codegen_units: Option, @@ -992,7 +1006,9 @@ define_config! { define_config! { /// TOML representation of how the GCC build is configured. - struct Gcc {} + struct Gcc { + download_ci_gcc: Option = "download-ci-gcc", + } } define_config! { @@ -2123,6 +2139,16 @@ impl Config { config.llvm_from_ci = config.parse_download_ci_llvm(None, false); } + if let Some(gcc) = toml.gcc { + config.gcc_ci_mode = match gcc.download_ci_gcc { + Some(value) => match value { + true => GccCiMode::DownloadFromCi, + false => GccCiMode::BuildLocally, + }, + None => GccCiMode::default(), + }; + } + if let Some(t) = toml.target { for (triple, cfg) in t { let mut target = Target::from_triple(&triple); From 624ba301085934049c444dd13220c008ff3dd066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 5 Mar 2025 10:35:16 +0100 Subject: [PATCH 46/64] Add `download-ci-gcc-stamp` file --- src/bootstrap/download-ci-gcc-stamp | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/bootstrap/download-ci-gcc-stamp diff --git a/src/bootstrap/download-ci-gcc-stamp b/src/bootstrap/download-ci-gcc-stamp new file mode 100644 index 0000000000000..bbe26afc95269 --- /dev/null +++ b/src/bootstrap/download-ci-gcc-stamp @@ -0,0 +1,4 @@ +Change this file to make users of the `download-ci-gcc` configuration download +a new version of GCC from CI, even if the GCC submodule hasn’t changed. + +Last change is for: https://github.com/rust-lang/rust/pull/138051 From c3bf2fc5cbb0e4c0f0b7cf195a349fa7e20eefa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 5 Mar 2025 11:38:05 +0100 Subject: [PATCH 47/64] Implement downloading GCC from CI --- src/bootstrap/src/core/build_steps/gcc.rs | 294 ++++++++++++++-------- src/bootstrap/src/core/download.rs | 28 +++ 2 files changed, 211 insertions(+), 111 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index e8b6a577cea5b..7e1ec39659a30 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -13,14 +13,70 @@ use std::path::{Path, PathBuf}; use std::sync::OnceLock; use build_helper::ci::CiEnv; +use build_helper::git::get_closest_merge_commit; -use crate::Kind; -use crate::core::builder::{Builder, Cargo, RunConfig, ShouldRun, Step}; -use crate::core::config::TargetSelection; +use crate::Config; +use crate::core::builder::{Builder, Cargo, Kind, RunConfig, ShouldRun, Step}; +use crate::core::config::{GccCiMode, TargetSelection}; use crate::utils::build_stamp::{BuildStamp, generate_smart_stamp_hash}; use crate::utils::exec::command; use crate::utils::helpers::{self, t}; +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct Gcc { + pub target: TargetSelection, +} + +#[derive(Clone)] +pub struct GccOutput { + pub libgccjit: PathBuf, +} + +impl Step for Gcc { + type Output = GccOutput; + + const ONLY_HOSTS: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/gcc").alias("gcc") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(Gcc { target: run.target }); + } + + /// Compile GCC (specifically `libgccjit`) for `target`. + fn run(self, builder: &Builder<'_>) -> Self::Output { + let target = self.target; + + // If GCC has already been built, we avoid building it again. + let metadata = match get_gcc_build_status(builder, target) { + GccBuildStatus::AlreadyBuilt(path) => return GccOutput { libgccjit: path }, + GccBuildStatus::ShouldBuild(m) => m, + }; + + let _guard = builder.msg_unstaged(Kind::Build, "GCC", target); + t!(metadata.stamp.remove()); + let _time = helpers::timeit(builder); + + let libgccjit_path = libgccjit_built_path(&metadata.install_dir); + if builder.config.dry_run() { + return GccOutput { libgccjit: libgccjit_path }; + } + + build_gcc(&metadata, builder, target); + + let lib_alias = metadata.install_dir.join("lib/libgccjit.so.0"); + if !lib_alias.exists() { + t!(builder.symlink_file(&libgccjit_path, lib_alias)); + } + + t!(metadata.stamp.write()); + + GccOutput { libgccjit: libgccjit_path } + } +} + pub struct Meta { stamp: BuildStamp, out_dir: PathBuf, @@ -34,17 +90,39 @@ pub enum GccBuildStatus { ShouldBuild(Meta), } -/// This returns whether we've already previously built GCC. +/// Tries to download GCC from CI if it is enabled and GCC artifacts +/// are available for the given target. +/// Returns a path to the libgccjit.so file. +fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option { + // Try to download GCC from CI if configured and available + if !matches!(builder.config.gcc_ci_mode, GccCiMode::DownloadFromCi) { + return None; + } + if target != "x86_64-unknown-linux-gnu" { + eprintln!("GCC CI download is only available for the `x86_64-unknown-linux-gnu` target"); + return None; + } + let sha = + detect_gcc_sha(&builder.config, builder.config.rust_info.is_managed_git_subrepository()); + let root = ci_gcc_root(&builder.config); + let gcc_stamp = BuildStamp::new(&root).with_prefix("gcc").add_stamp(&sha); + if !gcc_stamp.is_up_to_date() && !builder.config.dry_run() { + builder.config.download_ci_gcc(&sha, &root); + t!(gcc_stamp.write()); + } + // FIXME: put libgccjit.so into a lib directory in dist::Gcc + Some(root.join("libgccjit.so")) +} + +/// This returns information about whether GCC should be built or if it's already built. +/// It transparently handles downloading GCC from CI if needed. /// /// It's used to avoid busting caches during x.py check -- if we've already built /// GCC, it's fine for us to not try to avoid doing so. -pub fn prebuilt_gcc_config(builder: &Builder<'_>, target: TargetSelection) -> GccBuildStatus { - // Initialize the gcc submodule if not initialized already. - builder.config.update_submodule("src/gcc"); - - let root = builder.src.join("src/gcc"); - let out_dir = builder.gcc_out(target).join("build"); - let install_dir = builder.gcc_out(target).join("install"); +pub fn get_gcc_build_status(builder: &Builder<'_>, target: TargetSelection) -> GccBuildStatus { + if let Some(path) = try_download_gcc(builder, target) { + return GccBuildStatus::AlreadyBuilt(path); + } static STAMP_HASH_MEMO: OnceLock = OnceLock::new(); let smart_stamp_hash = STAMP_HASH_MEMO.get_or_init(|| { @@ -55,6 +133,13 @@ pub fn prebuilt_gcc_config(builder: &Builder<'_>, target: TargetSelection) -> Gc ) }); + // Initialize the gcc submodule if not initialized already. + builder.config.update_submodule("src/gcc"); + + let root = builder.src.join("src/gcc"); + let out_dir = builder.gcc_out(target).join("build"); + let install_dir = builder.gcc_out(target).join("install"); + let stamp = BuildStamp::new(&out_dir).with_prefix("gcc").add_stamp(smart_stamp_hash); if stamp.is_up_to_date() { @@ -87,116 +172,72 @@ fn libgccjit_built_path(install_dir: &Path) -> PathBuf { install_dir.join("lib/libgccjit.so") } -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct Gcc { - pub target: TargetSelection, -} - -#[derive(Clone)] -pub struct GccOutput { - pub libgccjit: PathBuf, -} +fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) { + let Meta { stamp: _, out_dir, install_dir, root } = metadata; -impl Step for Gcc { - type Output = GccOutput; - - const ONLY_HOSTS: bool = true; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/gcc").alias("gcc") - } - - fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Gcc { target: run.target }); - } - - /// Compile GCC (specifically `libgccjit`) for `target`. - fn run(self, builder: &Builder<'_>) -> Self::Output { - let target = self.target; + t!(fs::create_dir_all(out_dir)); + t!(fs::create_dir_all(install_dir)); - // If GCC has already been built, we avoid building it again. - let Meta { stamp, out_dir, install_dir, root } = match prebuilt_gcc_config(builder, target) - { - GccBuildStatus::AlreadyBuilt(path) => return GccOutput { libgccjit: path }, - GccBuildStatus::ShouldBuild(m) => m, - }; - - let _guard = builder.msg_unstaged(Kind::Build, "GCC", target); - t!(stamp.remove()); - let _time = helpers::timeit(builder); - t!(fs::create_dir_all(&out_dir)); - - let libgccjit_path = libgccjit_built_path(&install_dir); - if builder.config.dry_run() { - return GccOutput { libgccjit: libgccjit_path }; + // GCC creates files (e.g. symlinks to the downloaded dependencies) + // in the source directory, which does not work with our CI setup, where we mount + // source directories as read-only on Linux. + // Therefore, as a part of the build in CI, we first copy the whole source directory + // to the build directory, and perform the build from there. + let src_dir = if CiEnv::is_ci() { + let src_dir = builder.gcc_out(target).join("src"); + if src_dir.exists() { + builder.remove_dir(&src_dir); } + builder.create_dir(&src_dir); + builder.cp_link_r(root, &src_dir); + src_dir + } else { + root.clone() + }; - // GCC creates files (e.g. symlinks to the downloaded dependencies) - // in the source directory, which does not work with our CI setup, where we mount - // source directories as read-only on Linux. - // Therefore, as a part of the build in CI, we first copy the whole source directory - // to the build directory, and perform the build from there. - let src_dir = if CiEnv::is_ci() { - let src_dir = builder.gcc_out(target).join("src"); - if src_dir.exists() { - builder.remove_dir(&src_dir); - } - builder.create_dir(&src_dir); - builder.cp_link_r(&root, &src_dir); - src_dir - } else { - root - }; + command(src_dir.join("contrib/download_prerequisites")).current_dir(&src_dir).run(builder); + let mut configure_cmd = command(src_dir.join("configure")); + configure_cmd + .current_dir(out_dir) + // On CI, we compile GCC with Clang. + // The -Wno-everything flag is needed to make GCC compile with Clang 19. + // `-g -O2` are the default flags that are otherwise used by Make. + // FIXME(kobzol): change the flags once we have [gcc] configuration in config.toml. + .env("CXXFLAGS", "-Wno-everything -g -O2") + .env("CFLAGS", "-Wno-everything -g -O2") + .arg("--enable-host-shared") + .arg("--enable-languages=jit") + .arg("--enable-checking=release") + .arg("--disable-bootstrap") + .arg("--disable-multilib") + .arg(format!("--prefix={}", install_dir.display())); + let cc = builder.build.cc(target).display().to_string(); + let cc = builder + .build + .config + .ccache + .as_ref() + .map_or_else(|| cc.clone(), |ccache| format!("{ccache} {cc}")); + configure_cmd.env("CC", cc); - command(src_dir.join("contrib/download_prerequisites")).current_dir(&src_dir).run(builder); - let mut configure_cmd = command(src_dir.join("configure")); - configure_cmd - .current_dir(&out_dir) - // On CI, we compile GCC with Clang. - // The -Wno-everything flag is needed to make GCC compile with Clang 19. - // `-g -O2` are the default flags that are otherwise used by Make. - // FIXME(kobzol): change the flags once we have [gcc] configuration in config.toml. - .env("CXXFLAGS", "-Wno-everything -g -O2") - .env("CFLAGS", "-Wno-everything -g -O2") - .arg("--enable-host-shared") - .arg("--enable-languages=jit") - .arg("--enable-checking=release") - .arg("--disable-bootstrap") - .arg("--disable-multilib") - .arg(format!("--prefix={}", install_dir.display())); - let cc = builder.build.cc(target).display().to_string(); - let cc = builder + if let Ok(ref cxx) = builder.build.cxx(target) { + let cxx = cxx.display().to_string(); + let cxx = builder .build .config .ccache .as_ref() - .map_or_else(|| cc.clone(), |ccache| format!("{ccache} {cc}")); - configure_cmd.env("CC", cc); - - if let Ok(ref cxx) = builder.build.cxx(target) { - let cxx = cxx.display().to_string(); - let cxx = builder - .build - .config - .ccache - .as_ref() - .map_or_else(|| cxx.clone(), |ccache| format!("{ccache} {cxx}")); - configure_cmd.env("CXX", cxx); - } - configure_cmd.run(builder); - - command("make").current_dir(&out_dir).arg(format!("-j{}", builder.jobs())).run(builder); - command("make").current_dir(&out_dir).arg("install").run(builder); - - let lib_alias = install_dir.join("lib/libgccjit.so.0"); - if !lib_alias.exists() { - t!(builder.symlink_file(&libgccjit_path, lib_alias)); - } - - t!(stamp.write()); - - GccOutput { libgccjit: libgccjit_path } + .map_or_else(|| cxx.clone(), |ccache| format!("{ccache} {cxx}")); + configure_cmd.env("CXX", cxx); } + configure_cmd.run(builder); + + command("make") + .current_dir(out_dir) + .arg("--silent") + .arg(format!("-j{}", builder.jobs())) + .run_capture_stdout(builder); + command("make").current_dir(out_dir).arg("--silent").arg("install").run_capture_stdout(builder); } /// Configures a Cargo invocation so that it can build the GCC codegen backend. @@ -204,3 +245,34 @@ pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) { // Add the path to libgccjit.so to the linker search paths. cargo.rustflag(&format!("-L{}", gcc.libgccjit.parent().unwrap().to_str().unwrap())); } + +/// The absolute path to the downloaded GCC artifacts. +fn ci_gcc_root(config: &Config) -> PathBuf { + config.out.join(config.build).join("ci-gcc") +} + +/// This retrieves the GCC sha we *want* to use, according to git history. +fn detect_gcc_sha(config: &Config, is_git: bool) -> String { + let gcc_sha = if is_git { + get_closest_merge_commit( + Some(&config.src), + &config.git_config(), + &[config.src.join("src/gcc"), config.src.join("src/bootstrap/download-ci-gcc-stamp")], + ) + .unwrap() + } else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) { + info.sha.trim().to_owned() + } else { + "".to_owned() + }; + + if gcc_sha.is_empty() { + eprintln!("error: could not find commit hash for downloading GCC"); + eprintln!("HELP: maybe your repository history is too shallow?"); + eprintln!("HELP: consider disabling `download-ci-gcc`"); + eprintln!("HELP: or fetch enough history to include one upstream commit"); + panic!(); + } + + gcc_sha +} diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index c477bdb829a91..95feb41ffd0cc 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -826,6 +826,34 @@ download-rustc = false let llvm_root = self.ci_llvm_root(); self.unpack(&tarball, &llvm_root, "rust-dev"); } + + pub fn download_ci_gcc(&self, gcc_sha: &str, root_dir: &Path) { + let cache_prefix = format!("gcc-{gcc_sha}"); + let cache_dst = + self.bootstrap_cache_path.as_ref().cloned().unwrap_or_else(|| self.out.join("cache")); + + let gcc_cache = cache_dst.join(cache_prefix); + if !gcc_cache.exists() { + t!(fs::create_dir_all(&gcc_cache)); + } + let base = &self.stage0_metadata.config.artifacts_server; + let filename = format!("gcc-nightly-{}.tar.xz", self.build.triple); + let tarball = gcc_cache.join(&filename); + if !tarball.exists() { + let help_on_error = "ERROR: failed to download gcc from ci + + HELP: There could be two reasons behind this: + 1) The host triple is not supported for `download-ci-gcc`. + 2) Old builds get deleted after a certain time. + HELP: In either case, disable `download-ci-gcc` in your config.toml: + + [gcc] + download-ci-gcc = false + "; + self.download_file(&format!("{base}/{gcc_sha}/{filename}"), &tarball, help_on_error); + } + self.unpack(&tarball, root_dir, "gcc"); + } } fn path_is_dylib(path: &Path) -> bool { From 44b48a748caf8922bc63bb5c44f3fb53cbac64ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 5 Mar 2025 11:39:43 +0100 Subject: [PATCH 48/64] Add change tracker entry --- src/bootstrap/src/utils/change_tracker.rs | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 9b23cf1843ef5..ec27109c117ae 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -350,4 +350,29 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "The llvm.ccache option has moved to build.ccache. llvm.ccache is now deprecated.", }, + ChangeInfo { + change_id: 137170, + severity: ChangeSeverity::Info, + summary: "It is now possible to configure `jemalloc` for each target", + }, + ChangeInfo { + change_id: 137215, + severity: ChangeSeverity::Info, + summary: "Added `build.test-stage = 2` to 'tools' profile defaults", + }, + ChangeInfo { + change_id: 137220, + severity: ChangeSeverity::Info, + summary: "`rust.channel` now supports \"auto-detect\" to load the channel from `src/ci/channel`", + }, + ChangeInfo { + change_id: 137723, + severity: ChangeSeverity::Info, + summary: "The rust.description option has moved to build.description and rust.description is now deprecated.", + }, + ChangeInfo { + change_id: 138051, + severity: ChangeSeverity::Info, + summary: "There is now a new `gcc` config section that can be used to download GCC from CI using `gcc.download-ci-gcc = true`", + }, ]; From 69eafa795f67b4f084c12f506b061fc6d0c77dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 10 Mar 2025 11:29:04 +0100 Subject: [PATCH 49/64] Add triagebot entry for GCC modifications --- triagebot.toml | 59 +++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/triagebot.toml b/triagebot.toml index 512736b0e8ffe..91d0edbe76289 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -18,6 +18,7 @@ allow-unauthenticated = [ "WG-*", "-Z*", "beta-nominated", + "CI-spurious-*", "const-hack", "llvm-*", "needs-fcp", @@ -207,7 +208,7 @@ trigger_files = [ "tests/rustdoc", "tests/rustdoc-ui", "tests/rustdoc-gui", - "tests/rustdoc-js", + "tests/rustdoc-js/", "tests/rustdoc-js-std", "tests/rustdoc-json", @@ -252,7 +253,6 @@ trigger_files = [ "compiler/rustc_passes/src/check_attr.rs", "compiler/rustc_attr_parsing", "compiler/rustc_attr_data_structures", - "compiler/rustc_attr_validation", ] [autolabel."T-rustdoc-frontend"] @@ -316,7 +316,6 @@ trigger_files = [ "library/panic_unwind", "library/std", "library/stdarch", - "library/term", "library/test", ] exclude_labels = [ @@ -331,7 +330,7 @@ trigger_files = [ [autolabel."O-apple"] trigger_files = [ "library/std/src/os/darwin", - "library/std/src/sys/pal/unix/thread_parking/darwin.rs", + "library/std/src/sys/sync/thread_parking/darwin.rs", "compiler/rustc_target/src/spec/base/apple", ] @@ -408,7 +407,8 @@ trigger_files = [ [autolabel."O-wasm"] trigger_files = [ "library/std/src/sys/pal/wasm", - "library/std/src/os/wasm" + "library/std/src/os/wasi", + "library/std/src/os/wasip2" ] [autolabel."O-windows"] @@ -499,7 +499,6 @@ trigger_files = [ "CONTRIBUTING.md", "INSTALL.md", "REUSE.toml", - ".reuse", ".mailmap", ".git-blame-ignore-revs", ".editorconfig" @@ -524,7 +523,6 @@ exclude_labels = [ [autolabel."WG-trait-system-refactor"] trigger_files = [ - "compiler/rustc_middle/src/traits/solve", "compiler/rustc_next_trait_solver", "compiler/rustc_trait_selection/src/solve", "compiler/rustc_type_ir/src/solve", @@ -701,12 +699,19 @@ cc = ["@davidtwco", "@wesleywiser"] [mentions."compiler/rustc_codegen_cranelift"] cc = ["@bjorn3"] +[mentions."compiler/rustc_codegen_ssa"] +cc = ["@WaffleLapkin"] + [mentions."compiler/rustc_codegen_gcc"] cc = ["@antoyo", "@GuillaumeGomez"] [mentions."compiler/rustc_const_eval/src/"] message = "Some changes occurred to the CTFE machinery" -cc = ["@rust-lang/wg-const-eval"] +cc = ["@RalfJung", "@oli-obk", "@lcnr"] + +[mentions."compiler/rustc_const_eval/src/check_consts"] +message = "Some changes occurred to constck" +cc = ["@fee1-dead"] [mentions."compiler/rustc_const_eval/src/interpret"] message = "Some changes occurred to the CTFE / Miri interpreter" @@ -730,7 +735,7 @@ cc = ["@compiler-errors", "@lcnr"] [mentions."compiler/rustc_middle/src/mir/interpret"] message = "Some changes occurred to the CTFE / Miri interpreter" -cc = ["@rust-lang/miri", "@rust-lang/wg-const-eval"] +cc = ["@rust-lang/miri", "@RalfJung", "@oli-obk", "@lcnr"] [mentions."compiler/rustc_mir_transform/src/"] message = "Some changes occurred to MIR optimizations" @@ -771,7 +776,7 @@ cc = ["@fmease"] message = "Some changes occurred in diagnostic error codes" cc = ["@GuillaumeGomez"] -[mentions."compiler/rustc_mir_build/src/build/matches"] +[mentions."compiler/rustc_mir_build/src/builder/matches"] message = "Some changes occurred in match lowering" cc = ["@Nadrieril"] @@ -787,7 +792,7 @@ cc = ["@Nadrieril"] message = "Some changes occurred in cfg and check-cfg configuration" cc = ["@Urgau"] -[mentions."compiler/rustc_lint/src/context/diagnostics/check_cfg.rs"] +[mentions."compiler/rustc_lint/src/early/diagnostics/check_cfg.rs"] message = "Some changes occurred in check-cfg diagnostics" cc = ["@Urgau"] @@ -803,7 +808,7 @@ message = """ Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter gets adapted for the changes, if necessary. """ -cc = ["@rust-lang/miri", "@rust-lang/wg-const-eval"] +cc = ["@rust-lang/miri", "@RalfJung", "@oli-obk", "@lcnr"] [mentions."library/portable-simd"] message = """ @@ -834,13 +839,7 @@ message = "Some changes occurred in GUI tests." cc = ["@GuillaumeGomez"] [mentions."tests/run-make/"] -message = """ -This PR modifies `tests/run-make/`. If this PR is trying to port a Makefile -run-make test to use rmake.rs, please update the -[run-make port tracking issue](https://github.com/rust-lang/rust/issues/121876) -so we can track our progress. You can either modify the tracking issue -directly, or you can comment on the tracking issue and link this PR. -""" +message = "This PR modifies `run-make` tests." cc = ["@jieyouxu"] [mentions."src/rustdoc-json-types"] @@ -959,9 +958,15 @@ If appropriate, please update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/util [mentions."src/bootstrap/src/core/build_steps/llvm.rs"] message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp." -[mentions."test/crashes"] +[mentions."src/bootstrap/src/core/build_steps/gcc.rs"] +message = "This PR changes how GCC is built. Consider updating src/bootstrap/download-ci-gcc-stamp." + +[mentions."tests/crashes"] message = "This PR changes a file inside `tests/crashes`. If a crash was fixed, please move into the corresponding `ui` subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge." +[mentions."tests/rustdoc-json"] +cc = ["@aDotInTheVoid"] + [mentions."tests/ui/deriving/deriving-all-codegen.stdout"] message = "Changes to the code generated for builtin derived traits." cc = ["@nnethercote"] @@ -1028,7 +1033,7 @@ cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] message = "Some changes occurred in coverage instrumentation." cc = ["@Zalathar"] -[mentions."compiler/rustc_mir_build/src/build/coverageinfo.rs"] +[mentions."compiler/rustc_mir_build/src/builder/coverageinfo.rs"] message = "Some changes occurred in coverage instrumentation." cc = ["@Zalathar"] @@ -1070,15 +1075,12 @@ cc = ["@jdonszelmann"] cc = ["@jdonszelmann"] [mentions."compiler/rustc_attr_data_structures"] cc = ["@jdonszelmann"] -[mentions."compiler/rustc_attr_validation"] -cc = ["@jdonszelmann"] [assign] warn_non_default_branch.enable = true contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html" users_on_vacation = [ "jyn514", - "workingjubilee", ] [[assign.warn_non_default_branch.exceptions]] @@ -1090,6 +1092,10 @@ title = "[stable" branch = "stable" [assign.adhoc_groups] +compiler_leads = [ + "@davidtwco", + "@wesleywiser", +] compiler = [ "@BoxyUwU", "@cjgillot", @@ -1257,8 +1263,7 @@ project-exploit-mitigations = [ "/compiler/rustc_middle/src/traits" = ["compiler", "types"] "/compiler/rustc_middle/src/ty" = ["compiler", "types"] "/compiler/rustc_const_eval/src/interpret" = ["compiler", "mir"] -"/compiler/rustc_const_eval/src/transform" = ["compiler", "mir-opt"] -"/compiler/rustc_mir_build/src/build" = ["compiler", "mir"] +"/compiler/rustc_mir_build/src/builder" = ["compiler", "mir"] "/compiler/rustc_mir_transform" = ["compiler", "mir", "mir-opt"] "/compiler/rustc_smir" = ["project-stable-mir"] "/compiler/rustc_parse" = ["compiler", "parser"] @@ -1301,7 +1306,7 @@ project-exploit-mitigations = [ "/tests/rustdoc" = ["rustdoc"] "/tests/rustdoc-gui" = ["rustdoc"] "/tests/rustdoc-js-std" = ["rustdoc"] -"/tests/rustdoc-js" = ["rustdoc"] +"/tests/rustdoc-js/" = ["rustdoc"] "/tests/rustdoc-json" = ["@aDotInTheVoid"] "/tests/rustdoc-ui" = ["rustdoc"] "/tests/ui" = ["compiler"] From e3bb81000f5bc6805a83e98e7fb6c470b8c5f57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 11 Mar 2025 11:53:57 +0100 Subject: [PATCH 50/64] Do not download GCC in tests --- src/bootstrap/src/core/build_steps/gcc.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 7e1ec39659a30..5a4bc9bdbcba9 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -13,11 +13,9 @@ use std::path::{Path, PathBuf}; use std::sync::OnceLock; use build_helper::ci::CiEnv; -use build_helper::git::get_closest_merge_commit; -use crate::Config; use crate::core::builder::{Builder, Cargo, Kind, RunConfig, ShouldRun, Step}; -use crate::core::config::{GccCiMode, TargetSelection}; +use crate::core::config::TargetSelection; use crate::utils::build_stamp::{BuildStamp, generate_smart_stamp_hash}; use crate::utils::exec::command; use crate::utils::helpers::{self, t}; @@ -93,9 +91,10 @@ pub enum GccBuildStatus { /// Tries to download GCC from CI if it is enabled and GCC artifacts /// are available for the given target. /// Returns a path to the libgccjit.so file. +#[cfg(not(test))] fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option { // Try to download GCC from CI if configured and available - if !matches!(builder.config.gcc_ci_mode, GccCiMode::DownloadFromCi) { + if !matches!(builder.config.gcc_ci_mode, crate::core::config::GccCiMode::DownloadFromCi) { return None; } if target != "x86_64-unknown-linux-gnu" { @@ -114,6 +113,11 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option, _target: TargetSelection) -> Option { + None +} + /// This returns information about whether GCC should be built or if it's already built. /// It transparently handles downloading GCC from CI if needed. /// @@ -247,12 +251,16 @@ pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) { } /// The absolute path to the downloaded GCC artifacts. -fn ci_gcc_root(config: &Config) -> PathBuf { +#[cfg(not(test))] +fn ci_gcc_root(config: &crate::Config) -> PathBuf { config.out.join(config.build).join("ci-gcc") } /// This retrieves the GCC sha we *want* to use, according to git history. -fn detect_gcc_sha(config: &Config, is_git: bool) -> String { +#[cfg(not(test))] +fn detect_gcc_sha(config: &crate::Config, is_git: bool) -> String { + use build_helper::git::get_closest_merge_commit; + let gcc_sha = if is_git { get_closest_merge_commit( Some(&config.src), From f367b6e29e89042318876980d903d76de735e18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 12 Mar 2025 17:24:51 +0100 Subject: [PATCH 51/64] Change GCC build flags --- src/bootstrap/src/core/build_steps/gcc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 5a4bc9bdbcba9..372cbc8d35dbe 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -210,7 +210,7 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) { .env("CXXFLAGS", "-Wno-everything -g -O2") .env("CFLAGS", "-Wno-everything -g -O2") .arg("--enable-host-shared") - .arg("--enable-languages=jit") + .arg("--enable-languages=c,jit,lto") .arg("--enable-checking=release") .arg("--disable-bootstrap") .arg("--disable-multilib") From 530c908c13ded4f7727f3a49ac7cc0d775b0668b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 13 Mar 2025 11:31:08 +0100 Subject: [PATCH 52/64] Use GCC for building GCC --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index f54ecef1e308a..ae5bf8946dd94 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -101,7 +101,9 @@ ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ --host $HOSTS --target $HOSTS \ --include-default-paths \ - build-manifest bootstrap gcc + build-manifest bootstrap && \ + # Use GCC for building GCC, as it seems to behave badly when built with Clang + CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang # This is the only builder which will create source tarballs From 5fec5e6bc75d171350b5ada5389dfbec1f5f7adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 13 Mar 2025 16:27:41 +0100 Subject: [PATCH 53/64] Do not overwrite original `config.toml` in `opt-dist` So that follow-up CI commands can proceed normally. It will also avoid overwriting `config.toml` when running opt-dist tests locally. --- src/tools/opt-dist/src/tests.rs | 81 +++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index 8b3bd77141ba8..c8759bb6ff62a 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -1,3 +1,5 @@ +use std::path::Path; + use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; @@ -86,36 +88,57 @@ llvm-config = "{llvm_config}" log::info!("Using following `config.toml` for running tests:\n{config_content}"); // Simulate a stage 0 compiler with the extracted optimized dist artifacts. - std::fs::write("config.toml", config_content)?; - - let x_py = env.checkout_path().join("x.py"); - let mut args = vec![ - env.python_binary(), - x_py.as_str(), - "test", - "--build", - env.host_tuple(), - "--stage", - "0", - "tests/assembly", - "tests/codegen", - "tests/codegen-units", - "tests/incremental", - "tests/mir-opt", - "tests/pretty", - "tests/run-make/glibc-symbols-x86_64-unknown-linux-gnu", - "tests/ui", - "tests/crashes", - ]; - for test_path in env.skipped_tests() { - args.extend(["--skip", test_path]); + with_backed_up_file(Path::new("config.toml"), &config_content, || { + let x_py = env.checkout_path().join("x.py"); + let mut args = vec![ + env.python_binary(), + x_py.as_str(), + "test", + "--build", + env.host_tuple(), + "--stage", + "0", + "tests/assembly", + "tests/codegen", + "tests/codegen-units", + "tests/incremental", + "tests/mir-opt", + "tests/pretty", + "tests/run-make/glibc-symbols-x86_64-unknown-linux-gnu", + "tests/ui", + "tests/crashes", + ]; + for test_path in env.skipped_tests() { + args.extend(["--skip", test_path]); + } + cmd(&args) + .env("COMPILETEST_FORCE_STAGE0", "1") + // Also run dist-only tests + .env("COMPILETEST_ENABLE_DIST_TESTS", "1") + .run() + .context("Cannot execute tests") + }) +} + +/// Backup `path` (if it exists), then write `contents` into it, and then restore the original +/// contents of the file. +fn with_backed_up_file(path: &Path, contents: &str, func: F) -> anyhow::Result<()> +where + F: FnOnce() -> anyhow::Result<()>, +{ + let original_contents = + if path.is_file() { Some(std::fs::read_to_string(path)?) } else { None }; + + // Overwrite it with new contents + std::fs::write(path, contents)?; + + let ret = func(); + + if let Some(original_contents) = original_contents { + std::fs::write(path, original_contents)?; } - cmd(&args) - .env("COMPILETEST_FORCE_STAGE0", "1") - // Also run dist-only tests - .env("COMPILETEST_ENABLE_DIST_TESTS", "1") - .run() - .context("Cannot execute tests") + + ret } /// Tries to find the version of the dist artifacts (either nightly, beta, or 1.XY.Z). From 1470024a1fee7f1b978fbbea45b0227d852a9b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 13 Mar 2025 21:32:23 +0100 Subject: [PATCH 54/64] Store libgccjit.so in a lib directory in the GCC CI tarball --- src/bootstrap/src/core/build_steps/dist.rs | 2 +- src/bootstrap/src/core/build_steps/gcc.rs | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index a136f115807fb..e912fe1a70186 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -2473,7 +2473,7 @@ impl Step for Gcc { fn run(self, builder: &Builder<'_>) -> Self::Output { let tarball = Tarball::new(builder, "gcc", &self.target.triple); let output = builder.ensure(super::gcc::Gcc { target: self.target }); - tarball.add_file(output.libgccjit, ".", 0o644); + tarball.add_file(output.libgccjit, "lib", 0o644); tarball.generate() } } diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 372cbc8d35dbe..19525d4ebed1c 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -63,11 +63,7 @@ impl Step for Gcc { } build_gcc(&metadata, builder, target); - - let lib_alias = metadata.install_dir.join("lib/libgccjit.so.0"); - if !lib_alias.exists() { - t!(builder.symlink_file(&libgccjit_path, lib_alias)); - } + create_lib_alias(builder, &libgccjit_path); t!(metadata.stamp.write()); @@ -75,6 +71,15 @@ impl Step for Gcc { } } +/// Creates a libgccjit.so.0 alias next to libgccjit.so if it does not +/// already exist +fn create_lib_alias(builder: &Builder<'_>, libgccjit: &PathBuf) { + let lib_alias = libgccjit.parent().unwrap().join("libgccjit.so.0"); + if !lib_alias.exists() { + t!(builder.symlink_file(libgccjit, lib_alias)); + } +} + pub struct Meta { stamp: BuildStamp, out_dir: PathBuf, @@ -109,8 +114,10 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option Date: Fri, 14 Mar 2025 09:16:06 +0100 Subject: [PATCH 55/64] Ensure that GCC is not built using Clang, as it misbehaves --- src/bootstrap/src/core/build_steps/gcc.rs | 15 +++++++++------ src/bootstrap/src/lib.rs | 11 +++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 19525d4ebed1c..0aa2a3325313f 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -184,6 +184,14 @@ fn libgccjit_built_path(install_dir: &Path) -> PathBuf { } fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) { + if builder.build.cc_tool(target).is_like_clang() + || builder.build.cxx_tool(target).is_like_clang() + { + panic!( + "Attempting to build GCC using Clang, which is known to misbehave. Please use GCC as the host C/C++ compiler. " + ); + } + let Meta { stamp: _, out_dir, install_dir, root } = metadata; t!(fs::create_dir_all(out_dir)); @@ -210,18 +218,13 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) { let mut configure_cmd = command(src_dir.join("configure")); configure_cmd .current_dir(out_dir) - // On CI, we compile GCC with Clang. - // The -Wno-everything flag is needed to make GCC compile with Clang 19. - // `-g -O2` are the default flags that are otherwise used by Make. - // FIXME(kobzol): change the flags once we have [gcc] configuration in config.toml. - .env("CXXFLAGS", "-Wno-everything -g -O2") - .env("CFLAGS", "-Wno-everything -g -O2") .arg("--enable-host-shared") .arg("--enable-languages=c,jit,lto") .arg("--enable-checking=release") .arg("--disable-bootstrap") .arg("--disable-multilib") .arg(format!("--prefix={}", install_dir.display())); + let cc = builder.build.cc(target).display().to_string(); let cc = builder .build diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 21b02a3b541a1..10a85f2f1a2c8 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -27,6 +27,7 @@ use std::{env, fs, io, str}; use build_helper::ci::gha; use build_helper::exit; +use cc::Tool; use termcolor::{ColorChoice, StandardStream, WriteColor}; use utils::build_stamp::BuildStamp; use utils::channel::GitInfo; @@ -1193,6 +1194,16 @@ Executed at: {executed_at}"#, self.cc.borrow()[&target].path().into() } + /// Returns the internal `cc::Tool` for the C compiler. + fn cc_tool(&self, target: TargetSelection) -> Tool { + self.cc.borrow()[&target].clone() + } + + /// Returns the internal `cc::Tool` for the C++ compiler. + fn cxx_tool(&self, target: TargetSelection) -> Tool { + self.cxx.borrow()[&target].clone() + } + /// Returns C flags that `cc-rs` thinks should be enabled for the /// specified target by default. fn cc_handled_clags(&self, target: TargetSelection, c: CLang) -> Vec { From 20f0e27543c2839ac8c14259c475c6dfe2b14d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 16 Mar 2025 13:26:30 +0100 Subject: [PATCH 56/64] Fix bug in `get_git_modified_files` It was ignoring files without extension. --- src/build_helper/src/git.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index 3ef9c7ac35e9d..512b522061c58 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -186,7 +186,7 @@ pub fn get_git_modified_files( let (status, name) = f.trim().split_once(char::is_whitespace).unwrap(); if status == "D" { None - } else if Path::new(name).extension().map_or(false, |ext| { + } else if Path::new(name).extension().map_or(true, |ext| { extensions.is_empty() || extensions.contains(&ext.to_str().unwrap()) }) { Some(name.to_owned()) From dc47f91285318447977a921036574bb5c8319b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 16 Mar 2025 13:34:02 +0100 Subject: [PATCH 57/64] Implement a new unified function for figuring out how if a set of paths have been modified locally Also adds several git tests to make sure that the behavior works in common cases (PR CI, auto CI, local usage). --- Cargo.lock | 35 ++++- src/bootstrap/Cargo.lock | 10 +- src/build_helper/Cargo.toml | 3 + src/build_helper/src/git.rs | 179 ++++++++++++++++++++- src/build_helper/src/git/tests.rs | 253 ++++++++++++++++++++++++++++++ 5 files changed, 463 insertions(+), 17 deletions(-) create mode 100644 src/build_helper/src/git/tests.rs diff --git a/Cargo.lock b/Cargo.lock index 38a861727a9d3..f3dc1effa73f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,6 +317,7 @@ version = "0.1.0" dependencies = [ "serde", "serde_derive", + "tempfile", ] [[package]] @@ -2135,6 +2136,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + [[package]] name = "litemap" version = "0.7.4" @@ -4832,7 +4839,20 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] @@ -5246,15 +5266,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.15.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.2.15", + "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -6599,8 +6618,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "linux-raw-sys 0.4.15", + "rustix 0.38.43", ] [[package]] diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index 890e64e2babbc..75bc7d7850d44 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -225,12 +225,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -334,9 +334,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libredox" diff --git a/src/build_helper/Cargo.toml b/src/build_helper/Cargo.toml index 66894e1abc40e..bdead0a36de0a 100644 --- a/src/build_helper/Cargo.toml +++ b/src/build_helper/Cargo.toml @@ -8,3 +8,6 @@ edition = "2021" [dependencies] serde = "1" serde_derive = "1" + +[dev-dependencies] +tempfile = "3.19" diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index 512b522061c58..980cc5346abd1 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -1,3 +1,6 @@ +#[cfg(test)] +mod tests; + use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -129,7 +132,7 @@ pub fn get_closest_merge_commit( git.current_dir(git_dir); } - let channel = include_str!("../../ci/channel"); + let channel = include_str!("../../ci/channel").trim(); let merge_base = { if CiEnv::is_ci() && @@ -165,7 +168,175 @@ pub fn get_closest_merge_commit( Ok(output_result(&mut git)?.trim().to_owned()) } +/// Represents the result of checking whether a set of paths +/// have been modified locally or not. +#[derive(PartialEq, Debug)] +pub enum PathFreshness { + /// Artifacts should be downloaded from this upstream commit, + /// there are no local modifications. + LastModifiedUpstream { upstream: String }, + /// There are local modifications to a certain set of paths. + /// "Local" essentially means "not-upstream" here. + /// `upstream` is the latest upstream merge commit that made modifications to the + /// set of paths. + HasLocalModifications { upstream: String }, +} + +/// This function figures out if a set of paths was last modified upstream or +/// if there are some local modifications made to them. +/// +/// It can be used to figure out if we should download artifacts from CI or rather +/// build them locally. +/// +/// `target_paths` should be a non-empty slice of paths (relative to `git_dir` or the +/// current working directory) whose modifications would invalidate the artifact. +/// +/// The function behaves differently in CI and outside CI. +/// +/// - Outside CI, we want to find out if `target_paths` were modified in some local commit on +/// top of the local master branch. +/// If not, we try to find the most recent upstream commit (which we assume are commits +/// made by bors) that modified `target_paths`. +/// We don't want to simply take the latest master commit to avoid changing the output of +/// this function frequently after rebasing on the latest master branch even if `target_paths` +/// were not modified upstream in the meantime. In that case we would be redownloading CI +/// artifacts unnecessarily. +/// +/// - In CI, we always fetch only a single parent merge commit, so we do not have access +/// to the full git history. +/// Luckily, we only need to distinguish between two situations. The first is that the current +/// PR made modifications to `target_paths`. If not, then we simply take the latest upstream +/// commit, because on CI there is no need to avoid redownloading. +pub fn check_path_modifications( + git_dir: Option<&Path>, + config: &GitConfig<'_>, + target_paths: &[&str], + ci_env: CiEnv, +) -> Result { + assert!(!target_paths.is_empty()); + for path in target_paths { + assert!(Path::new(path.trim_start_matches(":!")).is_relative()); + } + + let upstream_sha = if matches!(ci_env, CiEnv::GitHubActions) { + // Here the situation is different for PR CI and try/auto CI. + // For PR CI, we have the following history: + // + // 1-N PR commits + // upstream merge commit made by bors + // + // For try/auto CI, we have the following history: + // <**non-upstream** merge commit made by bors> + // 1-N PR commits + // upstream merge commit made by bors + // + // But on both cases, HEAD should be a merge commit. + // So if HEAD contains modifications of `target_paths`, our PR has modified + // them. If not, we can use the only available upstream commit for downloading + // artifacts. + + // Do not include HEAD, as it is never an upstream commit + get_closest_upstream_commit(git_dir, config, ci_env)? + } else { + // Outside CI, we have to find the most recent upstream commit that + // modified the set of paths, to have an upstream reference. + let upstream_sha = get_latest_commit_that_modified_files( + git_dir, + target_paths, + config.git_merge_commit_email, + )?; + let Some(upstream_sha) = upstream_sha else { + eprintln!("No upstream commit that modified paths {target_paths:?} found."); + eprintln!("Try to fetch more upstream history."); + return Err("No upstream commit with modifications found".to_string()); + }; + upstream_sha + }; + + if has_changed_since(git_dir, &upstream_sha, target_paths) { + Ok(PathFreshness::HasLocalModifications { upstream: upstream_sha }) + } else { + Ok(PathFreshness::LastModifiedUpstream { upstream: upstream_sha }) + } +} + +/// Returns true if any of the passed `paths` have changed since the `base` commit. +pub fn has_changed_since(git_dir: Option<&Path>, base: &str, paths: &[&Path]) -> bool { + let mut git = Command::new("git"); + + if let Some(git_dir) = git_dir { + git.current_dir(git_dir); + } + + git.args(["diff-index", "--quiet", base, "--"]).args(paths); + + // Exit code 0 => no changes + // Exit code 1 => some changes were detected + !git.status().expect("cannot run git diff-index").success() +} + +/// Returns the latest commit that modified `target_paths`, or `None` if no such commit was found. +/// If `author` is `Some`, only considers commits made by that author. +fn get_latest_commit_that_modified_files( + git_dir: Option<&Path>, + target_paths: &[&str], + author: &str, +) -> Result, String> { + let mut git = Command::new("git"); + + if let Some(git_dir) = git_dir { + git.current_dir(git_dir); + } + + git.args(["rev-list", "-n1", "--first-parent", "HEAD", "--author", author]); + + if !target_paths.is_empty() { + git.arg("--").args(target_paths); + } + let output = output_result(&mut git)?.trim().to_owned(); + if output.is_empty() { Ok(None) } else { Ok(Some(output)) } +} + +/// Returns the most recent commit found in the local history that should definitely +/// exist upstream. We identify upstream commits by the e-mail of the commit author. +/// +/// If `include_head` is false, the HEAD (current) commit will be ignored and only +/// its parents will be searched. This is useful for try/auto CI, where HEAD is +/// actually a commit made by bors, although it is not upstream yet. +fn get_closest_upstream_commit( + git_dir: Option<&Path>, + config: &GitConfig<'_>, + env: CiEnv, +) -> Result { + let mut git = Command::new("git"); + + if let Some(git_dir) = git_dir { + git.current_dir(git_dir); + } + + let base = match env { + CiEnv::None => "HEAD", + CiEnv::GitHubActions => { + // On CI, we always have a merge commit at the tip. + // We thus skip it, because although it can be creatd by + // `config.git_merge_commit_email`, it should not be upstream. + "HEAD^1" + } + }; + git.args([ + "rev-list", + &format!("--author={}", config.git_merge_commit_email), + "-n1", + "--first-parent", + &base, + ]); + + Ok(output_result(&mut git)?.trim().to_owned()) +} + /// Returns the files that have been modified in the current branch compared to the master branch. +/// This includes committed changes, uncommitted changes, and changes that are not even staged. +/// /// The `extensions` parameter can be used to filter the files by their extension. /// Does not include removed files. /// If `extensions` is empty, all files will be returned. @@ -173,8 +344,8 @@ pub fn get_git_modified_files( config: &GitConfig<'_>, git_dir: Option<&Path>, extensions: &[&str], -) -> Result>, String> { - let merge_base = get_closest_merge_commit(git_dir, config, &[])?; +) -> Result, String> { + let merge_base = get_closest_upstream_commit(git_dir, config, CiEnv::None)?; let mut git = Command::new("git"); if let Some(git_dir) = git_dir { @@ -195,7 +366,7 @@ pub fn get_git_modified_files( } }) .collect(); - Ok(Some(files)) + Ok(files) } /// Returns the files that haven't been added to git yet. diff --git a/src/build_helper/src/git/tests.rs b/src/build_helper/src/git/tests.rs new file mode 100644 index 0000000000000..ad69518998f73 --- /dev/null +++ b/src/build_helper/src/git/tests.rs @@ -0,0 +1,253 @@ +use crate::ci::CiEnv; +use crate::git::{GitConfig, PathFreshness, check_path_modifications}; +use std::ffi::OsStr; +use std::fs::OpenOptions; +use std::process::Command; + +#[test] +fn test_pr_ci_unchanged_anywhere() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_nonupstream_merge(&["b"]); + let src = ctx.get_source(&["c"], CiEnv::GitHubActions); + assert_eq!(src, PathFreshness::LastModifiedUpstream { upstream: sha }); + }); +} + +#[test] +fn test_pr_ci_changed_in_pr() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_nonupstream_merge(&["b"]); + let src = ctx.get_source(&["b"], CiEnv::GitHubActions); + assert_eq!(src, PathFreshness::HasLocalModifications { upstream: sha }); + }); +} + +#[test] +fn test_auto_ci_unchanged_anywhere_select_parent() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_upstream_merge(&["b"]); + let src = ctx.get_source(&["c"], CiEnv::GitHubActions); + assert_eq!(src, PathFreshness::LastModifiedUpstream { upstream: sha }); + }); +} + +#[test] +fn test_auto_ci_changed_in_pr() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_upstream_merge(&["b", "c"]); + let src = ctx.get_source(&["c", "d"], CiEnv::GitHubActions); + assert_eq!(src, PathFreshness::HasLocalModifications { upstream: sha }); + }); +} + +#[test] +fn test_local_uncommitted_modifications() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_branch("feature"); + ctx.modify("a"); + + assert_eq!( + ctx.get_source(&["a", "d"], CiEnv::None), + PathFreshness::HasLocalModifications { upstream: sha } + ); + }); +} + +#[test] +fn test_local_committed_modifications() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a"]); + ctx.create_upstream_merge(&["b", "c"]); + ctx.create_branch("feature"); + ctx.modify("x"); + ctx.commit(); + ctx.modify("a"); + ctx.commit(); + + assert_eq!( + ctx.get_source(&["a", "d"], CiEnv::None), + PathFreshness::HasLocalModifications { upstream: sha } + ); + }); +} + +#[test] +fn test_local_committed_modifications_subdirectory() { + git_test(|ctx| { + let sha = ctx.create_upstream_merge(&["a/b/c"]); + ctx.create_upstream_merge(&["b", "c"]); + ctx.create_branch("feature"); + ctx.modify("a/b/d"); + ctx.commit(); + + assert_eq!( + ctx.get_source(&["a/b"], CiEnv::None), + PathFreshness::HasLocalModifications { upstream: sha } + ); + }); +} + +#[test] +fn test_changes_in_head_upstream() { + git_test(|ctx| { + // We want to resolve to the upstream commit that made modifications to a, + // even if it is currently HEAD + let sha = ctx.create_upstream_merge(&["a"]); + assert_eq!( + ctx.get_source(&["a", "d"], CiEnv::None), + PathFreshness::LastModifiedUpstream { upstream: sha } + ); + }); +} + +#[test] +fn test_changes_in_previous_upstream() { + git_test(|ctx| { + // We want to resolve to this commit, which modified a + let sha = ctx.create_upstream_merge(&["a", "e"]); + // Not to this commit, which is the latest upstream commit + ctx.create_upstream_merge(&["b", "c"]); + ctx.create_branch("feature"); + ctx.modify("d"); + ctx.commit(); + assert_eq!( + ctx.get_source(&["a"], CiEnv::None), + PathFreshness::LastModifiedUpstream { upstream: sha } + ); + }); +} + +struct GitCtx { + dir: tempfile::TempDir, + git_repo: String, + nightly_branch: String, + merge_bot_email: String, +} + +impl GitCtx { + fn new() -> Self { + let dir = tempfile::TempDir::new().unwrap(); + let ctx = Self { + dir, + git_repo: "rust-lang/rust".to_string(), + nightly_branch: "nightly".to_string(), + merge_bot_email: "Merge bot ".to_string(), + }; + ctx.run_git(&["init"]); + ctx.run_git(&["config", "user.name", "Tester"]); + ctx.run_git(&["config", "user.email", "tester@rust-lang.org"]); + ctx.modify("README.md"); + ctx.commit(); + ctx.run_git(&["branch", "-m", "main"]); + ctx + } + + fn get_source(&self, target_paths: &[&str], ci_env: CiEnv) -> PathFreshness { + check_path_modifications(Some(self.dir.path()), &self.git_config(), target_paths, ci_env) + .unwrap() + } + + fn create_upstream_merge(&self, modified_files: &[&str]) -> String { + self.create_branch_and_merge("previous-pr", modified_files, &self.merge_bot_email) + } + + fn create_nonupstream_merge(&self, modified_files: &[&str]) -> String { + self.create_branch_and_merge("pr", modified_files, "Tester ") + } + + fn create_branch_and_merge( + &self, + branch: &str, + modified_files: &[&str], + author: &str, + ) -> String { + self.create_branch(branch); + for file in modified_files { + self.modify(file); + } + self.commit(); + self.switch_to_branch("main"); + self.merge(branch, author); + self.run_git(&["branch", "-d", branch]); + self.get_current_commit() + } + + fn get_current_commit(&self) -> String { + self.run_git(&["rev-parse", "HEAD"]) + } + + fn merge(&self, branch: &str, author: &str) { + self.run_git(&["merge", "--no-commit", "--no-ff", branch]); + self.run_git(&[ + "commit".to_string(), + "-m".to_string(), + "Merge of {branch}".to_string(), + "--author".to_string(), + author.to_string(), + ]); + } + + fn modify(&self, path: &str) { + use std::io::Write; + + let path = self.dir.path().join(path); + std::fs::create_dir_all(&path.parent().unwrap()).unwrap(); + + let mut file = OpenOptions::new().create(true).append(true).open(path).unwrap(); + writeln!(file, "line").unwrap(); + } + + fn commit(&self) { + self.run_git(&["add", "."]); + self.run_git(&["commit", "-m", "commit message"]); + } + + fn switch_to_branch(&self, name: &str) { + self.run_git(&["switch", name]); + } + + /// Creates a branch and switches to it. + fn create_branch(&self, name: &str) { + self.run_git(&["checkout", "-b", name]); + } + + fn run_git>(&self, args: &[S]) -> String { + let mut cmd = self.git_cmd(); + cmd.args(args); + eprintln!("Running {cmd:?}"); + let output = cmd.output().unwrap(); + let stdout = String::from_utf8(output.stdout).unwrap().trim().to_string(); + let stderr = String::from_utf8(output.stderr).unwrap().trim().to_string(); + if !output.status.success() { + panic!("Git command `{cmd:?}` failed\nStdout\n{stdout}\nStderr\n{stderr}"); + } + stdout + } + + fn git_cmd(&self) -> Command { + let mut cmd = Command::new("git"); + cmd.current_dir(&self.dir); + cmd + } + + fn git_config(&self) -> GitConfig<'_> { + GitConfig { + git_repository: &self.git_repo, + nightly_branch: &self.nightly_branch, + git_merge_commit_email: &self.merge_bot_email, + } + } +} + +fn git_test(test_fn: F) +where + F: FnOnce(&GitCtx), +{ + let ctx = GitCtx::new(); + test_fn(&ctx); +} From 45277231c28948f388fffd78f11fed4c0754eec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 16 Mar 2025 17:44:07 +0100 Subject: [PATCH 58/64] Use `check_path_modifications` for detecting local GCC changes --- src/bootstrap/src/core/build_steps/gcc.rs | 70 ++++++++++++++--------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 0aa2a3325313f..8a542dea397a3 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -12,13 +12,12 @@ use std::fs; use std::path::{Path, PathBuf}; use std::sync::OnceLock; -use build_helper::ci::CiEnv; - use crate::core::builder::{Builder, Cargo, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; use crate::utils::build_stamp::{BuildStamp, generate_smart_stamp_hash}; use crate::utils::exec::command; use crate::utils::helpers::{self, t}; +use build_helper::ci::CiEnv; #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct Gcc { @@ -106,18 +105,30 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option { + // Download from upstream CI + let root = ci_gcc_root(&builder.config); + let gcc_stamp = BuildStamp::new(&root).with_prefix("gcc").add_stamp(&upstream); + if !gcc_stamp.is_up_to_date() && !builder.config.dry_run() { + builder.config.download_ci_gcc(&upstream, &root); + t!(gcc_stamp.write()); + } + + let libgccjit = root.join("lib").join("libgccjit.so"); + create_lib_alias(builder, &libgccjit); + Some(libgccjit) + } + PathFreshness::HasLocalModifications { .. } => { + // We have local modifications, rebuild GCC. + eprintln!("Found local GCC modifications, GCC will *not* be downloaded"); + None + } } - - let libgccjit = root.join("lib").join("libgccjit.so"); - create_lib_alias(builder, &libgccjit); - Some(libgccjit) } #[cfg(test)] @@ -266,31 +277,34 @@ fn ci_gcc_root(config: &crate::Config) -> PathBuf { config.out.join(config.build).join("ci-gcc") } -/// This retrieves the GCC sha we *want* to use, according to git history. +/// Detect whether GCC sources have been modified locally or not. #[cfg(not(test))] -fn detect_gcc_sha(config: &crate::Config, is_git: bool) -> String { - use build_helper::git::get_closest_merge_commit; - - let gcc_sha = if is_git { - get_closest_merge_commit( - Some(&config.src), - &config.git_config(), - &[config.src.join("src/gcc"), config.src.join("src/bootstrap/download-ci-gcc-stamp")], +fn detect_gcc_freshness(config: &crate::Config, is_git: bool) -> build_helper::git::PathFreshness { + use build_helper::git::{PathFreshness, check_path_modifications}; + + let freshness = if is_git { + Some( + check_path_modifications( + Some(&config.src), + &config.git_config(), + &["src/gcc", "src/bootstrap/download-ci-gcc-stamp"], + CiEnv::current(), + ) + .unwrap(), ) - .unwrap() } else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) { - info.sha.trim().to_owned() + Some(PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }) } else { - "".to_owned() + None }; - if gcc_sha.is_empty() { + let Some(freshness) = freshness else { eprintln!("error: could not find commit hash for downloading GCC"); eprintln!("HELP: maybe your repository history is too shallow?"); eprintln!("HELP: consider disabling `download-ci-gcc`"); eprintln!("HELP: or fetch enough history to include one upstream commit"); panic!(); - } + }; - gcc_sha + freshness } From e7d4f106a29127cea3d6596ce5f112ba9887cf51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 16 Mar 2025 19:43:35 +0100 Subject: [PATCH 59/64] Migrate LLVM CI change detection to `check_path_modifications` --- src/bootstrap/src/core/build_steps/gcc.rs | 5 +- src/bootstrap/src/core/build_steps/llvm.rs | 151 +++++++++------------ src/bootstrap/src/core/config/config.rs | 19 ++- src/bootstrap/src/core/download.rs | 9 +- src/build_helper/src/git.rs | 7 +- src/build_helper/src/git/tests.rs | 5 +- 6 files changed, 102 insertions(+), 94 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 8a542dea397a3..89c6504e63e29 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -12,12 +12,13 @@ use std::fs; use std::path::{Path, PathBuf}; use std::sync::OnceLock; +use build_helper::ci::CiEnv; + use crate::core::builder::{Builder, Cargo, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; use crate::utils::build_stamp::{BuildStamp, generate_smart_stamp_hash}; use crate::utils::exec::command; use crate::utils::helpers::{self, t}; -use build_helper::ci::CiEnv; #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct Gcc { @@ -97,6 +98,8 @@ pub enum GccBuildStatus { /// Returns a path to the libgccjit.so file. #[cfg(not(test))] fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option { + use build_helper::git::PathFreshness; + // Try to download GCC from CI if configured and available if !matches!(builder.config.gcc_ci_mode, crate::core::config::GccCiMode::DownloadFromCi) { return None; diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 18da0e8252b90..bc560a71e180e 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -15,7 +15,9 @@ use std::sync::OnceLock; use std::{env, fs}; use build_helper::ci::CiEnv; -use build_helper::git::get_closest_merge_commit; +use build_helper::git::{PathFreshness, check_path_modifications}; +#[cfg(feature = "tracing")] +use tracing::instrument; use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; use crate::core::config::{Config, TargetSelection}; @@ -24,7 +26,7 @@ use crate::utils::exec::command; use crate::utils::helpers::{ self, exe, get_clang_cl_resource_dir, t, unhashed_basename, up_to_date, }; -use crate::{CLang, GitRepo, Kind}; +use crate::{CLang, GitRepo, Kind, trace}; #[derive(Clone)] pub struct LlvmResult { @@ -172,35 +174,38 @@ pub fn prebuilt_llvm_config( LlvmBuildStatus::ShouldBuild(Meta { stamp, res, out_dir, root: root.into() }) } -/// This retrieves the LLVM sha we *want* to use, according to git history. -pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String { - let llvm_sha = if is_git { - get_closest_merge_commit( - Some(&config.src), - &config.git_config(), - &[ - config.src.join("src/llvm-project"), - config.src.join("src/bootstrap/download-ci-llvm-stamp"), - // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` - config.src.join("src/version"), - ], +/// Detect whether LLVM sources have been modified locally or not. +pub(crate) fn detect_llvm_freshness(config: &Config, is_git: bool) -> PathFreshness { + let freshness = if is_git { + Some( + check_path_modifications( + Some(&config.src), + &config.git_config(), + &[ + "src/llvm-project", + "src/bootstrap/download-ci-llvm-stamp", + // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` + "src/version", + ], + CiEnv::current(), + ) + .unwrap(), ) - .unwrap() } else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) { - info.sha.trim().to_owned() + Some(PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }) } else { - "".to_owned() + None }; - if llvm_sha.is_empty() { + let Some(freshness) = freshness else { eprintln!("error: could not find commit hash for downloading LLVM"); eprintln!("HELP: maybe your repository history is too shallow?"); eprintln!("HELP: consider disabling `download-ci-llvm`"); eprintln!("HELP: or fetch enough history to include one upstream commit"); panic!(); - } + }; - llvm_sha + freshness } /// Returns whether the CI-found LLVM is currently usable. @@ -280,12 +285,7 @@ pub(crate) fn is_ci_llvm_modified(config: &Config) -> bool { return false; } - let llvm_sha = detect_llvm_sha(config, true); - let head_sha = crate::output( - helpers::git(Some(&config.src)).arg("rev-parse").arg("HEAD").as_command_mut(), - ); - let head_sha = head_sha.trim(); - llvm_sha == head_sha + matches!(detect_llvm_freshness(config, true), PathFreshness::HasLocalModifications { .. }) } #[derive(Debug, Clone, Hash, PartialEq, Eq)] @@ -469,6 +469,10 @@ impl Step for Llvm { cfg.define("LLVM_BUILD_32_BITS", "ON"); } + if target.starts_with("x86_64") && target.contains("ohos") { + cfg.define("LLVM_TOOL_LLVM_RTDYLD_BUILD", "OFF"); + } + let mut enabled_llvm_projects = Vec::new(); if helpers::forcing_clang_based_tests() { @@ -516,7 +520,7 @@ impl Step for Llvm { } // https://llvm.org/docs/HowToCrossCompileLLVM.html - if !builder.is_builder_target(&target) { + if !builder.is_builder_target(target) { let LlvmResult { llvm_config, .. } = builder.ensure(Llvm { target: builder.config.build }); if !builder.config.dry_run() { @@ -668,7 +672,7 @@ fn configure_cmake( } cfg.target(&target.triple).host(&builder.config.build.triple); - if !builder.is_builder_target(&target) { + if !builder.is_builder_target(target) { cfg.define("CMAKE_CROSSCOMPILING", "True"); if target.contains("netbsd") { @@ -733,57 +737,17 @@ fn configure_cmake( None => (builder.cc(target), builder.cxx(target).unwrap()), }; - // Handle msvc + ninja + ccache specially (this is what the bots use) - if target.is_msvc() && builder.ninja() && builder.config.ccache.is_some() { - let mut wrap_cc = env::current_exe().expect("failed to get cwd"); - wrap_cc.set_file_name("sccache-plus-cl.exe"); - - cfg.define("CMAKE_C_COMPILER", sanitize_cc(&wrap_cc)) - .define("CMAKE_CXX_COMPILER", sanitize_cc(&wrap_cc)); - cfg.env("SCCACHE_PATH", builder.config.ccache.as_ref().unwrap()) - .env("SCCACHE_TARGET", target.triple) - .env("SCCACHE_CC", &cc) - .env("SCCACHE_CXX", &cxx); - - // Building LLVM on MSVC can be a little ludicrous at times. We're so far - // off the beaten path here that I'm not really sure this is even half - // supported any more. Here we're trying to: - // - // * Build LLVM on MSVC - // * Build LLVM with `clang-cl` instead of `cl.exe` - // * Build a project with `sccache` - // * Build for 32-bit as well - // * Build with Ninja - // - // For `cl.exe` there are different binaries to compile 32/64 bit which - // we use but for `clang-cl` there's only one which internally - // multiplexes via flags. As a result it appears that CMake's detection - // of a compiler's architecture and such on MSVC **doesn't** pass any - // custom flags we pass in CMAKE_CXX_FLAGS below. This means that if we - // use `clang-cl.exe` it's always diagnosed as a 64-bit compiler which - // definitely causes problems since all the env vars are pointing to - // 32-bit libraries. - // - // To hack around this... again... we pass an argument that's - // unconditionally passed in the sccache shim. This'll get CMake to - // correctly diagnose it's doing a 32-bit compilation and LLVM will - // internally configure itself appropriately. - if builder.config.llvm_clang_cl.is_some() && target.contains("i686") { - cfg.env("SCCACHE_EXTRA_ARGS", "-m32"); + // If ccache is configured we inform the build a little differently how + // to invoke ccache while also invoking our compilers. + if use_compiler_launcher { + if let Some(ref ccache) = builder.config.ccache { + cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache) + .define("CMAKE_CXX_COMPILER_LAUNCHER", ccache); } - } else { - // If ccache is configured we inform the build a little differently how - // to invoke ccache while also invoking our compilers. - if use_compiler_launcher { - if let Some(ref ccache) = builder.config.ccache { - cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache) - .define("CMAKE_CXX_COMPILER_LAUNCHER", ccache); - } - } - cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc)) - .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx)) - .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc)); } + cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc)) + .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx)) + .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc)); cfg.build_arg("-j").build_arg(builder.jobs().to_string()); // FIXME(madsmtm): Allow `cmake-rs` to select flags by itself by passing @@ -807,7 +771,9 @@ fn configure_cmake( cflags.push(" "); cflags.push(s); } - + if target.contains("ohos") { + cflags.push(" -D_LINUX_SYSINFO_H"); + } if builder.config.llvm_clang_cl.is_some() { cflags.push(format!(" --target={target}")); } @@ -828,6 +794,9 @@ fn configure_cmake( cxxflags.push(" "); cxxflags.push(s); } + if target.contains("ohos") { + cxxflags.push(" -D_LINUX_SYSINFO_H"); + } if builder.config.llvm_clang_cl.is_some() { cxxflags.push(format!(" --target={target}")); } @@ -934,6 +903,15 @@ impl Step for Enzyme { } /// Compile Enzyme for `target`. + #[cfg_attr( + feature = "tracing", + instrument( + level = "debug", + name = "Enzyme::run", + skip_all, + fields(target = ?self.target), + ), + )] fn run(self, builder: &Builder<'_>) -> PathBuf { builder.require_submodule( "src/tools/enzyme", @@ -959,7 +937,9 @@ impl Step for Enzyme { let out_dir = builder.enzyme_out(target); let stamp = BuildStamp::new(&out_dir).with_prefix("enzyme").add_stamp(smart_stamp_hash); + trace!("checking build stamp to see if we need to rebuild enzyme artifacts"); if stamp.is_up_to_date() { + trace!(?out_dir, "enzyme build artifacts are up to date"); if stamp.stamp().is_empty() { builder.info( "Could not determine the Enzyme submodule commit hash. \ @@ -973,6 +953,7 @@ impl Step for Enzyme { return out_dir; } + trace!(?target, "(re)building enzyme artifacts"); builder.info(&format!("Building Enzyme for {}", target)); t!(stamp.remove()); let _time = helpers::timeit(builder); @@ -982,25 +963,23 @@ impl Step for Enzyme { .config .update_submodule(Path::new("src").join("tools").join("enzyme").to_str().unwrap()); let mut cfg = cmake::Config::new(builder.src.join("src/tools/enzyme/enzyme/")); - // FIXME(ZuseZ4): Find a nicer way to use Enzyme Debug builds - //cfg.profile("Debug"); - //cfg.define("CMAKE_BUILD_TYPE", "Debug"); configure_cmake(builder, target, &mut cfg, true, LdFlags::default(), &[]); // Re-use the same flags as llvm to control the level of debug information - // generated for lld. + // generated by Enzyme. + // FIXME(ZuseZ4): Find a nicer way to use Enzyme Debug builds. let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { (false, _) => "Debug", (true, false) => "Release", (true, true) => "RelWithDebInfo", }; + trace!(?profile); cfg.out_dir(&out_dir) .profile(profile) .env("LLVM_CONFIG_REAL", &llvm_config) .define("LLVM_ENABLE_ASSERTIONS", "ON") .define("ENZYME_EXTERNAL_SHARED_LIB", "ON") - .define("ENZYME_RUNPASS", "ON") .define("LLVM_DIR", builder.llvm_out(target)); cfg.build(); @@ -1118,7 +1097,7 @@ impl Step for Lld { .define("LLVM_CMAKE_DIR", llvm_cmake_dir) .define("LLVM_INCLUDE_TESTS", "OFF"); - if !builder.is_builder_target(&target) { + if !builder.is_builder_target(target) { // Use the host llvm-tblgen binary. cfg.define( "LLVM_TABLEGEN_EXE", @@ -1204,6 +1183,10 @@ impl Step for Sanitizers { cfg.define("COMPILER_RT_USE_LIBCXX", "OFF"); cfg.define("LLVM_CONFIG_PATH", &llvm_config); + if self.target.contains("ohos") { + cfg.define("COMPILER_RT_USE_BUILTINS_LIBRARY", "ON"); + } + // On Darwin targets the sanitizer runtimes are build as universal binaries. // Unfortunately sccache currently lacks support to build them successfully. // Disable compiler launcher on Darwin targets to avoid potential issues. diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 2e834fba35097..4b867aaa3704b 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -15,7 +15,9 @@ use std::{cmp, env, fs}; use build_helper::ci::CiEnv; use build_helper::exit; -use build_helper::git::{GitConfig, get_closest_merge_commit, output_result}; +use build_helper::git::{ + GitConfig, PathFreshness, check_path_modifications, get_closest_merge_commit, output_result, +}; use serde::{Deserialize, Deserializer}; use serde_derive::Deserialize; #[cfg(feature = "tracing")] @@ -3041,9 +3043,7 @@ impl Config { self.update_submodule("src/llvm-project"); // Check for untracked changes in `src/llvm-project`. - let has_changes = self - .last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true) - .is_none(); + let has_changes = self.has_changes_from_upstream(&["src/llvm-project"]); // Return false if there are untracked changes, otherwise check if CI LLVM is available. if has_changes { false } else { llvm::is_ci_llvm_available(self, asserts) } @@ -3067,6 +3067,17 @@ impl Config { } } + /// Returns true if any of the `paths` have been modified locally. + fn has_changes_from_upstream(&self, paths: &[&str]) -> bool { + let freshness = + check_path_modifications(Some(&self.src), &self.git_config(), paths, CiEnv::current()) + .unwrap(); + match freshness { + PathFreshness::LastModifiedUpstream { .. } => false, + PathFreshness::HasLocalModifications { .. } => true, + } + } + /// Returns the last commit in which any of `modified_paths` were changed, /// or `None` if there are untracked changes in the working directory and `if_unchanged` is true. pub fn last_modified_commit( diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index 95feb41ffd0cc..e47164a2bb098 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -721,8 +721,9 @@ download-rustc = false #[cfg(not(test))] pub(crate) fn maybe_download_ci_llvm(&self) { use build_helper::exit; + use build_helper::git::PathFreshness; - use crate::core::build_steps::llvm::detect_llvm_sha; + use crate::core::build_steps::llvm::detect_llvm_freshness; use crate::core::config::check_incompatible_options_for_ci_llvm; if !self.llvm_from_ci { @@ -730,7 +731,11 @@ download-rustc = false } let llvm_root = self.ci_llvm_root(); - let llvm_sha = detect_llvm_sha(self, self.rust_info.is_managed_git_subrepository()); + let llvm_sha = + match detect_llvm_freshness(self, self.rust_info.is_managed_git_subrepository()) { + PathFreshness::LastModifiedUpstream { upstream } => upstream, + PathFreshness::HasLocalModifications { upstream } => upstream, + }; let stamp_key = format!("{}{}", llvm_sha, self.llvm_assertions); let llvm_stamp = BuildStamp::new(&llvm_root).with_prefix("llvm").add_stamp(stamp_key); if !llvm_stamp.is_up_to_date() && !self.dry_run() { diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index 980cc5346abd1..e2168188a03b9 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -253,6 +253,11 @@ pub fn check_path_modifications( upstream_sha }; + // For local environments, we want to find out if something has changed + // from the latest upstream commit. + // However, that should be equivalent to checking if something has changed + // from the latest upstream commit *that modified `target_paths`*, and + // with this approach we do not need to invoke git an additional time. if has_changed_since(git_dir, &upstream_sha, target_paths) { Ok(PathFreshness::HasLocalModifications { upstream: upstream_sha }) } else { @@ -261,7 +266,7 @@ pub fn check_path_modifications( } /// Returns true if any of the passed `paths` have changed since the `base` commit. -pub fn has_changed_since(git_dir: Option<&Path>, base: &str, paths: &[&Path]) -> bool { +fn has_changed_since(git_dir: Option<&Path>, base: &str, paths: &[&str]) -> bool { let mut git = Command::new("git"); if let Some(git_dir) = git_dir { diff --git a/src/build_helper/src/git/tests.rs b/src/build_helper/src/git/tests.rs index ad69518998f73..570c8bc05ee33 100644 --- a/src/build_helper/src/git/tests.rs +++ b/src/build_helper/src/git/tests.rs @@ -1,9 +1,10 @@ -use crate::ci::CiEnv; -use crate::git::{GitConfig, PathFreshness, check_path_modifications}; use std::ffi::OsStr; use std::fs::OpenOptions; use std::process::Command; +use crate::ci::CiEnv; +use crate::git::{GitConfig, PathFreshness, check_path_modifications}; + #[test] fn test_pr_ci_unchanged_anywhere() { git_test(|ctx| { From a24ea17d8d1eb8f875821f845ef45d283f13edf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 16 Mar 2025 19:53:50 +0100 Subject: [PATCH 60/64] Add tests for negative matches --- src/build_helper/src/git.rs | 2 ++ src/build_helper/src/git/tests.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index e2168188a03b9..efe91687f4bb3 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -190,6 +190,8 @@ pub enum PathFreshness { /// /// `target_paths` should be a non-empty slice of paths (relative to `git_dir` or the /// current working directory) whose modifications would invalidate the artifact. +/// Each path can also be a negative match, i.e. `:!foo`. This matches changes outside +/// the `foo` directory. /// /// The function behaves differently in CI and outside CI. /// diff --git a/src/build_helper/src/git/tests.rs b/src/build_helper/src/git/tests.rs index 570c8bc05ee33..cc502f08387fb 100644 --- a/src/build_helper/src/git/tests.rs +++ b/src/build_helper/src/git/tests.rs @@ -123,6 +123,30 @@ fn test_changes_in_previous_upstream() { }); } +#[test] +fn test_changes_negative_path() { + git_test(|ctx| { + let upstream = ctx.create_upstream_merge(&["a"]); + ctx.create_branch("feature"); + ctx.modify("b"); + ctx.modify("d"); + ctx.commit(); + + assert_eq!( + ctx.get_source(&[":!b", ":!d"], CiEnv::None), + PathFreshness::LastModifiedUpstream { upstream: upstream.clone() } + ); + assert_eq!( + ctx.get_source(&[":!c"], CiEnv::None), + PathFreshness::HasLocalModifications { upstream: upstream.clone() } + ); + assert_eq!( + ctx.get_source(&[":!d", ":!x"], CiEnv::None), + PathFreshness::HasLocalModifications { upstream } + ); + }); +} + struct GitCtx { dir: tempfile::TempDir, git_repo: String, @@ -203,9 +227,10 @@ impl GitCtx { writeln!(file, "line").unwrap(); } - fn commit(&self) { + fn commit(&self) -> String { self.run_git(&["add", "."]); self.run_git(&["commit", "-m", "commit message"]); + self.get_current_commit() } fn switch_to_branch(&self, name: &str) { From 517fa8764189c04abd9ede33102c94a39acf261a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 17 Mar 2025 13:37:19 +0100 Subject: [PATCH 61/64] Port download-ci-rustc --- src/bootstrap/src/core/build_steps/compile.rs | 8 +- src/bootstrap/src/core/build_steps/format.rs | 2 +- src/bootstrap/src/core/build_steps/llvm.rs | 6 +- src/bootstrap/src/core/build_steps/tool.rs | 3 +- src/bootstrap/src/core/builder/tests.rs | 10 +- src/bootstrap/src/core/config/config.rs | 93 ++++--------------- src/bootstrap/src/core/config/tests.rs | 4 +- src/build_helper/src/git.rs | 6 +- 8 files changed, 43 insertions(+), 89 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 44469da1e648f..439f8554b214d 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -31,7 +31,7 @@ use crate::utils::exec::command; use crate::utils::helpers::{ exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date, }; -use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode}; +use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode, trace}; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Std { @@ -108,7 +108,11 @@ impl Step for Std { // the `rust.download-rustc=true` option. let force_recompile = builder.rust_info().is_managed_git_subrepository() && builder.download_rustc() - && builder.config.last_modified_commit(&["library"], "download-rustc", true).is_none(); + && builder.config.has_changes_from_upstream(&["library"]); + + trace!("is managed git repo: {}", builder.rust_info().is_managed_git_subrepository()); + trace!("download_rustc: {}", builder.download_rustc()); + trace!(force_recompile); run.builder.ensure(Std { compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()), diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index c7eafadee2df3..3955f8becf171 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -94,7 +94,7 @@ fn get_modified_rs_files(build: &Builder<'_>) -> Result>, Str return Ok(None); } - get_git_modified_files(&build.config.git_config(), Some(&build.config.src), &["rs"]) + get_git_modified_files(&build.config.git_config(), Some(&build.config.src), &["rs"]).map(Some) } #[derive(serde_derive::Deserialize)] diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index bc560a71e180e..a7fefc66a5aca 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -520,7 +520,7 @@ impl Step for Llvm { } // https://llvm.org/docs/HowToCrossCompileLLVM.html - if !builder.is_builder_target(target) { + if !builder.is_builder_target(&target) { let LlvmResult { llvm_config, .. } = builder.ensure(Llvm { target: builder.config.build }); if !builder.config.dry_run() { @@ -672,7 +672,7 @@ fn configure_cmake( } cfg.target(&target.triple).host(&builder.config.build.triple); - if !builder.is_builder_target(target) { + if !builder.is_builder_target(&target) { cfg.define("CMAKE_CROSSCOMPILING", "True"); if target.contains("netbsd") { @@ -1097,7 +1097,7 @@ impl Step for Lld { .define("LLVM_CMAKE_DIR", llvm_cmake_dir) .define("LLVM_INCLUDE_TESTS", "OFF"); - if !builder.is_builder_target(target) { + if !builder.is_builder_target(&target) { // Use the host llvm-tblgen binary. cfg.define( "LLVM_TABLEGEN_EXE", diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 1291a634a6f6f..a5a3d33ed94e3 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -604,8 +604,7 @@ impl Step for Rustdoc { let files_to_track = &["src/librustdoc", "src/tools/rustdoc"]; // Check if unchanged - if builder.config.last_modified_commit(files_to_track, "download-rustc", true).is_some() - { + if !builder.config.has_changes_from_upstream(files_to_track) { let precompiled_rustdoc = builder .config .ci_rustc_dir() diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 5e3e0ef654fdf..036a30624e733 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -261,8 +261,14 @@ fn ci_rustc_if_unchanged_logic() { // Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes // in compiler and/or library. if config.download_rustc_commit.is_some() { - let has_changes = - config.last_modified_commit(&["compiler", "library"], "download-rustc", true).is_none(); + let mut paths = vec!["compiler"]; + + // Handle library tree the same way as in `Config::download_ci_rustc_commit`. + if build_helper::ci::CiEnv::is_ci() { + paths.push("library"); + } + + let has_changes = config.has_changes_from_upstream(&paths); assert!( !has_changes, diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 4b867aaa3704b..ba20f4cdfe88b 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -15,9 +15,7 @@ use std::{cmp, env, fs}; use build_helper::ci::CiEnv; use build_helper::exit; -use build_helper::git::{ - GitConfig, PathFreshness, check_path_modifications, get_closest_merge_commit, output_result, -}; +use build_helper::git::{GitConfig, PathFreshness, check_path_modifications, output_result}; use serde::{Deserialize, Deserializer}; use serde_derive::Deserialize; #[cfg(feature = "tracing")] @@ -2981,17 +2979,22 @@ impl Config { let commit = if self.rust_info.is_managed_git_subrepository() { // Look for a version to compare to based on the current commit. // Only commits merged by bors will have CI artifacts. - match self.last_modified_commit(&allowed_paths, "download-rustc", if_unchanged) { - Some(commit) => commit, - None => { + match self.check_modifications(&allowed_paths) { + PathFreshness::LastModifiedUpstream { upstream } => upstream, + PathFreshness::HasLocalModifications { upstream } => { if if_unchanged { return None; } - println!("ERROR: could not find commit hash for downloading rustc"); - println!("HELP: maybe your repository history is too shallow?"); - println!("HELP: consider setting `rust.download-rustc=false` in config.toml"); - println!("HELP: or fetch enough history to include one upstream commit"); - crate::exit!(1); + + if CiEnv::is_ci() { + eprintln!("CI rustc commit matches with HEAD and we are in CI."); + eprintln!( + "`rustc.download-ci` functionality will be skipped as artifacts are not available." + ); + return None; + } + + upstream } } } else { @@ -3000,19 +3003,6 @@ impl Config { .expect("git-commit-info is missing in the project root") }; - if CiEnv::is_ci() && { - let head_sha = - output(helpers::git(Some(&self.src)).arg("rev-parse").arg("HEAD").as_command_mut()); - let head_sha = head_sha.trim(); - commit == head_sha - } { - eprintln!("CI rustc commit matches with HEAD and we are in CI."); - eprintln!( - "`rustc.download-ci` functionality will be skipped as artifacts are not available." - ); - return None; - } - if debug_assertions_requested { eprintln!( "WARN: `rust.debug-assertions = true` will prevent downloading CI rustc as alt CI \ @@ -3068,61 +3058,16 @@ impl Config { } /// Returns true if any of the `paths` have been modified locally. - fn has_changes_from_upstream(&self, paths: &[&str]) -> bool { - let freshness = - check_path_modifications(Some(&self.src), &self.git_config(), paths, CiEnv::current()) - .unwrap(); - match freshness { + pub fn has_changes_from_upstream(&self, paths: &[&str]) -> bool { + match self.check_modifications(paths) { PathFreshness::LastModifiedUpstream { .. } => false, PathFreshness::HasLocalModifications { .. } => true, } } - /// Returns the last commit in which any of `modified_paths` were changed, - /// or `None` if there are untracked changes in the working directory and `if_unchanged` is true. - pub fn last_modified_commit( - &self, - modified_paths: &[&str], - option_name: &str, - if_unchanged: bool, - ) -> Option { - assert!( - self.rust_info.is_managed_git_subrepository(), - "Can't run `Config::last_modified_commit` on a non-git source." - ); - - // Look for a version to compare to based on the current commit. - // Only commits merged by bors will have CI artifacts. - let commit = get_closest_merge_commit(Some(&self.src), &self.git_config(), &[]).unwrap(); - if commit.is_empty() { - println!("error: could not find commit hash for downloading components from CI"); - println!("help: maybe your repository history is too shallow?"); - println!("help: consider disabling `{option_name}`"); - println!("help: or fetch enough history to include one upstream commit"); - crate::exit!(1); - } - - // Warn if there were changes to the compiler or standard library since the ancestor commit. - let mut git = helpers::git(Some(&self.src)); - git.args(["diff-index", "--quiet", &commit, "--"]).args(modified_paths); - - let has_changes = !t!(git.as_command_mut().status()).success(); - if has_changes { - if if_unchanged { - if self.is_verbose() { - println!( - "warning: saw changes to one of {modified_paths:?} since {commit}; \ - ignoring `{option_name}`" - ); - } - return None; - } - println!( - "warning: `{option_name}` is enabled, but there are changes to one of {modified_paths:?}" - ); - } - - Some(commit.to_string()) + fn check_modifications(&self, paths: &[&str]) -> PathFreshness { + check_path_modifications(Some(&self.src), &self.git_config(), paths, CiEnv::current()) + .unwrap() } } diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index f0a185ee3a7eb..e1730f2cd3057 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -39,9 +39,7 @@ fn download_ci_llvm() { let if_unchanged_config = parse("llvm.download-ci-llvm = \"if-unchanged\""); if if_unchanged_config.llvm_from_ci { - let has_changes = if_unchanged_config - .last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true) - .is_none(); + let has_changes = if_unchanged_config.has_changes_from_upstream(&["src/llvm-project"]); assert!( !has_changes, diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index efe91687f4bb3..2bb138033de6e 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::process::{Command, Stdio}; use crate::ci::CiEnv; @@ -184,10 +184,12 @@ pub enum PathFreshness { /// This function figures out if a set of paths was last modified upstream or /// if there are some local modifications made to them. -/// /// It can be used to figure out if we should download artifacts from CI or rather /// build them locally. /// +/// The function assumes that at least a single upstream bors merge commit is in the +/// local git history. +/// /// `target_paths` should be a non-empty slice of paths (relative to `git_dir` or the /// current working directory) whose modifications would invalidate the artifact. /// Each path can also be a negative match, i.e. `:!foo`. This matches changes outside From 44babc5d4cd18a1dc3c34bae244181293cf94d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 18 Mar 2025 10:04:51 +0100 Subject: [PATCH 62/64] Remove upstream remote --- .github/workflows/ci.yml | 3 --- src/ci/scripts/setup-upstream-remote.sh | 24 ------------------------ 2 files changed, 27 deletions(-) delete mode 100755 src/ci/scripts/setup-upstream-remote.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c11984742107..0bf9b4ba941b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,9 +111,6 @@ jobs: # which then uses log commands to actually set them. EXTRA_VARIABLES: ${{ toJson(matrix.env) }} - - name: setup upstream remote - run: src/ci/scripts/setup-upstream-remote.sh - - name: ensure the channel matches the target branch run: src/ci/scripts/verify-channel.sh diff --git a/src/ci/scripts/setup-upstream-remote.sh b/src/ci/scripts/setup-upstream-remote.sh deleted file mode 100755 index 52b4c98a89016..0000000000000 --- a/src/ci/scripts/setup-upstream-remote.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# In CI environments, bootstrap is forced to use the remote upstream based -# on "git_repository" and "nightly_branch" values from src/stage0 file. -# This script configures the remote as it may not exist by default. - -set -euo pipefail -IFS=$'\n\t' - -ci_dir=$(cd $(dirname $0) && pwd)/.. -source "$ci_dir/shared.sh" - -git_repository=$(parse_stage0_file_by_key "git_repository") -nightly_branch=$(parse_stage0_file_by_key "nightly_branch") - -# Configure "rust-lang/rust" upstream remote only when it's not origin. -if [ -z "$(git config remote.origin.url | grep $git_repository)" ]; then - echo "Configuring https://github.com/$git_repository remote as upstream." - git remote add upstream "https://github.com/$git_repository" - REMOTE_NAME="upstream" -else - REMOTE_NAME="origin" -fi - -git fetch $REMOTE_NAME $nightly_branch From 506d23d42b63b9c732dcda2672410ad9f67d4028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 18 Mar 2025 10:01:06 +0100 Subject: [PATCH 63/64] WIP --- src/bootstrap/src/core/config/config.rs | 46 +++++++++++++++++++++++-- src/bootstrap/src/lib.rs | 1 + src/build_helper/src/git.rs | 2 +- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index ba20f4cdfe88b..25df32cdd915b 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -15,7 +15,9 @@ use std::{cmp, env, fs}; use build_helper::ci::CiEnv; use build_helper::exit; -use build_helper::git::{GitConfig, PathFreshness, check_path_modifications, output_result}; +use build_helper::git::{ + GitConfig, PathFreshness, check_path_modifications, get_closest_merge_commit, output_result, +}; use serde::{Deserialize, Deserializer}; use serde_derive::Deserialize; #[cfg(feature = "tracing")] @@ -1910,6 +1912,7 @@ impl Config { debug_assertions_requested, config.llvm_assertions, ); + panic!("DOWNLOAD_CI_RUSTC: {:?}", config.download_rustc_commit); debug = debug_toml; rustc_debug_assertions = rustc_debug_assertions_toml; @@ -2974,12 +2977,22 @@ impl Config { // options. if !CiEnv::is_ci() { allowed_paths.push(":!library"); + } else { + allowed_paths.push(":!src/bootstrap"); + allowed_paths.push(":!.github"); + allowed_paths.push(":!Cargo.lock"); + allowed_paths.push(":!config.example.toml"); + allowed_paths.push(":!license-metadata.json"); + allowed_paths.push(":!triagebot.toml"); + allowed_paths.push(":!src"); } let commit = if self.rust_info.is_managed_git_subrepository() { // Look for a version to compare to based on the current commit. // Only commits merged by bors will have CI artifacts. - match self.check_modifications(&allowed_paths) { + let modifications = self.check_modifications(&allowed_paths); + eprintln!("DOWNLOAD_CI_RUSTC freshness: {modifications:?}"); + match modifications { PathFreshness::LastModifiedUpstream { upstream } => upstream, PathFreshness::HasLocalModifications { upstream } => { if if_unchanged { @@ -3020,6 +3033,35 @@ impl Config { asserts: bool, ) -> bool { let download_ci_llvm = download_ci_llvm.unwrap_or(StringOrBool::Bool(true)); + let freshness = self.check_modifications(&[ + "src/llvm-project", + "src/bootstrap/download-ci-llvm-stamp", + "src/version", + ]); + let sha = get_closest_merge_commit( + Some(&self.src), + &self.git_config(), + &[ + self.src.join("src/llvm-project"), + self.src.join("src/bootstrap/download-ci-llvm-stamp"), + // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` + self.src.join("src/version"), + ], + ) + .unwrap(); + let head = String::from_utf8( + Command::new("git") + .current_dir(&self.src) + .arg("rev-parse") + .arg("HEAD") + .output() + .unwrap() + .stdout, + ) + .unwrap() + .trim() + .to_string(); + eprintln!("LLVM FRESHNESS: {freshness:?}\nOld git SHA: {sha}\nHEAD: {head}"); let if_unchanged = || { if self.rust_info.is_from_tarball() { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 10a85f2f1a2c8..a7924116ca3a6 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(unused)] //! Implementation of bootstrap, the Rust build system. //! //! This module, and its descendants, are the implementation of the Rust build diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index 2bb138033de6e..0348c550f4db1 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use crate::ci::CiEnv; From bbe2d72094a727e1afbd9bc1f99bac79d7155e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 18 Mar 2025 11:00:26 +0100 Subject: [PATCH 64/64] Make a modification that should invalidate download-ci-rustc --- COPYRIGHT | 1 + 1 file changed, 1 insertion(+) diff --git a/COPYRIGHT b/COPYRIGHT index 4dad74f234eaa..be1e439868c97 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,3 +1,4 @@ +// Modify copyright Short version for non-lawyers: The Rust Project is dual-licensed under Apache 2.0 and MIT