From 885a97bbeac3fb7825f0f15e6a0d75b702aca4d5 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 3 Feb 2024 16:37:58 -0500 Subject: [PATCH 01/42] Bump version placeholders --- compiler/rustc_feature/src/accepted.rs | 2 +- compiler/rustc_feature/src/removed.rs | 2 +- compiler/rustc_feature/src/unstable.rs | 8 +++---- library/alloc/src/slice.rs | 2 +- library/alloc/src/vec/cow.rs | 2 +- library/core/src/array/mod.rs | 4 ++-- library/core/src/intrinsics.rs | 2 +- library/core/src/mem/mod.rs | 4 ++-- library/core/src/net/mod.rs | 2 +- library/core/src/ops/range.rs | 2 +- library/core/src/slice/iter.rs | 24 ++++++++++----------- library/core/src/slice/mod.rs | 30 +++++++++++++------------- library/std/src/f32.rs | 2 +- library/std/src/f64.rs | 2 +- library/std/src/fs.rs | 2 +- library/std/src/sync/mutex.rs | 2 +- library/std/src/sync/rwlock.rs | 2 +- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 1155366db85e3..18f6ae35054b4 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -77,7 +77,7 @@ declare_features! ( /// Allows empty structs and enum variants with braces. (accepted, braced_empty_structs, "1.8.0", Some(29720)), /// Allows `c"foo"` literals. - (accepted, c_str_literals, "CURRENT_RUSTC_VERSION", Some(105723)), + (accepted, c_str_literals, "1.77.0", Some(105723)), /// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`. (accepted, cfg_attr_multi, "1.33.0", Some(54881)), /// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests. diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index 85fcf6a999412..1f2be9a47771a 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -33,7 +33,7 @@ declare_features! ( // ------------------------------------------------------------------------- /// Allows using the `amdgpu-kernel` ABI. - (removed, abi_amdgpu_kernel, "CURRENT_RUSTC_VERSION", Some(51575), None), + (removed, abi_amdgpu_kernel, "1.77.0", Some(51575), None), (removed, advanced_slice_patterns, "1.0.0", Some(62254), Some("merged into `#![feature(slice_patterns)]`")), (removed, allocator, "1.0.0", None, None), diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 643185ba20a7c..6369c8cce6db7 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -356,7 +356,7 @@ declare_features! ( /// Allows `#[track_caller]` on async functions. (unstable, async_fn_track_caller, "1.73.0", Some(110011)), /// Allows `for await` loops. - (unstable, async_for_loop, "CURRENT_RUSTC_VERSION", Some(118898)), + (unstable, async_for_loop, "1.77.0", Some(118898)), /// Allows builtin # foo() syntax (unstable, builtin_syntax, "1.71.0", Some(110680)), /// Treat `extern "C"` function as nounwind. @@ -370,7 +370,7 @@ declare_features! ( /// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used. (unstable, cfg_sanitize, "1.41.0", Some(39699)), /// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`. - (unstable, cfg_sanitizer_cfi, "CURRENT_RUSTC_VERSION", Some(89653)), + (unstable, cfg_sanitizer_cfi, "1.77.0", Some(89653)), /// Allows `cfg(target_abi = "...")`. (unstable, cfg_target_abi, "1.55.0", Some(80970)), /// Allows `cfg(target(abi = "..."))`. @@ -516,7 +516,7 @@ declare_features! ( (unstable, marker_trait_attr, "1.30.0", Some(29864)), /// Allows exhaustive pattern matching on types that contain uninhabited types in cases that are /// unambiguously sound. - (incomplete, min_exhaustive_patterns, "CURRENT_RUSTC_VERSION", Some(119612)), + (incomplete, min_exhaustive_patterns, "1.77.0", Some(119612)), /// A minimal, sound subset of specialization intended to be used by the /// standard library until the soundness issues with specialization /// are fixed. @@ -552,7 +552,7 @@ declare_features! ( /// Allows using enums in offset_of! (unstable, offset_of_enum, "1.75.0", Some(120141)), /// Allows using multiple nested field accesses in offset_of! - (unstable, offset_of_nested, "CURRENT_RUSTC_VERSION", Some(120140)), + (unstable, offset_of_nested, "1.77.0", Some(120140)), /// Allows using `#[optimize(X)]`. (unstable, optimize_attribute, "1.34.0", Some(54882)), /// Allows macro attributes on expressions, statements and non-inline modules. diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 4033f4eb068c6..f4e392760c8e4 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -51,7 +51,7 @@ pub use core::slice::{from_mut, from_ref}; pub use core::slice::{from_mut_ptr_range, from_ptr_range}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{from_raw_parts, from_raw_parts_mut}; -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] pub use core::slice::{ChunkBy, ChunkByMut}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{Chunks, Windows}; diff --git a/library/alloc/src/vec/cow.rs b/library/alloc/src/vec/cow.rs index b12910f3690b5..3fe83242a30ad 100644 --- a/library/alloc/src/vec/cow.rs +++ b/library/alloc/src/vec/cow.rs @@ -15,7 +15,7 @@ impl<'a, T: Clone> From<&'a [T]> for Cow<'a, [T]> { } } -#[stable(feature = "cow_from_array_ref", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "cow_from_array_ref", since = "1.77.0")] impl<'a, T: Clone, const N: usize> From<&'a [T; N]> for Cow<'a, [T]> { /// Creates a [`Borrowed`] variant of [`Cow`] /// from a reference to an array. diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 85cce81f2c122..743f07644e354 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -576,7 +576,7 @@ impl [T; N] { /// // We can still access the original array: it has not been moved. /// assert_eq!(strings.len(), 3); /// ``` - #[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "array_methods", since = "1.77.0")] pub fn each_ref(&self) -> [&T; N] { from_trusted_iterator(self.iter()) } @@ -595,7 +595,7 @@ impl [T; N] { /// assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]); /// assert_eq!(floats, [0.0, 2.7, -1.0]); /// ``` - #[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "array_methods", since = "1.77.0")] pub fn each_mut(&mut self) -> [&mut T; N] { from_trusted_iterator(self.iter_mut()) } diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 43124535ab5d8..cb4fdca8cbf6b 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -947,7 +947,7 @@ extern "rust-intrinsic" { /// own, or if it does not enable any significant optimizations. /// /// This intrinsic does not have a stable counterpart. - #[rustc_const_stable(feature = "const_assume", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_assume", since = "1.77.0")] #[rustc_nounwind] pub fn assume(b: bool); diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 318a99e23ec64..ab5b89764e9a9 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1394,7 +1394,7 @@ impl SizedTypeProperties for T {} /// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0); /// ``` #[cfg(not(bootstrap))] -#[stable(feature = "offset_of", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "offset_of", since = "1.77.0")] #[allow_internal_unstable(builtin_syntax, hint_must_use)] pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { // The `{}` is for better error messages @@ -1402,7 +1402,7 @@ pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { } #[cfg(bootstrap)] -#[stable(feature = "offset_of", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "offset_of", since = "1.77.0")] #[allow_internal_unstable(builtin_syntax, hint_must_use)] #[allow(missing_docs)] pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) { diff --git a/library/core/src/net/mod.rs b/library/core/src/net/mod.rs index 5bae4d2f0c4ca..0786165fe9e76 100644 --- a/library/core/src/net/mod.rs +++ b/library/core/src/net/mod.rs @@ -9,7 +9,7 @@ //! * [`SocketAddr`] represents socket addresses of either IPv4 or IPv6; [`SocketAddrV4`] //! and [`SocketAddrV6`] are respectively IPv4 and IPv6 socket addresses -#![stable(feature = "ip_in_core", since = "CURRENT_RUSTC_VERSION")] +#![stable(feature = "ip_in_core", since = "1.77.0")] #[stable(feature = "rust1", since = "1.0.0")] pub use self::ip_addr::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope}; diff --git a/library/core/src/ops/range.rs b/library/core/src/ops/range.rs index e809273c9ed93..727a22e454d3d 100644 --- a/library/core/src/ops/range.rs +++ b/library/core/src/ops/range.rs @@ -726,7 +726,7 @@ impl Bound { /// assert_eq!(unbounded_string.map(|s| s.len()), Unbounded); /// ``` #[inline] - #[stable(feature = "bound_map", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "bound_map", since = "1.77.0")] pub fn map U>(self, f: F) -> Bound { match self { Unbounded => Unbounded, diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index 2d4c7e78aea17..1fb1df35e27a0 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -3252,21 +3252,21 @@ unsafe impl<'a, T> TrustedRandomAccessNoCoerce for IterMut<'a, T> { /// /// [`chunk_by`]: slice::chunk_by /// [slices]: slice -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] #[must_use = "iterators are lazy and do nothing unless consumed"] pub struct ChunkBy<'a, T: 'a, P> { slice: &'a [T], predicate: P, } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> ChunkBy<'a, T, P> { pub(super) fn new(slice: &'a [T], predicate: P) -> Self { ChunkBy { slice, predicate } } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> Iterator for ChunkBy<'a, T, P> where P: FnMut(&T, &T) -> bool, @@ -3300,7 +3300,7 @@ where } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> DoubleEndedIterator for ChunkBy<'a, T, P> where P: FnMut(&T, &T) -> bool, @@ -3322,10 +3322,10 @@ where } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> FusedIterator for ChunkBy<'a, T, P> where P: FnMut(&T, &T) -> bool {} -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for ChunkBy<'a, T, P> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("ChunkBy").field("slice", &self.slice).finish() @@ -3339,21 +3339,21 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for ChunkBy<'a, T, P> { /// /// [`chunk_by_mut`]: slice::chunk_by_mut /// [slices]: slice -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] #[must_use = "iterators are lazy and do nothing unless consumed"] pub struct ChunkByMut<'a, T: 'a, P> { slice: &'a mut [T], predicate: P, } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> ChunkByMut<'a, T, P> { pub(super) fn new(slice: &'a mut [T], predicate: P) -> Self { ChunkByMut { slice, predicate } } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> Iterator for ChunkByMut<'a, T, P> where P: FnMut(&T, &T) -> bool, @@ -3388,7 +3388,7 @@ where } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> DoubleEndedIterator for ChunkByMut<'a, T, P> where P: FnMut(&T, &T) -> bool, @@ -3411,10 +3411,10 @@ where } } -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a, P> FusedIterator for ChunkByMut<'a, T, P> where P: FnMut(&T, &T) -> bool {} -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for ChunkByMut<'a, T, P> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("ChunkByMut").field("slice", &self.slice).finish() diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 2d93ef6fbeb34..f1d8cbc94c98f 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -68,7 +68,7 @@ pub use iter::{ArrayChunks, ArrayChunksMut}; #[unstable(feature = "array_windows", issue = "75027")] pub use iter::ArrayWindows; -#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "slice_group_by", since = "1.77.0")] pub use iter::{ChunkBy, ChunkByMut}; #[stable(feature = "split_inclusive", since = "1.51.0")] @@ -334,8 +334,8 @@ impl [T] { /// assert_eq!(Some(&[]), w.first_chunk::<0>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] + #[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")] pub const fn first_chunk(&self) -> Option<&[T; N]> { if self.len() < N { None @@ -364,7 +364,7 @@ impl [T] { /// assert_eq!(None, x.first_chunk_mut::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")] pub const fn first_chunk_mut(&mut self) -> Option<&mut [T; N]> { if self.len() < N { @@ -394,8 +394,8 @@ impl [T] { /// assert_eq!(None, x.split_first_chunk::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] + #[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")] pub const fn split_first_chunk(&self) -> Option<(&[T; N], &[T])> { if self.len() < N { None @@ -429,7 +429,7 @@ impl [T] { /// assert_eq!(None, x.split_first_chunk_mut::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")] pub const fn split_first_chunk_mut( &mut self, @@ -464,8 +464,8 @@ impl [T] { /// assert_eq!(None, x.split_last_chunk::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] + #[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")] pub const fn split_last_chunk(&self) -> Option<(&[T], &[T; N])> { if self.len() < N { None @@ -499,7 +499,7 @@ impl [T] { /// assert_eq!(None, x.split_last_chunk_mut::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")] pub const fn split_last_chunk_mut( &mut self, @@ -534,7 +534,7 @@ impl [T] { /// assert_eq!(Some(&[]), w.last_chunk::<0>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")] pub const fn last_chunk(&self) -> Option<&[T; N]> { if self.len() < N { @@ -568,7 +568,7 @@ impl [T] { /// assert_eq!(None, x.last_chunk_mut::<4>()); /// ``` #[inline] - #[stable(feature = "slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")] pub const fn last_chunk_mut(&mut self) -> Option<&mut [T; N]> { if self.len() < N { @@ -1777,7 +1777,7 @@ impl [T] { /// assert_eq!(iter.next(), Some(&[2, 3, 4][..])); /// assert_eq!(iter.next(), None); /// ``` - #[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_group_by", since = "1.77.0")] #[inline] pub fn chunk_by(&self, pred: F) -> ChunkBy<'_, T, F> where @@ -1818,7 +1818,7 @@ impl [T] { /// assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); /// assert_eq!(iter.next(), None); /// ``` - #[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_group_by", since = "1.77.0")] #[inline] pub fn chunk_by_mut(&mut self, pred: F) -> ChunkByMut<'_, T, F> where @@ -1953,7 +1953,7 @@ impl [T] { #[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")] #[rustc_const_stable( feature = "const_slice_split_at_unchecked", - since = "CURRENT_RUSTC_VERSION" + since = "1.77.0" )] #[inline] #[must_use] diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index 1b38ba721147c..b60d7a724112d 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -114,7 +114,7 @@ impl f32 { /// ``` #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] - #[stable(feature = "round_ties_even", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "round_ties_even", since = "1.77.0")] #[inline] pub fn round_ties_even(self) -> f32 { unsafe { intrinsics::rintf32(self) } diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index f8fc84440ae5c..88f992b3957af 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -114,7 +114,7 @@ impl f64 { /// ``` #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] - #[stable(feature = "round_ties_even", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "round_ties_even", since = "1.77.0")] #[inline] pub fn round_ties_even(self) -> f64 { unsafe { intrinsics::rintf64(self) } diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 80d369eb067d4..3383a8cfa41ef 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -428,7 +428,7 @@ impl File { /// Ok(()) /// } /// ``` - #[stable(feature = "file_create_new", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "file_create_new", since = "1.77.0")] pub fn create_new>(path: P) -> io::Result { OpenOptions::new().read(true).write(true).create_new(true).open(path.as_ref()) } diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs index 184c406e326cf..920143b7ac7b2 100644 --- a/library/std/src/sync/mutex.rs +++ b/library/std/src/sync/mutex.rs @@ -404,7 +404,7 @@ impl Mutex { /// assert_eq!(*x, 1); /// ``` #[inline] - #[stable(feature = "mutex_unpoison", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "mutex_unpoison", since = "1.77.0")] pub fn clear_poison(&self) { self.poison.clear(); } diff --git a/library/std/src/sync/rwlock.rs b/library/std/src/sync/rwlock.rs index 23d3dd0707a34..c5d846b85aa1e 100644 --- a/library/std/src/sync/rwlock.rs +++ b/library/std/src/sync/rwlock.rs @@ -408,7 +408,7 @@ impl RwLock { /// assert_eq!(*guard, 1); /// ``` #[inline] - #[stable(feature = "mutex_unpoison", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "mutex_unpoison", since = "1.77.0")] pub fn clear_poison(&self) { self.poison.clear(); } From e36caeddb6962b188e8fa863455476b22a2854a7 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 3 Feb 2024 16:38:20 -0500 Subject: [PATCH 02/42] 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 42c931fb11626ee93c800dd6842952e00e1359dd Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 4 Feb 2024 22:28:01 -0500 Subject: [PATCH 03/42] [beta-1.77.0] backport cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index 7bb7b539558dc..c8a48facdaabe 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 7bb7b539558dc88bea44cee4168b6269bf8177b0 +Subproject commit c8a48facdaabe1d1fa8de11f90737801f38d8fa1 From 0e89228bd7c3a8bde4ddd3b3f480f55286c4382d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 8 Feb 2024 18:48:51 -0800 Subject: [PATCH 04/42] [Beta 1.77] Fix bootstrapping from 1.76 --- compiler/rustc_codegen_llvm/src/lib.rs | 1 + compiler/rustc_lint/src/lib.rs | 2 +- compiler/rustc_llvm/src/lib.rs | 1 + compiler/rustc_middle/src/lib.rs | 2 +- library/core/tests/lib.rs | 2 +- library/std/src/lib.rs | 1 + src/tools/miri/src/lib.rs | 2 +- 7 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index f4f29078190a1..5e053f4a49781 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -8,6 +8,7 @@ #![feature(rustdoc_internals)] #![doc(rust_logo)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![cfg_attr(bootstrap, feature(c_str_literals))] #![feature(exact_size_is_empty)] #![feature(extern_types)] #![feature(hash_raw_entry)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 1d9ce10bcaf38..60b43b1625642 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -34,9 +34,9 @@ #![feature(if_let_guard)] #![feature(iter_order_by)] #![feature(let_chains)] -#![cfg_attr(not(bootstrap), feature(trait_upcasting))] #![feature(min_specialization)] #![feature(rustc_attrs)] +#![feature(trait_upcasting)] #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] #![allow(internal_features)] diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index ca0aec71052d0..aa8ed3dc3a9e5 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -1,6 +1,7 @@ #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![cfg_attr(bootstrap, feature(c_str_literals))] #![doc(rust_logo)] #![feature(rustdoc_internals)] #![allow(internal_features)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index ddfb2ece39f10..0c31f2b821a7d 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -48,7 +48,7 @@ #![feature(associated_type_bounds)] #![feature(rustc_attrs)] #![feature(control_flow_enum)] -#![cfg_attr(not(bootstrap), feature(trait_upcasting))] +#![feature(trait_upcasting)] #![feature(try_blocks)] #![feature(decl_macro)] #![feature(extract_if)] diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 9a3b477c2d159..84e94b291d8ec 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -111,7 +111,7 @@ #![feature(slice_flatten)] #![feature(error_generic_member_access)] #![feature(error_in_core)] -#![cfg_attr(not(bootstrap), feature(trait_upcasting))] +#![feature(trait_upcasting)] #![feature(utf8_chunks)] #![feature(is_ascii_octdigit)] #![feature(get_many_mut)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index ccc7a1592312d..4d44f5b60fb74 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -309,6 +309,7 @@ // // Library features (core): // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(c_str_literals))] #![feature(char_internals)] #![feature(core_intrinsics)] #![feature(core_io_borrowed_buf)] diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 057b883a3bf9e..a8e1ed2096e8e 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -10,7 +10,7 @@ #![feature(nonzero_ops)] #![feature(let_chains)] #![feature(lint_reasons)] -#![cfg_attr(not(bootstrap), feature(trait_upcasting))] +#![feature(trait_upcasting)] // Configure clippy and other lints #![allow( clippy::collapsible_else_if, From ec15d9dbb8c8ddfab13878117b11b4fb23723d81 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 8 Feb 2024 19:27:02 -0800 Subject: [PATCH 05/42] Bump to released 1.76 stable --- src/stage0.json | 733 +++++++++++++++++++++--------------------------- 1 file changed, 317 insertions(+), 416 deletions(-) diff --git a/src/stage0.json b/src/stage0.json index 1297eb1f8ecb1..7d44aeb67a49a 100644 --- a/src/stage0.json +++ b/src/stage0.json @@ -18,423 +18,324 @@ "tool is executed." ], "compiler": { - "date": "2023-12-22", - "version": "beta" - }, - "rustfmt": { - "date": "2023-12-22", - "version": "nightly" + "date": "2024-02-08", + "version": "1.76.0" }, + "rustfmt": null, "checksums_sha256": { - "dist/2023-12-22/cargo-beta-aarch64-apple-darwin.tar.gz": "80a4c4d72f7f436105084047a5806c5665749ecb84ff06bb25e759b56049e610", - "dist/2023-12-22/cargo-beta-aarch64-apple-darwin.tar.xz": "0290ccea9da40123cb5ce9d8c22721e015de77525e267003faaca4a161179da0", - "dist/2023-12-22/cargo-beta-aarch64-pc-windows-msvc.tar.gz": "85c79d51b2d8480343546a6164fea3f1992a4b8de3c6a45a4952b0eb2ee467ab", - "dist/2023-12-22/cargo-beta-aarch64-pc-windows-msvc.tar.xz": "f9174eac9ee6dcd60c24ce5ac5341f16ebb5d704f79bef585e963576a7c7c624", - "dist/2023-12-22/cargo-beta-aarch64-unknown-linux-gnu.tar.gz": "76fdafa72f31538fe1747da8ff63a16af91affddc0564a8a3bc1d96bed242466", - "dist/2023-12-22/cargo-beta-aarch64-unknown-linux-gnu.tar.xz": "22ae3c0460073037beee67f0bd9d86af0b72c90d9ee6bf14bb6f09e9cbdf2471", - "dist/2023-12-22/cargo-beta-aarch64-unknown-linux-musl.tar.gz": "8731388fe7335a9c31b33ed3bbd5a4e29402e0bfd0ee4b0842974a9416859c8b", - "dist/2023-12-22/cargo-beta-aarch64-unknown-linux-musl.tar.xz": "38f8907aab9795465b8be1d0e38ad3b812ea6ea6e3672773b43e4312677916ea", - "dist/2023-12-22/cargo-beta-arm-unknown-linux-gnueabi.tar.gz": "19e329bd134d01c73dd74a10ee63e35782692cb54ee9dd81556b3920fc055b3b", - "dist/2023-12-22/cargo-beta-arm-unknown-linux-gnueabi.tar.xz": "b3f4fab444cb5bd462a36f8fb3d90a20042389a5f809bf431dc51645430b6dfa", - "dist/2023-12-22/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz": "cdc61bec25e556c6d0ef1150c1a01225eae4e325bce94bd49d43ff1d2b2f4049", - "dist/2023-12-22/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz": "082ed52b5bc4e8b4ac16e9a7af81ad774827e41af63532599ee41724b6907378", - "dist/2023-12-22/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz": "7624915c4adfb8af8d294f581a3ca4796d53a76f7ccb6546c858e0f785adb252", - "dist/2023-12-22/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz": "c224a28f4ffec2b820ac26e21e4bf1e6ecc67f47598e91d34a4e922c21cd967a", - "dist/2023-12-22/cargo-beta-i686-pc-windows-gnu.tar.gz": "d936b84681f2b5fd7da75c99eab6c40ae5464b1ac97733cf5774ae7783fad941", - "dist/2023-12-22/cargo-beta-i686-pc-windows-gnu.tar.xz": "fa2864c6cbbe940a81a497fcb307afbd7c6c0551346676daf2fa0b488dc72489", - "dist/2023-12-22/cargo-beta-i686-pc-windows-msvc.tar.gz": "1b6ed32c7f3b3c0b2f09e43ab04ecf62aa11c778911b860ee0a82cd22fa8ef0c", - "dist/2023-12-22/cargo-beta-i686-pc-windows-msvc.tar.xz": "35cf7cf47a49af4b68171264943adcee5c907d8d4fbb021a0716e10ba946655c", - "dist/2023-12-22/cargo-beta-i686-unknown-linux-gnu.tar.gz": "cc993cf80d125d5ac25210dee1706bd23aa94f949fb94aa22409f434bafe3c35", - "dist/2023-12-22/cargo-beta-i686-unknown-linux-gnu.tar.xz": "60e2bcf98f9969bae7f61987bc30e2358c832033ea98be6f8e08e8b95e8b2409", - "dist/2023-12-22/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz": "08dbad235465958534802c1609f881561767a63a3373033678caa29b7384e1af", - "dist/2023-12-22/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz": "cbb79d6e06e12b7bc278d6b3a220380e1d4e863c60eed3462ca4f310b25bf247", - "dist/2023-12-22/cargo-beta-powerpc-unknown-linux-gnu.tar.gz": "f25b99291e3d7ed8891ec1196a3bd747cfc755b3c0bb27cbef0fb1aabeecd950", - "dist/2023-12-22/cargo-beta-powerpc-unknown-linux-gnu.tar.xz": "0c496d22b1f641ea4bef847a1efe7b69737b0c1d7ca2920ae0a1e87ca99c00e1", - "dist/2023-12-22/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz": "9d9800913636d33b9976416fa128d6e734c98978c91fdb846a16c9f2b014a77e", - "dist/2023-12-22/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz": "668dda14116c4d54f43653efccdd2a4d211dfea1a08ae5fe02fd69d21b6d9783", - "dist/2023-12-22/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz": "ec8b813a83d0999a2181c3e026cc43c0004bcdef621ef07c9741b71ed60858a7", - "dist/2023-12-22/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz": "dda9fac6999682ad9bfbeca1cc26b4b083c99558c531e2137bca4b22331527a1", - "dist/2023-12-22/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz": "ff1153a92dbdf499e6cbcea37d6be513e1c844d303032f9f1f2c9af45dd43b26", - "dist/2023-12-22/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz": "3b8247891ac28674ff4d647da93e267e2400f948b60c870227683463466bc983", - "dist/2023-12-22/cargo-beta-s390x-unknown-linux-gnu.tar.gz": "239486637406a61f1aa25925f82131a31d133972e7926dfa54152285ed83917f", - "dist/2023-12-22/cargo-beta-s390x-unknown-linux-gnu.tar.xz": "7e9d66d61387aa45a1141187806bc181251b1164bbc48e6b52d8770d746507b6", - "dist/2023-12-22/cargo-beta-x86_64-apple-darwin.tar.gz": "3d47e067fedaa2f96cbb33b23315d52d7f5a3379cccca560db312e6cfbbcab39", - "dist/2023-12-22/cargo-beta-x86_64-apple-darwin.tar.xz": "7d7b2239cdf1e946ee97ee81ce69f2fe2f3695a82c0434a4a853218547ee58b3", - "dist/2023-12-22/cargo-beta-x86_64-pc-windows-gnu.tar.gz": "34b195423b12f4253dbcb47fe9bd55e1bdb302c86096ee9f8248e65c218c5ebc", - "dist/2023-12-22/cargo-beta-x86_64-pc-windows-gnu.tar.xz": "d7ebbe5c54ee55ee320e7a57e323d7277afe7c56ec31465fb8012cd436412ef4", - "dist/2023-12-22/cargo-beta-x86_64-pc-windows-msvc.tar.gz": "41c1b391e8f132d8bb18d79e52cf2c7e0443417854943608383073cbb977b1ce", - "dist/2023-12-22/cargo-beta-x86_64-pc-windows-msvc.tar.xz": "f75987c83543c4994dffc7dfb0bfb57390fbbdf79165360d94fd6513b3bf8abd", - "dist/2023-12-22/cargo-beta-x86_64-unknown-freebsd.tar.gz": "56d4ada9b370a6fb3b1a654aebd710194eab8e6a2f7f46df9f191a4ae2d75d9e", - "dist/2023-12-22/cargo-beta-x86_64-unknown-freebsd.tar.xz": "5337096841f04ba7337e8b35df5197fe078832fc417cbe7b4de454c45ae797bc", - "dist/2023-12-22/cargo-beta-x86_64-unknown-illumos.tar.gz": "e1ad1e2044a8b3329349a33a70400491cb79f5e7c847a626c96415f240e6720a", - "dist/2023-12-22/cargo-beta-x86_64-unknown-illumos.tar.xz": "f3546d9d207dc59c67dc8e13ccb0abc3fba14ca5feed4f75e0f3c28e31c9ad5f", - "dist/2023-12-22/cargo-beta-x86_64-unknown-linux-gnu.tar.gz": "0497f21e775ab847657c6815275d2a8cf03e4d9b4e75975eaa5eeef7fa84b62e", - "dist/2023-12-22/cargo-beta-x86_64-unknown-linux-gnu.tar.xz": "5fc2c06ff83063e7c992729f2dc5dc62771c5e0adeb04b0fb4e12f73b166d29c", - "dist/2023-12-22/cargo-beta-x86_64-unknown-linux-musl.tar.gz": "ce5cdea30636dcb14385ead3ca2d31ded9d3f243234c82b3326551c0cf03d599", - "dist/2023-12-22/cargo-beta-x86_64-unknown-linux-musl.tar.xz": "086662482440baad1b5cb738301a186de41ba6512bae1d77369d65e37c56d818", - "dist/2023-12-22/cargo-beta-x86_64-unknown-netbsd.tar.gz": "b59d49075a3a3fa2aaa8264d3a0c4444400dffe4780bb5efb350d9d558dfe5a9", - "dist/2023-12-22/cargo-beta-x86_64-unknown-netbsd.tar.xz": "bd940fc6505c603a2d0e4743af3aa1df6ef903676f31bf4f06083cf86ba0f4d4", - "dist/2023-12-22/clippy-beta-aarch64-apple-darwin.tar.gz": "42e4c7e85b516b54bc9a92fdcbaf31a280121a6264ffc00bc4330bb3f3d1ef09", - "dist/2023-12-22/clippy-beta-aarch64-apple-darwin.tar.xz": "1858bb5aa212dc68c694e044dd138f58a94ef236e29623b46c275cb9765d1433", - "dist/2023-12-22/clippy-beta-aarch64-pc-windows-msvc.tar.gz": "8ec1c0c20dd3381bb2177e3ff28c777a7de6aff5fa557cf3b4e7ebc6aee7de84", - "dist/2023-12-22/clippy-beta-aarch64-pc-windows-msvc.tar.xz": "cfa8fd15c5b0ff1570a99ea15004f88a8ddd50f6d367082cf6464523355666c1", - "dist/2023-12-22/clippy-beta-aarch64-unknown-linux-gnu.tar.gz": "eb81038f1cc56601719a6165da2ba71f357f00ea3380e46f0a1283174efaa9d2", - "dist/2023-12-22/clippy-beta-aarch64-unknown-linux-gnu.tar.xz": "dc4c69b81fd186e40b6df3900d0c555214b999f3c1ca5a2697d93503357c7194", - "dist/2023-12-22/clippy-beta-aarch64-unknown-linux-musl.tar.gz": "e2fde1d65c46011d3ce80e1e46e13dcf7b5673009398296cd4126b1e4a9b2cb0", - "dist/2023-12-22/clippy-beta-aarch64-unknown-linux-musl.tar.xz": "b6a422245e574c149b984655f023ca3721c1b5d5a08245292872d86e4b77980d", - "dist/2023-12-22/clippy-beta-arm-unknown-linux-gnueabi.tar.gz": "4b3ece564b22857b0741080ce20f190dedbd72fa8c7a284921e4c3c481fdd264", - "dist/2023-12-22/clippy-beta-arm-unknown-linux-gnueabi.tar.xz": "bab8dbbf290576dd9f77c9685f5f1bab114215c85c83512d87839a08a3adce6e", - "dist/2023-12-22/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz": "732adcc6849929efa239a8f5c638fd68324d8f05330b518b8b0804351ae6889a", - "dist/2023-12-22/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz": "5d726d8da3909f1ca58e1b5b50067205b90bf1a7689c516abce66a14b68fd524", - "dist/2023-12-22/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz": "c939f4d6675dfbe0ed0d0353fd9a26b0f96f53c0118257d306eb46c883438b8d", - "dist/2023-12-22/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz": "fa1a7abcdaa6f0347811849dd4dbdcd438d0e47824541b22b1c64fba8c6c1482", - "dist/2023-12-22/clippy-beta-i686-pc-windows-gnu.tar.gz": "c1b16be465960d03658eb10c6d65ba363ecb75d17eee49e2da0d055a97d1ebfc", - "dist/2023-12-22/clippy-beta-i686-pc-windows-gnu.tar.xz": "e5997892281f08da9445b53c564edd678b7b768624bd29ef55a0bfa6a2022cc6", - "dist/2023-12-22/clippy-beta-i686-pc-windows-msvc.tar.gz": "92400c8693ba05a186c6913f69e838cd6668eec60864e5ff857e1da2cd8469dd", - "dist/2023-12-22/clippy-beta-i686-pc-windows-msvc.tar.xz": "550430a61f5e17fc30207b843f99a0f56d6fa07c6c458ab560149027b69599cf", - "dist/2023-12-22/clippy-beta-i686-unknown-linux-gnu.tar.gz": "a99bd3961497a6266e3fc9d4109a0c1304a6759f6d7062a5175afb5459658346", - "dist/2023-12-22/clippy-beta-i686-unknown-linux-gnu.tar.xz": "b8471bfaaf94b61523ac88db9c91c20f67bf24a16367795b2c925abff783fab7", - "dist/2023-12-22/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz": "601760057229682f332e4b005441111eb1573c7c9a9e286f0699019df3b2d4fa", - "dist/2023-12-22/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz": "45b7f4d75ed4838d3de0ed8c70d2ce6a248881c609bc4b883a549f11d12067fa", - "dist/2023-12-22/clippy-beta-powerpc-unknown-linux-gnu.tar.gz": "6c4fd05f37c0e95046dc87c24734820920a3ec62f3507643f42691ba349f2418", - "dist/2023-12-22/clippy-beta-powerpc-unknown-linux-gnu.tar.xz": "0aab738f846ad507138c0a5d40823a0db7d89ff130f24e550f337e085dc3ea8e", - "dist/2023-12-22/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz": "007d761b7eb5d5ed5911090ac55af2288e9a97cc4affc5ca488ebde7cc3ab0e6", - "dist/2023-12-22/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz": "ba9ecc14573a882641685cd6570e515a31fa9f3a9973dcef58f3db809b932fa0", - "dist/2023-12-22/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz": "efcf9a7bc03f8e984c6ab3fa2bc269fa5387168992c9fd2b8ab09bbd7111c6c9", - "dist/2023-12-22/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz": "1df14e1f3cf785c9cf5477b584fdf11f1f7e12431a5092cc5cdf6c2878bf4275", - "dist/2023-12-22/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz": "8527bf2c96fba74c09d7b1051616631d0b4e6bace8fe44c8c76f295c9a4eb55e", - "dist/2023-12-22/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz": "cc58fbe8d4d7d0011045f64025bf75e2042b7967b7fb1f297cfe8a0175197258", - "dist/2023-12-22/clippy-beta-s390x-unknown-linux-gnu.tar.gz": "c1e41ba2a77f6c0d33751b12522310bed37a032fc01947b9d78e8492a2c74ca2", - "dist/2023-12-22/clippy-beta-s390x-unknown-linux-gnu.tar.xz": "a90903f78305533e5315b3dcb26218a91e1733cda5e2fadcada80fe06b3e1a17", - "dist/2023-12-22/clippy-beta-x86_64-apple-darwin.tar.gz": "73839c078dbc472a8c5d87686eb7e09db0030d567079359f9a750a52d1d300b8", - "dist/2023-12-22/clippy-beta-x86_64-apple-darwin.tar.xz": "fbc52b8be57b032d04e885b325deb3c2d61bce1773fdd68e7b0889a1ba9a167e", - "dist/2023-12-22/clippy-beta-x86_64-pc-windows-gnu.tar.gz": "5a618cf8c09bec0e593449648bced16153b6783f98e41d685e5912418710fff6", - "dist/2023-12-22/clippy-beta-x86_64-pc-windows-gnu.tar.xz": "f6a7c30cb183c8cecf22d95487250c121d5fe1cacf2bc4e64bc160b4c4cdd566", - "dist/2023-12-22/clippy-beta-x86_64-pc-windows-msvc.tar.gz": "58b5ae0e2f46d4f7e64491a4ffcc9180e8616cc82b095526546942b0c6e43583", - "dist/2023-12-22/clippy-beta-x86_64-pc-windows-msvc.tar.xz": "aa146f4c9357bd167e4aed6919a1dc780fb57ddb9e83a4332442cb779cc61e1c", - "dist/2023-12-22/clippy-beta-x86_64-unknown-freebsd.tar.gz": "56b1d7fbdc1e47e8a31243cbbac747b1980b61d45f2daf260d49362f1413f3e2", - "dist/2023-12-22/clippy-beta-x86_64-unknown-freebsd.tar.xz": "c0e5ca26067fbd0279a36c03f68e07757817aa2207a69250224f6cb44cb9711c", - "dist/2023-12-22/clippy-beta-x86_64-unknown-illumos.tar.gz": "404cb75b4ae6f2f0f456f77b4e639ddd692c3f47d6f32b168b275dcc999db4c3", - "dist/2023-12-22/clippy-beta-x86_64-unknown-illumos.tar.xz": "b6c156a01ce3f64fd781669c351df169c0c0485b0282ec33d1c541e7990e1ef7", - "dist/2023-12-22/clippy-beta-x86_64-unknown-linux-gnu.tar.gz": "6a2e75e81a2678cb97a47e695b74dbbf0737cf615bb94d1679318bcbe77a0fff", - "dist/2023-12-22/clippy-beta-x86_64-unknown-linux-gnu.tar.xz": "6273b5b834766a93c2f65a3cf2283bf1669c1dd9b9f1cbbab497ea250532ef43", - "dist/2023-12-22/clippy-beta-x86_64-unknown-linux-musl.tar.gz": "bf4ec57ca170ccb4ab3fc4d42907418011e5dce9ff3fbbfc341e70744e9f0c8e", - "dist/2023-12-22/clippy-beta-x86_64-unknown-linux-musl.tar.xz": "d875bfbdc53bcca521707e3d08fe3b2c2c2dfeab81634c285228ca91278fd659", - "dist/2023-12-22/clippy-beta-x86_64-unknown-netbsd.tar.gz": "43ae50703b81f0fdf726b4790afd539f2d5a1dc56507df2726bee693f121550b", - "dist/2023-12-22/clippy-beta-x86_64-unknown-netbsd.tar.xz": "894acb6cf32ef66d2b79f24ebdbf37dc8d51f36d9ec326a294cbf4be3128ce77", - "dist/2023-12-22/rust-std-beta-aarch64-apple-darwin.tar.gz": "81e9bbeea89702fa3843a5e6bed8b5d3d5bb035d94adb335dfa91d084842fe17", - "dist/2023-12-22/rust-std-beta-aarch64-apple-darwin.tar.xz": "1457fbc52b8e8e6c751b69b6b5b3401bbac86f5aed500885fd86128963e6f8ca", - "dist/2023-12-22/rust-std-beta-aarch64-apple-ios-sim.tar.gz": "e2574432b2b7e8b056f8d9864142be20fb83ec516bd27f7f937c04c2d9648218", - "dist/2023-12-22/rust-std-beta-aarch64-apple-ios-sim.tar.xz": "91fb8193d61c741ee39e1429c8c6e7dc51cb10d5ed1d5f63c4572dd1941f26e1", - "dist/2023-12-22/rust-std-beta-aarch64-apple-ios.tar.gz": "6a1b2b7d583e105daca8294fbd4e3f17bcf345ab536eb4e74962a2efc65c9eef", - "dist/2023-12-22/rust-std-beta-aarch64-apple-ios.tar.xz": "3c54c2a8b24186c5100898a33837141119d77cfd5363acbb8508630752198208", - "dist/2023-12-22/rust-std-beta-aarch64-linux-android.tar.gz": "c9534e00a3b99390a80f23fe580bcca0eb17b8bf5c0731158e8e719ab17bef74", - "dist/2023-12-22/rust-std-beta-aarch64-linux-android.tar.xz": "bbb5bdcd5c698d2b089cf57dc071814aa91e51e76fae5a321b0f3bee837dcbc1", - "dist/2023-12-22/rust-std-beta-aarch64-pc-windows-msvc.tar.gz": "c862de6118465dbc356c69c23d1a755243d86945522cb6a87bd25321a5cf1346", - "dist/2023-12-22/rust-std-beta-aarch64-pc-windows-msvc.tar.xz": "f8fe6f868c007b3a32b2e20fa397d2aeaa18c1af52bfbf90d181b0dede6235cb", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-fuchsia.tar.gz": "3ef167b633f128d5e8b28480169fdaa559c742db7091445b33b7225dd0ab6b17", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-fuchsia.tar.xz": "d6027f6826ee84962b4f516204c5e48c4d11a738349d20071d71eb249ab19294", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz": "2885ebe19250cc078804941bd33d71ac0ba52c8f55c03db0a9d2f7b4b86501b4", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz": "fe587aec91d8586f5ea93783541b3b1dc005cc9fa92d07a42e93c6cf3570224e", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-linux-musl.tar.gz": "b2278c605233768efdbf272b6c1c64b5770330603f0d6ad2e9fc725790c65593", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-linux-musl.tar.xz": "40cfe524fc6a97a894d8fab0bcab8a00b72781ed1f8c3273d26e784162959d1f", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz": "77d9010f59baee9e88fc883cc085f04282b731cdabaf2e3eeb4ccbb8e950c526", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz": "4b633e678448b03b868dcd038a2a2c4dc78cb600324283b38ed942ee439174cc", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-none.tar.gz": "901d032bf3dac71e52c727264daf42c923adcb12c771f135aef0aaa7784a9c63", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-none.tar.xz": "dd7856ab1d91d92c09f65c8e6fdcada0ffaf63890c656e9bf5e7fe1c5f83cf32", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-uefi.tar.gz": "c64dbbdd967193c3ed53c58e0545a93411e63c83bf0274d40691d1c5e5c58a2c", - "dist/2023-12-22/rust-std-beta-aarch64-unknown-uefi.tar.xz": "bf28490141ed88753548a96615742e7dd13efb6bf7ed98e7cc548409a79100df", - "dist/2023-12-22/rust-std-beta-arm-linux-androideabi.tar.gz": "aa84489eaaf4ae64a56f64a4f7e2240d41ae77e6532bdaf35eb2163632afd051", - "dist/2023-12-22/rust-std-beta-arm-linux-androideabi.tar.xz": "a3cf5b44498c85fbd8f66a776e5947e9b552a8b8110b19b4611ff042d040294f", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz": "aa4f3fa1994f51228853c8abd1080ac0804d7fe782a2c9a533427555c1ed5db7", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz": "72340fd4f0110ef21cea8e7a54182cf65b616e6c4834624b7971ad8a9c00b4b2", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz": "5b0b9392fcf9673e69954141470bd4eca00867a303b4f24354f27cf09da1cb8c", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz": "326ea10b82742012a648cf5eb9eb7b6e09087a324e3ff9955df5031233f45d6d", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-musleabi.tar.gz": "a7b7a2cde45cfc3d4d74031c36dcb8ea8214f4517e96b5a09bc46f898faf967e", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-musleabi.tar.xz": "b178e41c2ad6089e3448209cab7808e93aba7700aa3571f062dcdab74e4753b9", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz": "0de36da3bec6c34a6e56162b92f88b42ed76e596459a6d1416748b9fa8e8225e", - "dist/2023-12-22/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz": "381006c411b222254b5bc55302096678a47fd085de06615558dce5085da47f22", - "dist/2023-12-22/rust-std-beta-armebv7r-none-eabi.tar.gz": "464271fe1c2fe699167afbfe9cdb2ed2bb3a38671d616f6f28d6b7fd4fc72cf4", - "dist/2023-12-22/rust-std-beta-armebv7r-none-eabi.tar.xz": "13dc946ac5dd45104c51010bc8a0bf5af64d549cf6b59f8b8b0ac9b06dc5d0f1", - "dist/2023-12-22/rust-std-beta-armebv7r-none-eabihf.tar.gz": "2e01997df04b9635d840ca177e4ef379232955cc586e2196c26ea1e18b66f883", - "dist/2023-12-22/rust-std-beta-armebv7r-none-eabihf.tar.xz": "a11c1e8c52ba653e5c58baf886b6b1383c622632959d09321ba1dddc2a91caf2", - "dist/2023-12-22/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz": "b036abe1c19e3f86b80ee670196194ccddf0bfa5261d4ba9fc7994aecb5a487d", - "dist/2023-12-22/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz": "a9b90e4b43353feba58dfab424ae36441077fbb6b8469bc071c058f0bd85aa81", - "dist/2023-12-22/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz": "0faac13a81d60fd9315c6ea6c929b1fcb9366b23119b658dc05f10a0b4b2e2b6", - "dist/2023-12-22/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz": "62023710833973795681275bf34c45a309327f6e76934603c58b07f204e67a20", - "dist/2023-12-22/rust-std-beta-armv7-linux-androideabi.tar.gz": "f48e6eb32ae56fb09a9860f529cb65ca4168d068b6bfa6b1b3164590628ef635", - "dist/2023-12-22/rust-std-beta-armv7-linux-androideabi.tar.xz": "dad3d32a6314f7c9de8003476f9667d19f452a331e6363bf25c2ed255a8b0063", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz": "b8d045889b709783387752e6275c6818c353431bb7b9599e9aa88c6e373072c8", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz": "4750a55e19b27b34e59daa2d1b0f6655ba9d8c491780c785a7adbcc160eda425", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz": "829c608b0f7f4f6bf73688a30e51d69228b69a9487137751e0bf641f7e8e227a", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz": "4e4d1b1d10b1b7931e2a801cc3d3edb68c91d5f58baaf99fa2f88b9174f2b294", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz": "cab9b7f30fd074005c59ab5dd4d59c498367671373f5662047c8e16c19236141", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz": "b281e7c3a32523de34c2f7ed646d19f4f32b1db905a222aa1301f8bc57e312f2", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz": "ebed7143f8cbbf5eb2b99328c6246ecdc51905a90c4c832a13d76f6467e2014a", - "dist/2023-12-22/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz": "6c06418750cabc38f46e434890c2422df9be5177ed1f4b04dc7f67e45cad307b", - "dist/2023-12-22/rust-std-beta-armv7a-none-eabi.tar.gz": "06d20a34ef000ab381025c0458bd327d3a2bb13a77f3485334cdb63e51a7354f", - "dist/2023-12-22/rust-std-beta-armv7a-none-eabi.tar.xz": "741edc509d401328adcf462aba08744614ad655fa42f89c9818aa1dc715e2d3e", - "dist/2023-12-22/rust-std-beta-armv7r-none-eabi.tar.gz": "0a5c38d1a7a9d653e32750a5f600f1887422d4e90360b6f1d98df45084436822", - "dist/2023-12-22/rust-std-beta-armv7r-none-eabi.tar.xz": "ae960df5549284a7976129da79916287d84f1d9dece2bb8ada6a3f3cc3246509", - "dist/2023-12-22/rust-std-beta-armv7r-none-eabihf.tar.gz": "9280fff8012234559ad644edbe9827c2ef6931d95fa96b5f6a4aa7321215f5d2", - "dist/2023-12-22/rust-std-beta-armv7r-none-eabihf.tar.xz": "3bed6d2a89baf609089c431e73d36b73417541f63c8f2bbb190bdf706cd85e93", - "dist/2023-12-22/rust-std-beta-i586-pc-windows-msvc.tar.gz": "b8bb7b950134f5e3ba3257ffc55d2b0e4b483955e74f6a146017c1c818359ab4", - "dist/2023-12-22/rust-std-beta-i586-pc-windows-msvc.tar.xz": "3c3b4771cd51159d35cf5de21e9bf625453972a53207ca3e6a027901b3eeb7c8", - "dist/2023-12-22/rust-std-beta-i586-unknown-linux-gnu.tar.gz": "ed89e574db830d882f1f12f9b570bbc5f4c89776808ec05cbfcb498eb947e6d2", - "dist/2023-12-22/rust-std-beta-i586-unknown-linux-gnu.tar.xz": "8c32678710cec0971aa6f740cbb525c0c174f6552d181466b7d49d5822d671c5", - "dist/2023-12-22/rust-std-beta-i586-unknown-linux-musl.tar.gz": "2ebc2381b980637844cca7be78a01d204472328897bb02c28b8b5c32bd8d20bc", - "dist/2023-12-22/rust-std-beta-i586-unknown-linux-musl.tar.xz": "df48e6af6cc9df2fba7af56b4cccd07e53a0030de964c11e83b7cdaff1bff4f1", - "dist/2023-12-22/rust-std-beta-i686-linux-android.tar.gz": "25e6cadd083ba7f02525e411677ebf8470bebae19c0f5fdba453140ddf97a3d1", - "dist/2023-12-22/rust-std-beta-i686-linux-android.tar.xz": "bdc722479c73b6fcc6ba401d6f747acbfbdebb074e911bd44a20c8c3ce8192b3", - "dist/2023-12-22/rust-std-beta-i686-pc-windows-gnu.tar.gz": "6a8b46606ecb46d16f2d45ae82faaf155ad617b1b81259eed93b77a267b5265c", - "dist/2023-12-22/rust-std-beta-i686-pc-windows-gnu.tar.xz": "97c58f4e4cee06dd38ad9e3a56ce505434ee77f0f0db30432d04739d301a194b", - "dist/2023-12-22/rust-std-beta-i686-pc-windows-msvc.tar.gz": "1012704d42aaaddbf0679013ea578245e88200afd55d1d510dbe58bdd14b8ef9", - "dist/2023-12-22/rust-std-beta-i686-pc-windows-msvc.tar.xz": "cdb291df9fc41e038b38a3a421b791a2c39be3bc9686c5d6e93cbaef95c2ff6b", - "dist/2023-12-22/rust-std-beta-i686-unknown-freebsd.tar.gz": "20df3466ef1a82ca986a3239efba9d984535c64d5663f2b3b92b9d6ec2972b25", - "dist/2023-12-22/rust-std-beta-i686-unknown-freebsd.tar.xz": "6a63dcb9f7312432c6bf290dc3fea10d56a17472cab65c7d82fde30c800d8b5e", - "dist/2023-12-22/rust-std-beta-i686-unknown-linux-gnu.tar.gz": "8d3ae5e37ab866b93bee661773301956d8e6e2294910d0ff04f782f2c7271dd6", - "dist/2023-12-22/rust-std-beta-i686-unknown-linux-gnu.tar.xz": "9963bba2883125aded9c6639dda498c3effd574fa032d2268455948df3243979", - "dist/2023-12-22/rust-std-beta-i686-unknown-linux-musl.tar.gz": "64e13948dc71571be5c3a4e367d961bcc0bc38167680e86a55b2d1357a45b7ba", - "dist/2023-12-22/rust-std-beta-i686-unknown-linux-musl.tar.xz": "ca54983531703de8f7350e00bad2cde13dc996d9de1c0ca1728b50a015dcb344", - "dist/2023-12-22/rust-std-beta-i686-unknown-uefi.tar.gz": "a4e3c395607d9ca189c130e371c49ba0a08d1974c56c656a23870d0ca08f0cf7", - "dist/2023-12-22/rust-std-beta-i686-unknown-uefi.tar.xz": "20e6ceea5246322840b3fc76b01b16ef32d829ae4e587a052512c39c3c3babca", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz": "6e4dd7fa56112a879917ea24bfbd45dca625ee812908867e427f23d56deb910b", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz": "23862a72211645d29557d3a1dda63948335d15a9796c139a0676124905e72906", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz": "6abd7c64f58bbcbf04b643a9787f0fef1fe80b89b82143b6251b57afa560cff0", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz": "53fa4d33241b73653523810e441bed53dcac8c3fb7b7de88c125cb8ab8eb66df", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-none.tar.gz": "bb94b1d2391e11f268c0e4c127c06b356e9d79aaa6c68862dd7f97a8fd756e61", - "dist/2023-12-22/rust-std-beta-loongarch64-unknown-none.tar.xz": "663d531002d8be8e61fe4b9353a53b3a44056056b18bbd76749762a40416f7fa", - "dist/2023-12-22/rust-std-beta-nvptx64-nvidia-cuda.tar.gz": "3a25dd389b4501e9fe76057b70cb120e1d1d3caacdce82abc834297c487e50ce", - "dist/2023-12-22/rust-std-beta-nvptx64-nvidia-cuda.tar.xz": "6be12fd4e79600805cd6d04a5bd1d236dd7f12832d4407d3fcd72ce6bd84101f", - "dist/2023-12-22/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz": "6edc5d7fb15d71cbd097a09eb264b92f5b1e55f7ef0426c5c8399731f4ebb70d", - "dist/2023-12-22/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz": "beb17c9ca9e789ced8c4046135cde5b613a0b41c9b5aeefb3b7ee5d25701add6", - "dist/2023-12-22/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz": "6f13eb2dac5f4d59dbe44a4d862f94f763fce0bf4ea0f128c0006c04b922f294", - "dist/2023-12-22/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz": "75e629ca2f90c7e8a78fc16d13cab337816feba3e30564e26b3d38f13b7dffd0", - "dist/2023-12-22/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz": "e2ffac9803e2c604c56649096e734cff0a53632883c05cb9f1fd79f6ce420162", - "dist/2023-12-22/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz": "85e0193a7bfa284ac4dae84f4079605ba5c2f7c7c2e4f57ac74721aff44d05b8", - "dist/2023-12-22/rust-std-beta-riscv32i-unknown-none-elf.tar.gz": "41c57fa6eafdc2bc4389da8257b57e48af4250377b02760d06ebc38c83086534", - "dist/2023-12-22/rust-std-beta-riscv32i-unknown-none-elf.tar.xz": "02d46a445f52d078982866ee9430f8020e15d82f58d8f1edfedcd2f0ade51f36", - "dist/2023-12-22/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz": "6fdfd4e5ce8dc13cbce7cfb1543dafb54e80ffee0ed40935c3734787519a9673", - "dist/2023-12-22/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz": "5a645c8703ba10256605770ffdbb8abbef62746171f19edbbc069d02be501529", - "dist/2023-12-22/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz": "0cdefa18bc524ef66ddabf83fa2efceced02ad1a5271c9d95f91ec01178055e7", - "dist/2023-12-22/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz": "388dc6fba431953f581388d95cd860224e2d1203811ec86e66aca391650ce053", - "dist/2023-12-22/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz": "b3f756e69c0c1f257869cfa6ef239368a512c81b59c18a69851b2e5a73ec484d", - "dist/2023-12-22/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz": "61d020bea165d8abc361335e393c2c3bb1e59b6fdb0f6f65326392ec7dc3ea35", - "dist/2023-12-22/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz": "94e83a4ba2d141e9fc0d824a6f5e077796fd53b7b32578a1bf6e63cda1f9ee4d", - "dist/2023-12-22/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz": "9679bfb1664e6d14882e68940fe8960773f56f4867904a3259189f9eb96952ca", - "dist/2023-12-22/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz": "807b24b0568e83cc807e29ae6062a766f72ef48e12f9f257d78f6db4b9ee5621", - "dist/2023-12-22/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz": "d3898d851c5f728a9894e7755d0b6ff06133823b1773e5c80b29155f6e1152a6", - "dist/2023-12-22/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz": "9ecdd32e65c85130f8a1c82c8fd9d613a4c59b1e4fafd01771089a052d4a481c", - "dist/2023-12-22/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz": "a6b5ef2065cd5cef17e48791dae08090b755c00caca4efc1aa5eac9c2783e92e", - "dist/2023-12-22/rust-std-beta-s390x-unknown-linux-gnu.tar.gz": "df756fb3868a3ed347a92df37fc4aac696560d645696d5d86a15d84bde257546", - "dist/2023-12-22/rust-std-beta-s390x-unknown-linux-gnu.tar.xz": "777dac6ecbefe1e266c7bfd04644f428ae25318e80137a36d404009442ea208e", - "dist/2023-12-22/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz": "6802baa472bbf3f766346f24cf7b001cf87ea7f974bd1e1abdcc56b4c2b39bdd", - "dist/2023-12-22/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz": "5db8e7c4904c55a5d362669375bf72482e27042b7a156bd8b9d1c322b2bf521a", - "dist/2023-12-22/rust-std-beta-sparcv9-sun-solaris.tar.gz": "0ddd12279d34cc6190e0b1e163cee51d94be809fefa4adf801fea0f217a3519a", - "dist/2023-12-22/rust-std-beta-sparcv9-sun-solaris.tar.xz": "96ed998c6f254c9a5fe560474480db553cd7428cca65ba9a7732136bce191e48", - "dist/2023-12-22/rust-std-beta-thumbv6m-none-eabi.tar.gz": "aa36baeedb2b567f75a0fa550f2ebb507f135d4fe784343a576216237a87d643", - "dist/2023-12-22/rust-std-beta-thumbv6m-none-eabi.tar.xz": "0792a2de23b8c8e552565bcf691ca604760d5201ae247ec14122df11d3819f30", - "dist/2023-12-22/rust-std-beta-thumbv7em-none-eabi.tar.gz": "93a045ef6b38b1de7347880d299dcaf6f721af301fc811e47388b0b94c6290a6", - "dist/2023-12-22/rust-std-beta-thumbv7em-none-eabi.tar.xz": "c6f13b394ad21bd6058fae6845543d5f265e8124fd43ce16885800c4bd62a370", - "dist/2023-12-22/rust-std-beta-thumbv7em-none-eabihf.tar.gz": "8ee5dc194cfd20626671d6b7924b68246d4cc820ca669d8fa9778086b043c3dc", - "dist/2023-12-22/rust-std-beta-thumbv7em-none-eabihf.tar.xz": "f702b3ece0c74a4391e4ce954456babba8d170a1ffff438222a9bfd22df139a3", - "dist/2023-12-22/rust-std-beta-thumbv7m-none-eabi.tar.gz": "3cd3bc99d559a56ac8795c3602c59652877bac85e0a847c981c9ec2b1a86039b", - "dist/2023-12-22/rust-std-beta-thumbv7m-none-eabi.tar.xz": "0d8132f6922844c017fa0c0c3ec463e4a55e3fed7603fb2e8374ecf5c1405e52", - "dist/2023-12-22/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz": "ab1bc71bd1b00c0d38a3a0a3be1e5fc5a494219d2d37181da53b042b3b896c67", - "dist/2023-12-22/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz": "5cd28af392967e42e43f51233637ff690a524d840c50a328d5d52c594977b316", - "dist/2023-12-22/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "647b9db01306e225ee1867e194531028215a9fdb02b3f8713c07c39dd41d0c85", - "dist/2023-12-22/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "9a6ee652c9e15708f2aab76a20918f414875a8a52323a49d727b58aacc22d1f0", - "dist/2023-12-22/rust-std-beta-thumbv8m.base-none-eabi.tar.gz": "c16e452e889c9d56d417c871ac4f9290275df11563d458e1abc52e4ac3db0414", - "dist/2023-12-22/rust-std-beta-thumbv8m.base-none-eabi.tar.xz": "23a74836c303dc91e6ed9fd2078e130184ac19ac230946bd95e59c53666534bf", - "dist/2023-12-22/rust-std-beta-thumbv8m.main-none-eabi.tar.gz": "c8d01ed9cfe9938ed078e3f14ef9f4fa5367534ebe115f243fee8095ef3c174f", - "dist/2023-12-22/rust-std-beta-thumbv8m.main-none-eabi.tar.xz": "a24e99a9d45b19db342d5c5f903ad90a27be9c996278b76823121fd09d5a298c", - "dist/2023-12-22/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz": "e417661f5c42593e75b09b4a3531965e46f5dbd631809d6364e59d47a894b1c3", - "dist/2023-12-22/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz": "081ec9d8504af85ce93bc60ae5f3eaad8bd06864b084a97911e126564720b3f7", - "dist/2023-12-22/rust-std-beta-wasm32-unknown-emscripten.tar.gz": "1df5182c5103454eb69f05b3e6c9aefe1374e43659f3e4cf68f0ac07052670eb", - "dist/2023-12-22/rust-std-beta-wasm32-unknown-emscripten.tar.xz": "863278bd1a5281e6b04232e35df48a1dac7e909d3b51922cb328304cb6db9af2", - "dist/2023-12-22/rust-std-beta-wasm32-unknown-unknown.tar.gz": "6d80b9f8875f677a8e472c431d6df15babba2a9af62622da5a073ca9da467f69", - "dist/2023-12-22/rust-std-beta-wasm32-unknown-unknown.tar.xz": "cc9bf2bd9db87859e17ffd0b9a3ffb8c073e521fc035b75639a7e77fd04a210b", - "dist/2023-12-22/rust-std-beta-wasm32-wasi-preview1-threads.tar.gz": "7b2db2cb1fb7b35cecee218780fdc223464522bf4e5ac0e3c3342396bea77755", - "dist/2023-12-22/rust-std-beta-wasm32-wasi-preview1-threads.tar.xz": "ed893747e7165c97b2a2abfe4793493056cda613040eb5783ba0c4a57560f42c", - "dist/2023-12-22/rust-std-beta-wasm32-wasi.tar.gz": "cfd98053e598d830055a35702de43866b6c94b48a36c63c1683a302482bc4cc4", - "dist/2023-12-22/rust-std-beta-wasm32-wasi.tar.xz": "f57bc02b197d8f4c0d119f4ecaed6c405cc85bac7d00a55f2dc39e97ebc8411b", - "dist/2023-12-22/rust-std-beta-x86_64-apple-darwin.tar.gz": "70405814aefa163d60eabc777b882233797d075ef5a3052285a6aa4acf7c9c0a", - "dist/2023-12-22/rust-std-beta-x86_64-apple-darwin.tar.xz": "c26043ff5bb98223083aa58f659f3ef069f5cc97e5f3c1a62664197e3d8bae66", - "dist/2023-12-22/rust-std-beta-x86_64-apple-ios.tar.gz": "37a2b083652163adfd848872c7b42570ad6fb365ec679a1c89a8248c517021a4", - "dist/2023-12-22/rust-std-beta-x86_64-apple-ios.tar.xz": "cbba44d048a5c48dd4162dced5414eca2416047f2387708e46a2045553a45fa4", - "dist/2023-12-22/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz": "17e93708f7c0b4328d24db2ad2a82c3001c1bc03def829b7e182e5407fe74b82", - "dist/2023-12-22/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz": "761b39d8ab6b9061c0afd4fa2faaa88c7cda6322d615e57863b51a5a2826d70e", - "dist/2023-12-22/rust-std-beta-x86_64-linux-android.tar.gz": "f45d09e9a6c383c6cf9cff99d0046639d26636be78e194354e951fa99388e479", - "dist/2023-12-22/rust-std-beta-x86_64-linux-android.tar.xz": "fe323b71cfbb300f881d05879d03491aca507a644b261c16f148690dbb20a01e", - "dist/2023-12-22/rust-std-beta-x86_64-pc-solaris.tar.gz": "0dce2b6572bde41461086c6394121de7b97329f8192562684954542baef1ff05", - "dist/2023-12-22/rust-std-beta-x86_64-pc-solaris.tar.xz": "164fa2c995df0d6446c218e037025de1b225d92a51155b5b54328f67493e8202", - "dist/2023-12-22/rust-std-beta-x86_64-pc-windows-gnu.tar.gz": "848e55f4583bd589ae457d37b8d7367adafc24b87c35a08065114b3acdd731f9", - "dist/2023-12-22/rust-std-beta-x86_64-pc-windows-gnu.tar.xz": "c900770454c026b80f9b80bb745a84381f91492d552fcc7ba013e5fd46b2a63d", - "dist/2023-12-22/rust-std-beta-x86_64-pc-windows-msvc.tar.gz": "577f8db6e8654e9f3d97c83bbfa2eaa89fb0fe8c9362b976b9796297d189b6a8", - "dist/2023-12-22/rust-std-beta-x86_64-pc-windows-msvc.tar.xz": "5d2523bb1b31b4b43c527b8307ac8e00ad7e957fa652fe0628cb8e6796404d20", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-freebsd.tar.gz": "5a185ac2058969ed6aedbd864cf7037fe999eacfb9e11eb21f89696d6341741c", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-freebsd.tar.xz": "7f6e73e0cc5fae9b9e9142427decf8c4d48289033412d452a40c1a345f4311a8", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-fuchsia.tar.gz": "c1974528eeea3346e070192f3729fbcc4fc9d6bbdb0c0b9ba73763758a695124", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-fuchsia.tar.xz": "b4da6ab7e3bef63c2f381f7506ff0f65f302e0ed14d4f78016968b0cff3a5f5f", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-illumos.tar.gz": "3f50aa342f03ad5235112560fe0f3c64f5139d09291e3ab6859d8169ff43d631", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-illumos.tar.xz": "799eeb21df5ff213c8ec1f6250497665924b865b34d9c1a5f914eed48255278c", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz": "ac88a7247dec36da73d30cb58c067cd1bd6c5bc70e5820d031963fced0907c28", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz": "3de39c55f71a295ff38bce9843965309a40dbfe1c888f13dbde3935d26ebdfc0", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz": "eeae5e12254e54c87ed818e8449c2489717d1c3c25858c6e8a1a7502e57172e0", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz": "0d54e6882ffce573f70954d98e1f0c9f0758c5d6262e546ed95c055798d26bef", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-musl.tar.gz": "da056f4b1d8544382b90cae7061be549b2e06e3e880feb9d788200c022ab297c", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-linux-musl.tar.xz": "f340687b51519830a1e566c84c0114581c817ac32e80f90b8baf0fbe960fdd5d", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-netbsd.tar.gz": "6ea1fedb7db6f51b79164ad39246dc2c86f743346feb760f4835c870be3931b2", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-netbsd.tar.xz": "7fe78fc5dfcb2d85b521dba2c9640233615fab04a8a1b8b27a2e0efabc5b5b60", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-none.tar.gz": "8eb08022fd4b78b50784ab9671a81b69c899ff2e73d9ae08b6ea44ed018b2c8a", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-none.tar.xz": "6ab096ba0bad97de603be50a05e16a33bffbaf4a97853d9f838721075b18aab8", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-redox.tar.gz": "84632635271947ff93b1afdd35779e7c307182d964e3b2aff60e57c0ab02a9eb", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-redox.tar.xz": "b21150ef965377a699410a0350395e0daf57e3ab8a3d90654482b17960dfd26b", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-uefi.tar.gz": "7a703ac3b26a1ec21a64f6517f03938e458db5d46977f02f9359febe7e3e4a79", - "dist/2023-12-22/rust-std-beta-x86_64-unknown-uefi.tar.xz": "83607ae59dddf457d655a2e60ad6d7b500a144fec4d41a7f684555204754e2d2", - "dist/2023-12-22/rustc-beta-aarch64-apple-darwin.tar.gz": "4988d34a6c048ee278f0d675e05260a0ab7f635c09c8ac6964ea97dcd244b9a7", - "dist/2023-12-22/rustc-beta-aarch64-apple-darwin.tar.xz": "a5a218eea6a3edf9b8af70046525fa6259ebf391d6e91f0630f6ae441a227a82", - "dist/2023-12-22/rustc-beta-aarch64-pc-windows-msvc.tar.gz": "0980f8dfdc522146433cab04f2b83378b0c5bdb632cd02e280469ddff02e8bbf", - "dist/2023-12-22/rustc-beta-aarch64-pc-windows-msvc.tar.xz": "25cf2c04a79313040860831dcce67a123ee362e09bb185a16af171163ec8b087", - "dist/2023-12-22/rustc-beta-aarch64-unknown-linux-gnu.tar.gz": "e21656abc9b9111baf5fdf9aebbf29b4ac8123c163dfb979b5f047c530020f29", - "dist/2023-12-22/rustc-beta-aarch64-unknown-linux-gnu.tar.xz": "3087de6766ffa175dbf7c53153b24cbc29db1fccc06170fd70bd3dc3a97bae62", - "dist/2023-12-22/rustc-beta-aarch64-unknown-linux-musl.tar.gz": "e2464b82f2e1c4450d4f9f6fca8c5d2315e6227651d7485cd487d39fbe7f940c", - "dist/2023-12-22/rustc-beta-aarch64-unknown-linux-musl.tar.xz": "9d4909db94be068ef943eba3709195a028e3928198a87f38e72a6fe013e592db", - "dist/2023-12-22/rustc-beta-arm-unknown-linux-gnueabi.tar.gz": "9217ecb54faf8c2964476c3c7a9ec6955b276c4c5b89e5ff13d76fe4863ba8ef", - "dist/2023-12-22/rustc-beta-arm-unknown-linux-gnueabi.tar.xz": "fad7556560de459c4cbb59071a35746ee520ca15b5972e926039d46847a47888", - "dist/2023-12-22/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz": "69d94023fd5d8a48873ecde6892ee1be354fb56a91c9bc16b32d7b8bf090ad07", - "dist/2023-12-22/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz": "14ab98c13452b8b7e5ba8853b957355487c61f0a89d385c2ec8d16d8fec382aa", - "dist/2023-12-22/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz": "85190846421ade8edb5da369977598641bfac215754bdbdceccb181adf49d2b4", - "dist/2023-12-22/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz": "5b0de94607e7e1192463dd1c8615cf035040cf1a51ccf4d08459f659e14aebb4", - "dist/2023-12-22/rustc-beta-i686-pc-windows-gnu.tar.gz": "dfb48dd8d18099b63eab2e0f6e01dd520e6d137725596af611d68092f7d2228b", - "dist/2023-12-22/rustc-beta-i686-pc-windows-gnu.tar.xz": "f9bdb3dac14ded817c6f406767ef140838cedd74b9b2b6daed6419cf096245da", - "dist/2023-12-22/rustc-beta-i686-pc-windows-msvc.tar.gz": "a01af2a20955790992eb248a290161184429d43c8ddd65d8fd18dbb6499edd6f", - "dist/2023-12-22/rustc-beta-i686-pc-windows-msvc.tar.xz": "334b999f3e7c6c8deed7807e398338393f32c641989bd61c631a79a3a7441d67", - "dist/2023-12-22/rustc-beta-i686-unknown-linux-gnu.tar.gz": "334126bcfc14e8ffa5df43c4265b844db5a2b72458f5b3328f6863ea59580b12", - "dist/2023-12-22/rustc-beta-i686-unknown-linux-gnu.tar.xz": "aefe562ff063ab5eea83fdb58577e6ffbbf9cdf111e5390ee29640e5169c2c7c", - "dist/2023-12-22/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz": "1a9eea2e8fa598c438de05d33d0af4f7b648fc50ff25013b3926c6125dc75542", - "dist/2023-12-22/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz": "1f0d707a8d96071b1154ff1ffca518a9573d7c1d95835bd35bc3660a8a4d6cb8", - "dist/2023-12-22/rustc-beta-powerpc-unknown-linux-gnu.tar.gz": "6cf83e99462198dfd6fd4b7d5dc4ccffbbfc433d5e3b082028420ad7e2da6144", - "dist/2023-12-22/rustc-beta-powerpc-unknown-linux-gnu.tar.xz": "295e22e887c9b2d686628fc927d6560e0f71f2330517242d36d1d98159d43a6d", - "dist/2023-12-22/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz": "3b970b0cf7243e766a773c9f30557d8d20da668467b85c5cc60fd2f7e927cb09", - "dist/2023-12-22/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz": "dd4470357d4351081c9c1526c6a4c66642b11c88f8ac194ae7f0414593b2e561", - "dist/2023-12-22/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz": "7684ac7d4a96678d599bed67a11338531f09b500769d94b2b70cf1b1854a0e33", - "dist/2023-12-22/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz": "b9f98f6003605d179d298ca1080448784601f9648817e5c84371e54eaafcf36f", - "dist/2023-12-22/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz": "376b86e4cb259c5c85286203c00405570a77346441037e175c631b2753f4f421", - "dist/2023-12-22/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz": "d4d1b511f2ce2dd2dbbcdde760879b0ce87ac1c191f73d9b264403c328d3c505", - "dist/2023-12-22/rustc-beta-s390x-unknown-linux-gnu.tar.gz": "b46bd2d835f98a293f259d90659334bd289cfff34d4fac544be2add0b4072014", - "dist/2023-12-22/rustc-beta-s390x-unknown-linux-gnu.tar.xz": "6c3e19a3b0dd8deef825f9c6ecba405df6b8a390f6366991c1947f09401f7192", - "dist/2023-12-22/rustc-beta-x86_64-apple-darwin.tar.gz": "5c735a5d0ae69383db88bbc0d7ea5a6f2300c82ce81d1a4b4f987157ac03dd6f", - "dist/2023-12-22/rustc-beta-x86_64-apple-darwin.tar.xz": "5f483a58253a0d6fa58503bd5bf58f8a79c32e49228bb4645a7931c61465d27e", - "dist/2023-12-22/rustc-beta-x86_64-pc-windows-gnu.tar.gz": "ef3db1dbcb14174dc39670810c417b6395e092a92622d49d9bcf4074a02bd32c", - "dist/2023-12-22/rustc-beta-x86_64-pc-windows-gnu.tar.xz": "d73c50be69cc0a817273c75ca86ba094509c9168bd445cfe81690bac48a613a7", - "dist/2023-12-22/rustc-beta-x86_64-pc-windows-msvc.tar.gz": "4476c15df06fdfaf90a426a438cc10e5c0afb4e15ff4394d501cd8f8202f95a5", - "dist/2023-12-22/rustc-beta-x86_64-pc-windows-msvc.tar.xz": "8066766e26df9171bb66e07001c1f3d279f84f48e90ac7cd80ef0439e6de29bb", - "dist/2023-12-22/rustc-beta-x86_64-unknown-freebsd.tar.gz": "7128054459be36bf501225ef22c105edf599ed4732829bd35c20d6831278c799", - "dist/2023-12-22/rustc-beta-x86_64-unknown-freebsd.tar.xz": "a4d6429df3ea63c4f58af3311f3cb986546932a73ae363a768ea6cb630a9b59c", - "dist/2023-12-22/rustc-beta-x86_64-unknown-illumos.tar.gz": "adbb9d176605339353b9c84f53da7301c262966a43e9c25fb5dc408591a5e30e", - "dist/2023-12-22/rustc-beta-x86_64-unknown-illumos.tar.xz": "69bacc4bdb3466862ab86a524516e88e1af3e6379a6bd5b38a5d872534d7584b", - "dist/2023-12-22/rustc-beta-x86_64-unknown-linux-gnu.tar.gz": "49b58d45a5eeed663619b6976ef5a97d1d69ee6d1426046f5cf352ce2730aa81", - "dist/2023-12-22/rustc-beta-x86_64-unknown-linux-gnu.tar.xz": "9896fc9d8a363a1684abc892f70f71047f43a27eca362911cc39474582a3df7f", - "dist/2023-12-22/rustc-beta-x86_64-unknown-linux-musl.tar.gz": "f5e9ea5090e1a1f1478c1b6c9f4c2975955630717d00304105e7c2b4d30b5793", - "dist/2023-12-22/rustc-beta-x86_64-unknown-linux-musl.tar.xz": "121f57a07ac943c6d48d4519d863e873501edb57d04d8e2842c847510dff73e1", - "dist/2023-12-22/rustc-beta-x86_64-unknown-netbsd.tar.gz": "0ba119cb9e004e008daf53d6f2687ac48b5cadcea81c69f8b7a0f967be0939ae", - "dist/2023-12-22/rustc-beta-x86_64-unknown-netbsd.tar.xz": "81b8265afce99ba1fd7db811611da0f7296b066c2db0f4e65bababaad3f04ea6", - "dist/2023-12-22/rustc-nightly-aarch64-apple-darwin.tar.gz": "101130c9df70b39a6eb8b63ce1c457d8060c961d4ab845f4edb7b02e1b68e5e2", - "dist/2023-12-22/rustc-nightly-aarch64-apple-darwin.tar.xz": "ac84e13cc222d4bfc6670b2bec5407c77792ebf82c51e812ceb3bc972a9cfe24", - "dist/2023-12-22/rustc-nightly-aarch64-pc-windows-msvc.tar.gz": "8ca4faf6ccf792534c95b8091786d8b2b79ba99bfcd2537e2cb7fd97a3fc46ba", - "dist/2023-12-22/rustc-nightly-aarch64-pc-windows-msvc.tar.xz": "97db2f021e7aacdac1c81ab72264eede6cb72cd83f1c317ae84a3ff39b05584e", - "dist/2023-12-22/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz": "c274e2470c8cc801495f7a656a10250024173d5927b7ffa2e9251e0b776da5f4", - "dist/2023-12-22/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz": "024917a1f37a2db0bc8519dbcdecde7321c5d460886b76817791ea484595c44e", - "dist/2023-12-22/rustc-nightly-aarch64-unknown-linux-musl.tar.gz": "bcd861c8f6c7f7355f7d6196c405061e90a2907adbca52400b8dcea7bc9b42f1", - "dist/2023-12-22/rustc-nightly-aarch64-unknown-linux-musl.tar.xz": "19c52eecdf2dd4fb0b6a5c240c440c6d47148e7264d7efaa77ac484a8429802b", - "dist/2023-12-22/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz": "38fe3274425db7e9142530be734b473fb5742ea10d05deec24168730d8e65d0f", - "dist/2023-12-22/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz": "1fe18e92829eb2b87264dee5631329804a7da8177cb15043fcac27c1913a0b89", - "dist/2023-12-22/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz": "41a723fbfbcc9c003b59fe17e0bef28d69ed89f165c42afcd00e3617a7da6915", - "dist/2023-12-22/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz": "7f834044d638e8e15d8900c38b8ec1fc6e4ef98efddf3ab7342b24e59525c6a0", - "dist/2023-12-22/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "814402e50600573b6fd79ba3a84fb8c441d71eb2f3eff0257565fd514830ab10", - "dist/2023-12-22/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "2f2650f7ad3d86dd63bd887f6e5e5e5051ffdeef672ee8dbc96c738acde79e21", - "dist/2023-12-22/rustc-nightly-i686-pc-windows-gnu.tar.gz": "6cded96f43ea2aeb2c15ae5e58521301110d6a2f8e8870ff2d6e5e1d8d5d13ff", - "dist/2023-12-22/rustc-nightly-i686-pc-windows-gnu.tar.xz": "2682f11a1375b1b93a9f7110f121340a4994f736c263d37037fb29a5b6df69a1", - "dist/2023-12-22/rustc-nightly-i686-pc-windows-msvc.tar.gz": "9322ff47c86859ba405d6584407b3ad514e6ee1b7a47525a0e20a918875defca", - "dist/2023-12-22/rustc-nightly-i686-pc-windows-msvc.tar.xz": "1dd7be7fd7e51ee9e8c053b2c7c222031aa436497e591ad87a5ee2f2289022f5", - "dist/2023-12-22/rustc-nightly-i686-unknown-linux-gnu.tar.gz": "35e96a4ff0436ed31bb62e06b8898e3048cf11d3ae85f1097741f6b6d2ac0304", - "dist/2023-12-22/rustc-nightly-i686-unknown-linux-gnu.tar.xz": "a8d4be1c79031e6ae2ebf594929cc4cbdd2e0655110ce2a9983e1adee1474b3a", - "dist/2023-12-22/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz": "7a2b50a5309770784a47662b5616026e735cb12ebd785c578c3a16965167ca3b", - "dist/2023-12-22/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz": "8cf64de71cd3566683e487832c3f4143f306d4fe9658fa1e16b794d3ee25552b", - "dist/2023-12-22/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz": "f1890a35bb23fdc85736e18a7230eb4ac68f1d1772a8b1defde1c6fc53b547db", - "dist/2023-12-22/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz": "5a1cbf44eec83fe1172cef13a38c2f23c2cc2753847ad9577b4cbbc0793ba96b", - "dist/2023-12-22/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz": "b5e7b7d42a233010142806953ba10820f45be90574c885d9218d41865310d606", - "dist/2023-12-22/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz": "073c15e2528c30fc51e7964649cd84fc54ce7d6e71f32c4bd5e25028cfe66f01", - "dist/2023-12-22/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "0a579f70e0e6752e5ee257fcc2c77a4986d608262089427f3ae38ad1ff1d8864", - "dist/2023-12-22/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "d9491f667829d36df5db42ad40e0ee6bd0f5d53d854d8648462c357fcc709ca1", - "dist/2023-12-22/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "01bc45a98dc4791b14498d58681a894e3646ea0588fbaf23465dad1034cf7dc4", - "dist/2023-12-22/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "4eca6ca78604697090e48c262aab864a14cdd15607272699cfb9f93b0fb3b9e7", - "dist/2023-12-22/rustc-nightly-s390x-unknown-linux-gnu.tar.gz": "c77f35e12eb4e664c3f59575401c20071e3489de8a80e47601321823d1c79b09", - "dist/2023-12-22/rustc-nightly-s390x-unknown-linux-gnu.tar.xz": "61f3c129cfabbc5e814ea0ebb183d6674dafa593f56c017262aa60d241041983", - "dist/2023-12-22/rustc-nightly-x86_64-apple-darwin.tar.gz": "2ef95843d229f3b5d5efe1d2cd1cf9a5d2a5500b9f8d00a6ba5eef55a8689643", - "dist/2023-12-22/rustc-nightly-x86_64-apple-darwin.tar.xz": "ee3ac1b167da164384d1e3ac8b6fbde9668b68705afa1a047a1049e90b5bf66d", - "dist/2023-12-22/rustc-nightly-x86_64-pc-windows-gnu.tar.gz": "a98e2f3976a5b64f802616c045861571c61eef332c7206e0bfb10fca580c6bf6", - "dist/2023-12-22/rustc-nightly-x86_64-pc-windows-gnu.tar.xz": "549caf445a9b4886c47bdf82628e365afe8cea59739a3b41308c828c4eb9e7e0", - "dist/2023-12-22/rustc-nightly-x86_64-pc-windows-msvc.tar.gz": "db9bb6ae1770056cd787162ab24e54bad0dc2c8bd2861c8c3ded642f9e963643", - "dist/2023-12-22/rustc-nightly-x86_64-pc-windows-msvc.tar.xz": "bc410fb240404e3c193e39667485919660d58b7a5774301f9d0cb21ff744eaa1", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-freebsd.tar.gz": "e113660740b61a1e20d72813e7ef076b7a894f5db3576abae812f501eebec409", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-freebsd.tar.xz": "a0bacdf5523cbc5b59f49fbf99eaa571609faa4aa8765a09f9f091ba3f4f5686", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-illumos.tar.gz": "29f8ee90239986050d96d1fbce42f0ec104653a44c49d050d5965ebbf8e94ff0", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-illumos.tar.xz": "c4c04dc8d91f53db3420114a6020c76771b6dddf43f322ec0575c69a6bba7be8", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz": "f40e5ba829e2e731e44fa0452433cca7ca0f41d717f45809c32804d172ee3e7f", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz": "5ca6206e9c4c7274f988026dae50774cf0b197b016d81adf15ca29816f9177fc", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-linux-musl.tar.gz": "40c913469dbe202d27fc4f3f9f8072c415d2d788d62773de486f0a429d17ac21", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-linux-musl.tar.xz": "bde66e4076b615d14e3e799604c8904d4506854e03cf5ac2be39a5839721f1a1", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-netbsd.tar.gz": "5538e8852c23f7070af754e1b19b7c685857f57cf33ed9ec9263a92bf57a14f2", - "dist/2023-12-22/rustc-nightly-x86_64-unknown-netbsd.tar.xz": "2d6558de20de87ce02de647115fee7bcce5f017baf2dc4593a1c91ae53281813", - "dist/2023-12-22/rustfmt-nightly-aarch64-apple-darwin.tar.gz": "3d5878aac23fb995cb29aeaf2579b30ce96d5f3571f53e21e20094d4cad69800", - "dist/2023-12-22/rustfmt-nightly-aarch64-apple-darwin.tar.xz": "80866c0ab8848d31a250c0904222ef0dd19ef45fd1f1a48ff381c914ef6c1ab6", - "dist/2023-12-22/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz": "4082f5613caab9091d4134dee83f5cfbe401d59a2a1b2000f28c7094584f08dc", - "dist/2023-12-22/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz": "94230b1d3582e83967306da3f869970d190fae1c22ce61fd5708f8591165d9c7", - "dist/2023-12-22/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz": "7d59a37a6fbf86c16376f593a54adcbbdf214aa8d49561fd7337d27f437e49dd", - "dist/2023-12-22/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz": "6c6be9be98fe01756c077cd3f6ef23104e681476e0a4de006223273f3f9a1fd3", - "dist/2023-12-22/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz": "706b95856289e67c29999ffa4e3afce266c017da8fc66db95695571ae4560ecc", - "dist/2023-12-22/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz": "9f768f3c40aa3f9d130c4725eff036e1503b372161f136878f4877db44e3600d", - "dist/2023-12-22/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz": "6e276261f45d28a2110d3de8ae3de4888d041c831d63960bc242e0b0b7765dd5", - "dist/2023-12-22/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz": "e9b4bfb081445a4506f10249c7441f2d0424778f3ac0fbf5b5ac3b87ba9ef66d", - "dist/2023-12-22/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz": "f1aec801b69d4b67a58ae93741ffa018d0a49943e593592139abb6b217561366", - "dist/2023-12-22/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz": "f23b01ec072adf8c29943846ff90f2a1ced0619dcf9c3d517f4cfad64d726e02", - "dist/2023-12-22/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "b61d903932f63625e4163f9a0b7e83606bfdfda4706e68d9387af62f611a32bc", - "dist/2023-12-22/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "21bbc61820a28141db13095dc778524dd4ba1981d6c66caee45b0b72f7267016", - "dist/2023-12-22/rustfmt-nightly-i686-pc-windows-gnu.tar.gz": "bf8307795424917a3975b1cf4b0b490cf80a17154d66df2a8d869d1a3291ca5e", - "dist/2023-12-22/rustfmt-nightly-i686-pc-windows-gnu.tar.xz": "b651f28f2dabc67abaf2ee7e17cac5508f400bab82f8267ef9ae2ce2399f5c5f", - "dist/2023-12-22/rustfmt-nightly-i686-pc-windows-msvc.tar.gz": "deacde8dd4f34e24d981a585061922708af11d4638733eb49dbc1087ffd901ea", - "dist/2023-12-22/rustfmt-nightly-i686-pc-windows-msvc.tar.xz": "cefc12a2fa8b66dd66265d159b3ee16cfc87a8c183d7a158e4e610fd747cecb7", - "dist/2023-12-22/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz": "4996bcacbf363fd93440ff18eaeb09081d1e9e510ddcebc5f84c2a3292d5d0fe", - "dist/2023-12-22/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz": "dd6b37586054ac9ab7714f0712e1cd833df33820fc661fa3ffa52cbcaa31073b", - "dist/2023-12-22/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz": "2fcfbc0448df994daa9a625bfc75e69054105a6c120beefa84c3843ab36dc4d7", - "dist/2023-12-22/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz": "94282e425b30fff90c9429e1f0d2aa5cc69094a147c8dd4521b30fa98eade494", - "dist/2023-12-22/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz": "25445ecbc332fd305e81075c18c27efdf2027fdb2d263f921eb716cc3ea60609", - "dist/2023-12-22/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz": "9a55fa07a1a9c3b0c31b00d9b33b0ff727046b4f322e6297ffa290e7741de015", - "dist/2023-12-22/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz": "01b05f33dbfd00aa3ae500db2204f08e5908a4833c3a26f0473bed9605003bb8", - "dist/2023-12-22/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz": "946bad6ff6d59ee175d7defcd1567b2aaf5c197bbca8985b04b91eb58f3e6277", - "dist/2023-12-22/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "bc2df359ed8ac189459139a0bcd3556484588bb053a4c2a0e1f7c8fedf39849f", - "dist/2023-12-22/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "a870d941baff83185c43bade890a8c87bfb16e0549fbc74cacfec561740a72c7", - "dist/2023-12-22/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "3fdd608ac91db883b2829f38bfbbb332ac327ab070570384d182e47f875bbecb", - "dist/2023-12-22/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "0a503de10365cc8eea4405e2db265e95d0d6a52556c95e3ca8e06735551ca0c6", - "dist/2023-12-22/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz": "82e85800015ada8c40c613eef01a4120feb60a35e069ace15d018dcd6603554b", - "dist/2023-12-22/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz": "21de46c078d31ac953cb41271b020817ef9c3cc55cde7b6b280f0425d8fc7400", - "dist/2023-12-22/rustfmt-nightly-x86_64-apple-darwin.tar.gz": "5886fcf2485728376b7fe7c6a2cf9331f4bb0cab204efe5458ab2ef816e48b5c", - "dist/2023-12-22/rustfmt-nightly-x86_64-apple-darwin.tar.xz": "6c775b5604ce3b3680d9cb6c074c97708d6804d40d44ab4d2abcaa8fd8fbc509", - "dist/2023-12-22/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz": "51bc618c6c7fa1086032655b6cf7c54b30c12ddf28949840e7695c0e65ff9f30", - "dist/2023-12-22/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz": "911b8becd12efbb1a46edaf55a383ab8c193e077aa08d1bec8c38a0168557dc2", - "dist/2023-12-22/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz": "27b84d5cfb60f11b03e26c882f20aa1e58fbba568cd6fc32f0970ab91cc9ed44", - "dist/2023-12-22/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz": "21f62ffdfd1497e5bd32cb43a9fd3c39672c429ef878e35c2019e167444afecd", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz": "1338e6d90b781578326816eda5b698ab38efa733387e1df84bb56c3ba5c9fdb4", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz": "9ce18c0e954100fedef63baceeac4a01fa0b0f810dd5175e5fe61070151c8161", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-illumos.tar.gz": "8493b82ddec3ea06c8a1b9bb8357c47164ca85856ed538c96678cbaba3361afe", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-illumos.tar.xz": "cf00b45f38ed847039f7c031e7c1a0a62cf7f00fad5acc05d47edb7e28a0e546", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz": "96480091ef8533959ba49e01922569a202c8fa2de174be553fab8478cb5c455c", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz": "c237e0c157dc09ef2c47583f34253ee92db92ead9f77fd8701ddee998acc0aee", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz": "73b731dbb70e872550e584fc4d3c67b6cbaa2d9a9a97b2ce11bcf6ab3ea5c5fa", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz": "141fe48890292de4d39547787f4ff44f672d3a5de35ed775cb80d7c3684bec73", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz": "52b2bab5830100dc4d4fc53ffcae560d7801382dcb4af19d2554e2551312fd0c", - "dist/2023-12-22/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz": "2071421241ed9e5e00fd5f877863a3a145616a8585db472b35ea902affaee4ee" + "dist/2024-02-08/cargo-1.76.0-aarch64-apple-darwin.tar.gz": "ba7039cfad5310bef8d521e3a4f1dca2f79fb0adb2ff1715c24a4d9eca2b2411", + "dist/2024-02-08/cargo-1.76.0-aarch64-apple-darwin.tar.xz": "c963d3bf8f07077b0c87922e53ebb8999c601848def13d6f60a7a102dfa2a8a5", + "dist/2024-02-08/cargo-1.76.0-aarch64-pc-windows-msvc.tar.gz": "40c7e62ba4772f49e9b855941f12133bb268f1c1f2c584c8766e6fb3b4455b8d", + "dist/2024-02-08/cargo-1.76.0-aarch64-pc-windows-msvc.tar.xz": "dcef856e957cb45b9fbbcad9070ae62dcf92ef27f02623d836285f9598613293", + "dist/2024-02-08/cargo-1.76.0-aarch64-unknown-linux-gnu.tar.gz": "0bc5824008fceb11afe19618d6484b0555353f656211956bd90eca8925e0023f", + "dist/2024-02-08/cargo-1.76.0-aarch64-unknown-linux-gnu.tar.xz": "d0c54d824e64b7313a974409541ca3a157b3ed7299865786bd0c440b0e073091", + "dist/2024-02-08/cargo-1.76.0-aarch64-unknown-linux-musl.tar.gz": "58d55995e28a4a79f99830e9ae731d54c442c65d8b3e17315d4fdaad3e66ab2f", + "dist/2024-02-08/cargo-1.76.0-aarch64-unknown-linux-musl.tar.xz": "eed24ad663649a6a8915a1b875ae1a83da3b7c7c8887f0ab2bd633ad048048f4", + "dist/2024-02-08/cargo-1.76.0-arm-unknown-linux-gnueabi.tar.gz": "05f8d47a622075f504f777e742c0cefd11536bda8276cfef1a839f780c1446d8", + "dist/2024-02-08/cargo-1.76.0-arm-unknown-linux-gnueabi.tar.xz": "7f06e56a4932815e670af1a799321474063b3788d055872971a0f90f6747dc35", + "dist/2024-02-08/cargo-1.76.0-arm-unknown-linux-gnueabihf.tar.gz": "05a2d48cf50fd84570e5d48f4f4cc3685ee5b78855248cbf3835a368cc99311e", + "dist/2024-02-08/cargo-1.76.0-arm-unknown-linux-gnueabihf.tar.xz": "427eff597f3801987959a97a1ee5d5df57c56875a7adada41b45e72b46edfb4d", + "dist/2024-02-08/cargo-1.76.0-armv7-unknown-linux-gnueabihf.tar.gz": "a9bcae087e0aba6fc1052d77840eaa5f9570d0015c68b1b23781d61e0a8fb0ee", + "dist/2024-02-08/cargo-1.76.0-armv7-unknown-linux-gnueabihf.tar.xz": "b60a643aed51f8cb8737a3669eb0c54c69a1e054838574fd9945e1d6dedc7448", + "dist/2024-02-08/cargo-1.76.0-i686-pc-windows-gnu.tar.gz": "e03f5b2f55bf2af04e176f86f52813285db057931fd7d6da218adde361079454", + "dist/2024-02-08/cargo-1.76.0-i686-pc-windows-gnu.tar.xz": "79fa88e18af5a9ea83f71c3abfe8c89d76281002dc0f3d6cdf487c1c3636bad5", + "dist/2024-02-08/cargo-1.76.0-i686-pc-windows-msvc.tar.gz": "ff37fb60f04cf1f5970e509a0b4e1fc04475348ca72c9eefad7354e0effe85c0", + "dist/2024-02-08/cargo-1.76.0-i686-pc-windows-msvc.tar.xz": "06e2ff6fed95f9d4d756da5fab4ce45485aca9737a85d5b4f2efc099f63c7966", + "dist/2024-02-08/cargo-1.76.0-i686-unknown-linux-gnu.tar.gz": "357e40c43fb350d24958368c295171fd00ccc760e7227dc2c474fdc03f1aaa92", + "dist/2024-02-08/cargo-1.76.0-i686-unknown-linux-gnu.tar.xz": "ffa9b2b65a3bd6298ffd5a2defd6ac5fa42d1a0dcefdea50b92ddf8d162db19c", + "dist/2024-02-08/cargo-1.76.0-loongarch64-unknown-linux-gnu.tar.gz": "8c670b0d05ca7194bea1c828c25dfb6b5b1a099155f3f0dc7bb913a4a91d6fbd", + "dist/2024-02-08/cargo-1.76.0-loongarch64-unknown-linux-gnu.tar.xz": "ff5ece4942139dac43bae14293602cce5bb87c700fa051eb5a6cd7b08eebeafc", + "dist/2024-02-08/cargo-1.76.0-powerpc-unknown-linux-gnu.tar.gz": "4d972c218c9b65c87255ed92490751452f5c236ed1509c14908b84d5f82cb26e", + "dist/2024-02-08/cargo-1.76.0-powerpc-unknown-linux-gnu.tar.xz": "b5c2e394fb300b480d9e15d519dba6dd40a20fda91117dc3ede721af1bac8645", + "dist/2024-02-08/cargo-1.76.0-powerpc64-unknown-linux-gnu.tar.gz": "b92bbfa4f0f057f86c7d6996a3d4e63501fe79a12e906701bb9ab864718f9279", + "dist/2024-02-08/cargo-1.76.0-powerpc64-unknown-linux-gnu.tar.xz": "dcf7e9e0b247f56759528db601eec76ff9c471457acd84c4c47e42b35ad2edd2", + "dist/2024-02-08/cargo-1.76.0-powerpc64le-unknown-linux-gnu.tar.gz": "0aa7a922868ee5099d57f0867687ebf65d6763a14d061288d7a0c0c5b083b49f", + "dist/2024-02-08/cargo-1.76.0-powerpc64le-unknown-linux-gnu.tar.xz": "c3b249f7db0fe6db2e6a52ab183cdec544ccf7fa22c27cddb039e389da85b8f7", + "dist/2024-02-08/cargo-1.76.0-riscv64gc-unknown-linux-gnu.tar.gz": "f536a8399d27b0372fb956430032437603f7976bdefe0313be398071efec40f9", + "dist/2024-02-08/cargo-1.76.0-riscv64gc-unknown-linux-gnu.tar.xz": "2799a565834247d67b7e84dda209a662aaa6fd16bbb7d46d78882de3a56b7df0", + "dist/2024-02-08/cargo-1.76.0-s390x-unknown-linux-gnu.tar.gz": "a470d339135b7a69f2c62e30607b393cbd128cae07ebfb2abf972a44a83ee491", + "dist/2024-02-08/cargo-1.76.0-s390x-unknown-linux-gnu.tar.xz": "3697dab26ed0bc98f8d536d81f7176e5162dfc3629507d942b7c7d4e7b1db928", + "dist/2024-02-08/cargo-1.76.0-x86_64-apple-darwin.tar.gz": "849d5fb21f2e55c7a5eb1133edc17dde0f9638003fbba8070a4dd13385c8e3fb", + "dist/2024-02-08/cargo-1.76.0-x86_64-apple-darwin.tar.xz": "c69b9e1167d8c67e46b6c933417af09fd8e26e2ee14c04aadad097977b3cd6a3", + "dist/2024-02-08/cargo-1.76.0-x86_64-pc-windows-gnu.tar.gz": "5baf475b83f4c758d2189c0e8340531a33efbb32a9e1d66c8283f4ce4ef0855e", + "dist/2024-02-08/cargo-1.76.0-x86_64-pc-windows-gnu.tar.xz": "512125170fc2642f574730fd504385d21a4cd8cad73a0c755290788a2047ca14", + "dist/2024-02-08/cargo-1.76.0-x86_64-pc-windows-msvc.tar.gz": "5fe7e80017c144c92b674df3c2df3a7b90d11f152ac4f4b6a7aca9ee4e94021b", + "dist/2024-02-08/cargo-1.76.0-x86_64-pc-windows-msvc.tar.xz": "87c205021437989ddceba2565c1835b9c703bba046e85e4ea3d5ccf29986bbff", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-freebsd.tar.gz": "365a45f75310dcad651c92b8a375252c31350dd7f8d88b40b2829141cd198c6d", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-freebsd.tar.xz": "61a7033aa85c3052e5a86398b6772a8dc3ea52782a1cefcde755d0181f8290ce", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-illumos.tar.gz": "0cd45732e14a421787caf02675c6bed8890842b9ecb8fda78614d8ab82d814d2", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-illumos.tar.xz": "fe7e75da1be7d2e5b9699c0f7af671e66a60b7e9e63808b4fbe48768d9561d01", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-linux-gnu.tar.gz": "7c8dd6f50fb85d0a9fa6e20dcf2ef5bf1f69b66bcfd220d1859716e1d0516163", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-linux-gnu.tar.xz": "30ec0ad9fca443ec12c544f9ce448dacdde411a45b9042961938b650e918ccfb", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-linux-musl.tar.gz": "56eb57802947659742cb64be723997156d2b3206f3d9df874d6b87919048a0c7", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-linux-musl.tar.xz": "b18032e92bbd69a9ed9036393a3d5168d3071e2d47c74cb9e2fe1737b7d106b6", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-netbsd.tar.gz": "f8fc9c05f7c42fd338e13c3b4497a88ffdfe1e7a30dda5883c2e2bc2fb783c9f", + "dist/2024-02-08/cargo-1.76.0-x86_64-unknown-netbsd.tar.xz": "c3e3ef70d648cb5f0e1b4a44c3fba70de874ed3b35051b9108377e7fc6782772", + "dist/2024-02-08/clippy-1.76.0-aarch64-apple-darwin.tar.gz": "c3dc1ac0f8bc98ea1c8bd2099b46c50beeb02fa9f33ef6477428dc5a44651956", + "dist/2024-02-08/clippy-1.76.0-aarch64-apple-darwin.tar.xz": "0545598f317696ddcb1ff94b76cd1b4499c0c0751ebdfa4f4fc5020102d796eb", + "dist/2024-02-08/clippy-1.76.0-aarch64-pc-windows-msvc.tar.gz": "9028aa512d64f484ae863482d3052e981a7c38ad5a7deddabde8efc3f7310abb", + "dist/2024-02-08/clippy-1.76.0-aarch64-pc-windows-msvc.tar.xz": "c7fbdfb0aef3c66653f4216a1072948b026c5977d6780e87a24740d51842a49f", + "dist/2024-02-08/clippy-1.76.0-aarch64-unknown-linux-gnu.tar.gz": "fb090fa8bef10deecb1acb88d00d0c99e416605299d5abb100313678990401e7", + "dist/2024-02-08/clippy-1.76.0-aarch64-unknown-linux-gnu.tar.xz": "4d9d8e392b03965b01591f16b233e91d48a597e731e0cd04dc495512dd4775e2", + "dist/2024-02-08/clippy-1.76.0-aarch64-unknown-linux-musl.tar.gz": "00931c10ecb5906dda393aa8a6e6021ffd7f9d2267d29add9bbf8793e811ff1d", + "dist/2024-02-08/clippy-1.76.0-aarch64-unknown-linux-musl.tar.xz": "2d3ad1facbe1051efef1a67ebb4e95a3c8f6640a52d1b7eaebb317cca9e67255", + "dist/2024-02-08/clippy-1.76.0-arm-unknown-linux-gnueabi.tar.gz": "29a9d177f591fa20127242b0ec4222d5b28b66662cb25a4f6607a6c4b92427cb", + "dist/2024-02-08/clippy-1.76.0-arm-unknown-linux-gnueabi.tar.xz": "d69666c060b8d7d535c4e255f9ecb9bfe519d5231bdecd6e693c465382447316", + "dist/2024-02-08/clippy-1.76.0-arm-unknown-linux-gnueabihf.tar.gz": "3a6f776f5f6acecf33605f0e9bfe3dfdd2d439e11e96157a608dd4565c6f2505", + "dist/2024-02-08/clippy-1.76.0-arm-unknown-linux-gnueabihf.tar.xz": "0bffa91857f1ddc738b797329a73cee08e13c784f3d5773048b7305d96ad336a", + "dist/2024-02-08/clippy-1.76.0-armv7-unknown-linux-gnueabihf.tar.gz": "e28867d3dbde3742b4c45229f8d18e46dfd110e816603c46e9321415f4961d0e", + "dist/2024-02-08/clippy-1.76.0-armv7-unknown-linux-gnueabihf.tar.xz": "0dd007e844b7f6a8503c919a4895d29a42093192f905125c474d3fe6d4b157f0", + "dist/2024-02-08/clippy-1.76.0-i686-pc-windows-gnu.tar.gz": "cae0a2ed242d108392571ea6ce28f7e27574c790b8f5a10e696fec933b2f0fef", + "dist/2024-02-08/clippy-1.76.0-i686-pc-windows-gnu.tar.xz": "fc53dc8a27feabb5f101424f0258f8e4af34aafbdf58b1356512c1072927fdf7", + "dist/2024-02-08/clippy-1.76.0-i686-pc-windows-msvc.tar.gz": "c5d35765717b51a832cd50b5a02faf6b49b038231853747f315f024bbb0f0cd8", + "dist/2024-02-08/clippy-1.76.0-i686-pc-windows-msvc.tar.xz": "e6a79eeb17ecfbd5c76e9f28f4869950a3047e47e34f38ce968b613b257d5466", + "dist/2024-02-08/clippy-1.76.0-i686-unknown-linux-gnu.tar.gz": "6a2e544a336fd48d165069b314e863e8669bf0fa2b49156a97b215527b1e77d1", + "dist/2024-02-08/clippy-1.76.0-i686-unknown-linux-gnu.tar.xz": "a6eb9271424ac326ef7609b1c2113916e42801ca271348708ff032490b66ac50", + "dist/2024-02-08/clippy-1.76.0-loongarch64-unknown-linux-gnu.tar.gz": "0c4d051f4c51f9131e39e3c071fbc3ac6dddb27d6b154ec23fa617009d65c487", + "dist/2024-02-08/clippy-1.76.0-loongarch64-unknown-linux-gnu.tar.xz": "ed8abd72fbbd9320573752eee465559743b94832007b3beda9b7ecbee596bf61", + "dist/2024-02-08/clippy-1.76.0-powerpc-unknown-linux-gnu.tar.gz": "7ecdc193ea55dee52383ddd43b75a8e8be568dc2f7ed259b115fcdcae9429f83", + "dist/2024-02-08/clippy-1.76.0-powerpc-unknown-linux-gnu.tar.xz": "1227f8989ae609afe0d771060262e113ead080ac863bd5c7f89a6b491d5b7025", + "dist/2024-02-08/clippy-1.76.0-powerpc64-unknown-linux-gnu.tar.gz": "9709f34b896af1279fb8ea3eac992c14d61b6ddeec6c386a97ef6be7f61196ce", + "dist/2024-02-08/clippy-1.76.0-powerpc64-unknown-linux-gnu.tar.xz": "903e30eeefd11d923412e2ddfb695126d80d5101afd1838e61d7cdca4acdad04", + "dist/2024-02-08/clippy-1.76.0-powerpc64le-unknown-linux-gnu.tar.gz": "c42c23763e4ba65b64d96610b5c4854a3e0fc2e6a97c8df237c7667c725b3db7", + "dist/2024-02-08/clippy-1.76.0-powerpc64le-unknown-linux-gnu.tar.xz": "49ed5e82d833b91a943163183f5c4cfccae92dca9b2758a846dc9f084e0a5651", + "dist/2024-02-08/clippy-1.76.0-riscv64gc-unknown-linux-gnu.tar.gz": "1e6509d306324b3e88ca08ddd37050b4a80b1c48953db95b9a8df668f824a345", + "dist/2024-02-08/clippy-1.76.0-riscv64gc-unknown-linux-gnu.tar.xz": "ea678064035f634c877bd3cc2559beb82bee10b5e2cddc2e3e37baea0ce4b472", + "dist/2024-02-08/clippy-1.76.0-s390x-unknown-linux-gnu.tar.gz": "71ada2b083b1db3444f6025064198f7237ed8be21cbde801aa8054bbd26e27ab", + "dist/2024-02-08/clippy-1.76.0-s390x-unknown-linux-gnu.tar.xz": "657521dcc91256cd023fe2c3c29d12d402f0a905dbd3713eddd5670c3fe36bb6", + "dist/2024-02-08/clippy-1.76.0-x86_64-apple-darwin.tar.gz": "a52696c72a9ab7df5f061f826446ef857fb93ad933c723542b876e501e754882", + "dist/2024-02-08/clippy-1.76.0-x86_64-apple-darwin.tar.xz": "56fdc0102911de70e6626f90f6d4828331f851db6b729450c73fb9418f81e7d6", + "dist/2024-02-08/clippy-1.76.0-x86_64-pc-windows-gnu.tar.gz": "3c98b3caa5b71123044e82f73a83d8efdfc8984c773c07756bd12484275a3653", + "dist/2024-02-08/clippy-1.76.0-x86_64-pc-windows-gnu.tar.xz": "1258b10407b324c7be1925cb74f96c1b5f697c6b88e114e204f2d666646bd20e", + "dist/2024-02-08/clippy-1.76.0-x86_64-pc-windows-msvc.tar.gz": "483e7453e512812f39f062b74ab49c06755ec7a8a1f79437e4cade7bc6c62b27", + "dist/2024-02-08/clippy-1.76.0-x86_64-pc-windows-msvc.tar.xz": "0962fe181a1359f2bee46d03a3d7d269527a821028ebae7edaf413f50291847e", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-freebsd.tar.gz": "475119e671db7fc90fcc7c4e8bd36d9dc45cca3cf4c3bab9fdc8daf7c1d6d721", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-freebsd.tar.xz": "c837892c4e7877318b07571a4fed596b4860b206d08a6b304d111745f7c4675a", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-illumos.tar.gz": "6000059b33ac8fd0035684198b41c23c907b0e451f5d11c0899a5b7280ca7b96", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-illumos.tar.xz": "5234851eb0ae8cb16234b3c1b169815bfccc8583df4157ed9342855b012c8629", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-linux-gnu.tar.gz": "52d6cc0ac9a4ef0b9c2fd75cbd7ff5c8619628481d182c627743b9c309e1a75c", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-linux-gnu.tar.xz": "0ba679a46d2b1f4e336acfbd892f50c800ba090ddc8de37fde679f9a6241ba7b", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-linux-musl.tar.gz": "6fdebbe9283d936d07b45df95af0e169687c62c5e4d974a49175cb1a360b12ab", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-linux-musl.tar.xz": "5bbd295f1eb6224826b50560ae151c2302cf7308d8adee83c5c9954d51abe301", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-netbsd.tar.gz": "9c9f7caf6de0f6182183910124babbfb42921ff9377f0ec75354b844d39a6a1f", + "dist/2024-02-08/clippy-1.76.0-x86_64-unknown-netbsd.tar.xz": "c4d67a280ef5fa35172550099c7d3f1c1ac16eb9b2fcf20a768ff28721f694cf", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-darwin.tar.gz": "094aaa4f05aed3577e19ab42c7f1d2e310efe79901339e9a0d57767353ce0ba0", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-darwin.tar.xz": "7005bce1370712e6ad29165b3ba3e39b582a46a831bc28f7350650e058d8243b", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-ios-sim.tar.gz": "0bf8ec31b70839fc1df6b95c77a16baa7722a51d34e68a6ed1f8a2dfd69e433c", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-ios-sim.tar.xz": "e5f505ba7d622efd58df8dd186dac17b8b35bd732d108d2b42f2b87960a71d4c", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-ios.tar.gz": "ab5850b92406012d52f0908d32867b8d9ee4c69a8791ddcd2f2244c5076d1701", + "dist/2024-02-08/rust-std-1.76.0-aarch64-apple-ios.tar.xz": "ad5a3a5602d6ec2d1700ec5644571165059890f7bbac21dc4a57913c19b4d8a9", + "dist/2024-02-08/rust-std-1.76.0-aarch64-linux-android.tar.gz": "0729ea1d015bbde9b8666f914a60b1f2f9e4e11976605dbfaeb27fcfd8fe32d2", + "dist/2024-02-08/rust-std-1.76.0-aarch64-linux-android.tar.xz": "7f734334da3595cb5983de192371650a8cd7c1fdd18e4681ff28e0e5315b6f65", + "dist/2024-02-08/rust-std-1.76.0-aarch64-pc-windows-msvc.tar.gz": "c768cd88b66434bc4d4451663577591cd0f2b2b299cd37826a5014db0223e8ae", + "dist/2024-02-08/rust-std-1.76.0-aarch64-pc-windows-msvc.tar.xz": "b82be4f5ac95bfbac7b61f46a90d802733d69da6c8143a7e15955b11baf4fb4e", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-fuchsia.tar.gz": "4fa7b29886d406c57a03ce5835f57e7775bfca4befe1915e97c7863a7c2860da", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-fuchsia.tar.xz": "53c8be37f82ecd8afa0a57ab1d782b60bdd15788a9d896bc1601e8bb8d600c66", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-linux-gnu.tar.gz": "f7d217f36f3dd167247f29c9bc0fc3939c69069666db915a908535d13397cd33", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-linux-gnu.tar.xz": "c0c579d9321da855109a2b6c7d7c9e01549db37e8490f058cfdc0012bef394cd", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-linux-musl.tar.gz": "bfccc644677947f2ee4e061c1f84920e794ec3e29eda6eaaf5c6ff5db8b32929", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-linux-musl.tar.xz": "97e07303f3139aa080bd8796be1b44faf8068b7cc9ad04e4021e533bc5165f13", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-none-softfloat.tar.gz": "2e3d92bd66018626316e93f7ecab8505eaadcc6f3799cba212bb1ecff3843ad4", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-none-softfloat.tar.xz": "1aa33939888616dc7bb6b5297f06af59cff23ad45e4d6b17e0cac242b5c8320b", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-none.tar.gz": "4fb28c058c3a4e8799b50adb6706f2fe77ea7a8e3d4599775f9f90243e628b3b", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-none.tar.xz": "d1986432002739a151a3a380a64b31da4d570997ab94aaf56bfa7ee1b973d781", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-uefi.tar.gz": "8454e5fdfc34a6bc1ea788b68b4d6edf2553b82fc57390239b443ec0c6ad2f5b", + "dist/2024-02-08/rust-std-1.76.0-aarch64-unknown-uefi.tar.xz": "a3c5ded644ba066adf9bd08ae881430d04936f23a5a65c746854df95f003011b", + "dist/2024-02-08/rust-std-1.76.0-arm-linux-androideabi.tar.gz": "cf25fa3086eb5728b3892353787b5c2887810d619793f6d05f13c53a1a69c5a7", + "dist/2024-02-08/rust-std-1.76.0-arm-linux-androideabi.tar.xz": "0824b25e0b665226bbb31ab26d446b0991273f14dde2dcac975d3ebd1267601e", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-gnueabi.tar.gz": "94be6d0740bdfe7b090d757c402f04bd2307a231146c800e33ee633369499d6c", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-gnueabi.tar.xz": "daa879d5984b7bbbe64eb149b26b1b1e6a409039da66acc2ec7f2822a2868b88", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-gnueabihf.tar.gz": "4d169b281b0a7d223e6789e62943372f09c79bfab26975aedbde9b5e574bd3b3", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-gnueabihf.tar.xz": "3b9a6af550679c82cf205b665962de86d067e9ccfc392c754217519dbf2bce52", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-musleabi.tar.gz": "99755811bb4409a86074e9ef9864aac9533c5435e33de37f292bbc4db20b3cd6", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-musleabi.tar.xz": "5d74df575be26e1cef68e2d631ae00c7040062b5ef7578ec34b87f7cdcbf12ab", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-musleabihf.tar.gz": "9b6d512f8385f1831275d0b6a8ffc7ff822eebf8022664d3ceac6932ad994be9", + "dist/2024-02-08/rust-std-1.76.0-arm-unknown-linux-musleabihf.tar.xz": "e25edd3aff1d13a2bfc38a1c156da165cb9004fd87db866e90ad44c6f48c7fa9", + "dist/2024-02-08/rust-std-1.76.0-armebv7r-none-eabi.tar.gz": "d9df100d5655fb1f87b45ec804d1bdb9eaac8a5885f6958cd7d5469c25d485d1", + "dist/2024-02-08/rust-std-1.76.0-armebv7r-none-eabi.tar.xz": "cf4c0be3089ef74e29b8f5eb662998de35d07057f9efed4510d220a7cd0944a3", + "dist/2024-02-08/rust-std-1.76.0-armebv7r-none-eabihf.tar.gz": "fafc73b96e37593258574199134fa9ecc251e3e88ff2b86079ddb0f6339fcecc", + "dist/2024-02-08/rust-std-1.76.0-armebv7r-none-eabihf.tar.xz": "e38792a20b8212652703664b0d3be70575544b847b8a758c37c5e6389c0bfbe2", + "dist/2024-02-08/rust-std-1.76.0-armv5te-unknown-linux-gnueabi.tar.gz": "b26682c16d5513fbfc84c838f544f0880c82eb39fbda09bd193972ba98430e65", + "dist/2024-02-08/rust-std-1.76.0-armv5te-unknown-linux-gnueabi.tar.xz": "2a540f594245443dffdc4cd2cc3bac10323d986c73fb0d00fa07ea17d65747c0", + "dist/2024-02-08/rust-std-1.76.0-armv5te-unknown-linux-musleabi.tar.gz": "632ffbae76f42fc8171564dfc781e396f349c557fdc7a293ea3e9243d551eca9", + "dist/2024-02-08/rust-std-1.76.0-armv5te-unknown-linux-musleabi.tar.xz": "d23a9a30250130fdab9770b1acc5095fc9446df42eb3616805992349f6a69512", + "dist/2024-02-08/rust-std-1.76.0-armv7-linux-androideabi.tar.gz": "3626612540fdab2f56e94a16ffc083aed528b9e8ba558777035348e9d7e3e569", + "dist/2024-02-08/rust-std-1.76.0-armv7-linux-androideabi.tar.xz": "3220dd820a29d5b0e653192bad93035bdaf5a71fb6e3edf0d81e0b33fdfd1f8c", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-gnueabi.tar.gz": "4e6a08a211fb21d6c9787636cb985d6a776aad950020cf58a094aa05ed83d0e6", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-gnueabi.tar.xz": "200598b924249e42121b02b03c9e02d5174535c984f82907d99d8d15be006a85", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-gnueabihf.tar.gz": "1c38aa0fc6e2091b40bbbe029f57173fbdf3d6ef0a511fbd36e4484cb58509a3", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-gnueabihf.tar.xz": "f5515bdb485efb39dce0ec6e53c66c0fb09303bb828f3e88a62f80eb4404356f", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-musleabi.tar.gz": "b67e7f91fb61e66470655789a6134cf312aeb8424742de1bfce0d24f20a0de02", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-musleabi.tar.xz": "b7345f98ab9a9c130f70009d6b0b20f03b1eebff7dd88468f792991c27c8873c", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-musleabihf.tar.gz": "dee1b77633e863b659d7be0219fb6226f076d1010a9ed5cf4d4910395969a4ab", + "dist/2024-02-08/rust-std-1.76.0-armv7-unknown-linux-musleabihf.tar.xz": "b422a0aa62d8f30e4fcbf344c419fc30d22a8f2d1f26e9c09011c8968e53347c", + "dist/2024-02-08/rust-std-1.76.0-armv7a-none-eabi.tar.gz": "8b7bb437018f77216f255d36e54d69aebc863c84705fe34574db93fd15619bb9", + "dist/2024-02-08/rust-std-1.76.0-armv7a-none-eabi.tar.xz": "fc4c4f913579ea29894cf8e3718be44f39b1ae9293a0bd4891021213cd44d036", + "dist/2024-02-08/rust-std-1.76.0-armv7r-none-eabi.tar.gz": "f5375a354a768b98681f51ae92553fdb1d31e7ac403de7bbd365faf3e5021f1c", + "dist/2024-02-08/rust-std-1.76.0-armv7r-none-eabi.tar.xz": "c1dfefdd5994808d8dcd7ad3c370e274b20e2d600ddb6cd9be7089443290d690", + "dist/2024-02-08/rust-std-1.76.0-armv7r-none-eabihf.tar.gz": "8081ca37359057351c25b587ca79eb987f0164f79b033d45c572345832e00913", + "dist/2024-02-08/rust-std-1.76.0-armv7r-none-eabihf.tar.xz": "a17f9593103c5354297bb8682bbf5677f3a2e1329d60bc7946d9e4ec672d8262", + "dist/2024-02-08/rust-std-1.76.0-i586-pc-windows-msvc.tar.gz": "65679641f3aa149569f4d13e39d1e005e0fdfeb38d443b5f189f217498413937", + "dist/2024-02-08/rust-std-1.76.0-i586-pc-windows-msvc.tar.xz": "a057d7e974b486618e714c767b0d6b312b1ca247ef31b15c9f3a0da3c08a00df", + "dist/2024-02-08/rust-std-1.76.0-i586-unknown-linux-gnu.tar.gz": "fb88b4856e550f4d704eb7391c05f7bab3e2b6bb50dead7d5fc7bf5a5582cf5a", + "dist/2024-02-08/rust-std-1.76.0-i586-unknown-linux-gnu.tar.xz": "d456e1b697ce63e327df44945478a276938bbd293bc564ff4ff075603e7f521d", + "dist/2024-02-08/rust-std-1.76.0-i586-unknown-linux-musl.tar.gz": "3dc201916c8be3bc62265c0b603db2dd906e0ebf98d50aeec354a38b888819f5", + "dist/2024-02-08/rust-std-1.76.0-i586-unknown-linux-musl.tar.xz": "c1880733123b8be9db833aba27886b2819564f35b1202c1916cd89c0e495429c", + "dist/2024-02-08/rust-std-1.76.0-i686-linux-android.tar.gz": "57274c62546f1ca1213d9f502ec3b921a36ff0ff7745d833f9617fa0952f96c3", + "dist/2024-02-08/rust-std-1.76.0-i686-linux-android.tar.xz": "1bd7035959958cec37680a8ddd6450da8e7b5d040a1c250c8ae060b73606d50f", + "dist/2024-02-08/rust-std-1.76.0-i686-pc-windows-gnu.tar.gz": "88effef1fee67a768cfd399f97624d3f49fab584c2e16010bccd921c8f9341db", + "dist/2024-02-08/rust-std-1.76.0-i686-pc-windows-gnu.tar.xz": "bf6993b95d2aa588df92f8c3d70a799e95f8e80f50bbcaf97783eb6bd651c4a9", + "dist/2024-02-08/rust-std-1.76.0-i686-pc-windows-msvc.tar.gz": "76f346a3b09e59e29c71ce5a600a988cab37d0978a57d2f6ed40c35c15429ebe", + "dist/2024-02-08/rust-std-1.76.0-i686-pc-windows-msvc.tar.xz": "e0c54dc011cb71889efc1cfd063d292868af1317e74aa11b9553602fdf40719a", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-freebsd.tar.gz": "c5171e81a8f12f8aedf960ba7bc1f50f1e6e4f6e0eb1fd2f408db32d48832c4c", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-freebsd.tar.xz": "840883bb983c86cb3aca2043df623628effdad6b94b7d374374ab849a088a6d1", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-linux-gnu.tar.gz": "a0ee55109224a57327ade93b4ea1c0e7e8d8c9acbe13e2986f321b932f64399d", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-linux-gnu.tar.xz": "78fb0859beb4f18af7227af3f09f0218169ca38c7751865e40d78d697ca190fc", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-linux-musl.tar.gz": "7149e9843f6a53bd6d3f0fab01ac4f2132e5bf5e5d5e424e91c6d0bf911e278c", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-linux-musl.tar.xz": "d9433a43cd9894d7bf046dde97d7c897bb8a59028d472608852c901370be804f", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-uefi.tar.gz": "66e1ba69730dcd17c1b68e9a7956baae45a1a16dede76de19d9578824c743bee", + "dist/2024-02-08/rust-std-1.76.0-i686-unknown-uefi.tar.xz": "9272f77d2ecf1135c028df48fa5a9efc281be5101a60c4b1767244b86bce2dd5", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-linux-gnu.tar.gz": "8486e3cf1581fcae275043ef716b01e619c30f7ef95f8dfef039961c4ca48068", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-linux-gnu.tar.xz": "0b96bc12af2d2477e7e6b22befbf37b759e56035414d8aa85975e3050c88dae5", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-none-softfloat.tar.gz": "2f7d89036fcaf57806508be189e5979e1b81c71cfb0c7812543a3fc2c85746f8", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-none-softfloat.tar.xz": "61a4683035d4c9e28c1cc56f145e4333645b8b3c7e5cfec5103dee450d23e45b", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-none.tar.gz": "2060d675fec71a821002ae6f74a956d32f2f15945d75dd2ea3a9cb62c1b217aa", + "dist/2024-02-08/rust-std-1.76.0-loongarch64-unknown-none.tar.xz": "f766d95ff7bd94e4433e14a22ff8ab6663485d3320aa957116b355ceb9115a5a", + "dist/2024-02-08/rust-std-1.76.0-nvptx64-nvidia-cuda.tar.gz": "ca7c01aeffa30754caa4c7c47bd4c827c761fd958cf0e32ccb54a58b025af13b", + "dist/2024-02-08/rust-std-1.76.0-nvptx64-nvidia-cuda.tar.xz": "7a1c8a76164a4bbb9eb13926bcef43b8708a1ef1573733594fbd7d026d48b1bc", + "dist/2024-02-08/rust-std-1.76.0-powerpc-unknown-linux-gnu.tar.gz": "29edf8a0cc49ce5f13868cb8ac2772bde0c5e3e7e183dd9a334d4cb203cf301d", + "dist/2024-02-08/rust-std-1.76.0-powerpc-unknown-linux-gnu.tar.xz": "773189b5fc9c2252801dd10da23dfd54577f25fcaf8f4077b4d5bc2169079653", + "dist/2024-02-08/rust-std-1.76.0-powerpc64-unknown-linux-gnu.tar.gz": "af6cfdb72e90d7d08418a470f997bf788f1e6bc517e495b480803e833d495193", + "dist/2024-02-08/rust-std-1.76.0-powerpc64-unknown-linux-gnu.tar.xz": "312699dea45a90f4f80bba87e12c410378b39c819bd089b1219101f101b49833", + "dist/2024-02-08/rust-std-1.76.0-powerpc64le-unknown-linux-gnu.tar.gz": "a30b5504847563dd2bf2193c34bdfb10fa67c452e8869e15f5273ca039d80211", + "dist/2024-02-08/rust-std-1.76.0-powerpc64le-unknown-linux-gnu.tar.xz": "939fe0ffe27b4cbec4e8f43a69e795460f507b3b57753e2644546d9d57fe7a39", + "dist/2024-02-08/rust-std-1.76.0-riscv32i-unknown-none-elf.tar.gz": "3be30a1e11889402ed7f8ddf7c626e1492119d2e2b43a5d372afebd45b160515", + "dist/2024-02-08/rust-std-1.76.0-riscv32i-unknown-none-elf.tar.xz": "c3a141287f3f09aa9064262e3b7a58d32a96d0b8e3e6755703ee0baf8170df22", + "dist/2024-02-08/rust-std-1.76.0-riscv32imac-unknown-none-elf.tar.gz": "bc501c99ce11dc1dd302146028cf125dbc8c60f7beec091d41ccd1a63b171ec5", + "dist/2024-02-08/rust-std-1.76.0-riscv32imac-unknown-none-elf.tar.xz": "8270277b2e60e73e965173dbabb5e019ec0245ee8550be3a8de967177340e36a", + "dist/2024-02-08/rust-std-1.76.0-riscv32imafc-unknown-none-elf.tar.gz": "5b8aeca4710f13f32736cf5388bca0f8d3d6b9d60ac3cd4ebe14830197ae7abb", + "dist/2024-02-08/rust-std-1.76.0-riscv32imafc-unknown-none-elf.tar.xz": "8c013f57c8e6e502f5f7fb00191449935421c6e2d88680a2c7ec441763cd0920", + "dist/2024-02-08/rust-std-1.76.0-riscv32imc-unknown-none-elf.tar.gz": "26b37163b8ca7a41bbd0ddea3f96f2cdea36acb07b801e5927d4bbeb36ad08e2", + "dist/2024-02-08/rust-std-1.76.0-riscv32imc-unknown-none-elf.tar.xz": "4ac5baa3f0401dad716c5267f78e52eb845ad0ee80854571e626b7047fe94d8e", + "dist/2024-02-08/rust-std-1.76.0-riscv64gc-unknown-linux-gnu.tar.gz": "2b4c722ad1934de8908563fb7b295d050bf5e749705b9c3dc09f729d441ea64d", + "dist/2024-02-08/rust-std-1.76.0-riscv64gc-unknown-linux-gnu.tar.xz": "ecbf009619d6704f0a8384252b41d11851dadbf0d9809ec80d77765d029883a4", + "dist/2024-02-08/rust-std-1.76.0-riscv64gc-unknown-none-elf.tar.gz": "4f121f379f2c0e4a0cb41d2c18cb3e603a624c5ab7e93d2cfff973c63990bd63", + "dist/2024-02-08/rust-std-1.76.0-riscv64gc-unknown-none-elf.tar.xz": "8d7102e2c60ccd92bb372b5bc0f09e6faeea69b22a2f3e29a37c0757f3b58bca", + "dist/2024-02-08/rust-std-1.76.0-riscv64imac-unknown-none-elf.tar.gz": "0222f3f0544985523425603ae7cb3596d174ec804026dfcd3a1a2e8c3ffe1a24", + "dist/2024-02-08/rust-std-1.76.0-riscv64imac-unknown-none-elf.tar.xz": "c94ea9e5b51f1c14a9960f4807282e40ba705c4cc306aa53858509975f7f454b", + "dist/2024-02-08/rust-std-1.76.0-s390x-unknown-linux-gnu.tar.gz": "9bec8c96cb15534a0d2a6a2fa361f66be587b3f546866d439dfdcc07e818c1f8", + "dist/2024-02-08/rust-std-1.76.0-s390x-unknown-linux-gnu.tar.xz": "e5eedfb57fe7f93c77ea91df391607ffe553349169c1b60b5d8ad040a7fd639b", + "dist/2024-02-08/rust-std-1.76.0-sparc64-unknown-linux-gnu.tar.gz": "9eaeacd1c6f7efce0b258c91cc9d6fc266d27127ae7ea7fe1421a51bf2c1702c", + "dist/2024-02-08/rust-std-1.76.0-sparc64-unknown-linux-gnu.tar.xz": "9a192c3a41d15f812346f5a36c4503937cbeffc8f05856a6747f6c880dbd8729", + "dist/2024-02-08/rust-std-1.76.0-sparcv9-sun-solaris.tar.gz": "5a5304c37bbc2ad8f9622da16e0c0d65da572dda3bd594c4860a94ef45273692", + "dist/2024-02-08/rust-std-1.76.0-sparcv9-sun-solaris.tar.xz": "56fd8421615dfe2bda10a294fa035c421557ea30cf05ad6f7ab0a2e1868cf00e", + "dist/2024-02-08/rust-std-1.76.0-thumbv6m-none-eabi.tar.gz": "7729b13bf085892eeb6e79c3197635d92a5d2a9cb68b77e079775d3d5072e77e", + "dist/2024-02-08/rust-std-1.76.0-thumbv6m-none-eabi.tar.xz": "b244bd54515a336166a8d97d7c675149418064dc0dfb4d7f66e696a1529c6adc", + "dist/2024-02-08/rust-std-1.76.0-thumbv7em-none-eabi.tar.gz": "2a8fe3925036e6348079408efad41e1efba8fcc23cb9f04ffd44c38bad523c9f", + "dist/2024-02-08/rust-std-1.76.0-thumbv7em-none-eabi.tar.xz": "4b8bc218013cb16444423536be66b1d4ce7b704568fb02d70d6a2ccab85c894b", + "dist/2024-02-08/rust-std-1.76.0-thumbv7em-none-eabihf.tar.gz": "d90dc869eadf1bc50a2f44dec6cb96b3100356bece07f837e43d3933b8614302", + "dist/2024-02-08/rust-std-1.76.0-thumbv7em-none-eabihf.tar.xz": "cf9ffd637d1ab86d4856daedf4b1839f5a98e8c3d520bc3ca6fb10d221109db3", + "dist/2024-02-08/rust-std-1.76.0-thumbv7m-none-eabi.tar.gz": "b6e6622989b1c617cc5d585606fb349ab0ba80c8bb1c97bf60b37314f67c99de", + "dist/2024-02-08/rust-std-1.76.0-thumbv7m-none-eabi.tar.xz": "9d7822d6c3988306ecadf8d9ad35f47536d1c79ccc4d48d703ccf39eee8410d1", + "dist/2024-02-08/rust-std-1.76.0-thumbv7neon-linux-androideabi.tar.gz": "c7b9fbf1f8800dafda1ae127e273960489c73974bc979c56f4b819759be77025", + "dist/2024-02-08/rust-std-1.76.0-thumbv7neon-linux-androideabi.tar.xz": "93508c230414211c22d322b617d95fb8de5ddb597327fd5a251cae175d7af719", + "dist/2024-02-08/rust-std-1.76.0-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "6bbcf66e87836bed72a5071d99c3779005be7f0ef5987792ba0be6c2b4065a60", + "dist/2024-02-08/rust-std-1.76.0-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "cb1fb03bc29aa4921831a1637d8e50f2204a005a7320fba90d7fe2486c50e5a4", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.base-none-eabi.tar.gz": "d930f194e50edede27be7b3852a07b726bbda4c2f181f4c6cfbd6e3875f03ff0", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.base-none-eabi.tar.xz": "5808805fd12962b34d007c4556e64ab4deb983e3aa2c57124cf0d141d3830fb0", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.main-none-eabi.tar.gz": "0782eaa96db3569e1af6e69c1ff3e6bba030d7ad71f23d22f6486a0972f2dd54", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.main-none-eabi.tar.xz": "18291026bde621a593b21205c87e5d89cc005cd531ea13ed0c83ae340ee91f87", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.main-none-eabihf.tar.gz": "199011e1614a88976cfd7c2985147d824e9596048a53cea798418c3a5c45c0e6", + "dist/2024-02-08/rust-std-1.76.0-thumbv8m.main-none-eabihf.tar.xz": "ac5153c97bfffc9d0fa04d197e54a7162d3361e55245ed0a1cac0459899580fb", + "dist/2024-02-08/rust-std-1.76.0-wasm32-unknown-emscripten.tar.gz": "5c1050fa5b88b387b23d2a01897a67e9490141073def1b822d671e86ebe57aa8", + "dist/2024-02-08/rust-std-1.76.0-wasm32-unknown-emscripten.tar.xz": "c12786c0fc7ad760645b1dcaf20e3b87f280c05953699a93e101086f181dba16", + "dist/2024-02-08/rust-std-1.76.0-wasm32-unknown-unknown.tar.gz": "46ed1ff62629da8a6bf921cea2e11d8b3ba9b6bc11e44e5bc0e50b7e75dbb161", + "dist/2024-02-08/rust-std-1.76.0-wasm32-unknown-unknown.tar.xz": "3cdd62eb263bcc6e68b8b2811748eeb6819f38133be29a598bdc05faa6508678", + "dist/2024-02-08/rust-std-1.76.0-wasm32-wasi-preview1-threads.tar.gz": "576a62c4b80b6cb4e33f80653f5d7a5d9229a9d3920b3aa3ef8805ce144c1a85", + "dist/2024-02-08/rust-std-1.76.0-wasm32-wasi-preview1-threads.tar.xz": "36a0b776ea2b45bcbe492344e2cea6a202fb3495ee619fa853e1246f4c07168a", + "dist/2024-02-08/rust-std-1.76.0-wasm32-wasi.tar.gz": "dcf9b203b51838361daec83bd56725bf0442a28ed9bbc20c526efc4134d0c5a3", + "dist/2024-02-08/rust-std-1.76.0-wasm32-wasi.tar.xz": "4bf5e4c73c83548795010017db41662693aff7eda551d95ae53501b287a1244b", + "dist/2024-02-08/rust-std-1.76.0-x86_64-apple-darwin.tar.gz": "0ceb5c8891a782fa8a492ca49410291cf93d643a87c3699d3945b6ea48ed1b01", + "dist/2024-02-08/rust-std-1.76.0-x86_64-apple-darwin.tar.xz": "35e0517db85be47f731e16360e8dee0c1789559bc1dcf8bf7a1ce7cdca72cede", + "dist/2024-02-08/rust-std-1.76.0-x86_64-apple-ios.tar.gz": "34bb48f42cc11870c127eb662dcb4be577541dfba576e6fcf854815e5bf37609", + "dist/2024-02-08/rust-std-1.76.0-x86_64-apple-ios.tar.xz": "049f1f973c8af33864f90f3c917cba2314ca500ff606931e72ad1d4e16dce8aa", + "dist/2024-02-08/rust-std-1.76.0-x86_64-fortanix-unknown-sgx.tar.gz": "ccc252fc9a2cdade3568bed4e8a9d08659f39dc7e9ca220ab79d15e643260111", + "dist/2024-02-08/rust-std-1.76.0-x86_64-fortanix-unknown-sgx.tar.xz": "1acaffcd9a854f5107e5a1a129ae04f70ecc93702523ab37636974b3a62139c4", + "dist/2024-02-08/rust-std-1.76.0-x86_64-linux-android.tar.gz": "7cf4110f41ad2f71cec4926bc7b9bb5a4e0d178511cdc923c3a0c2a8150930e8", + "dist/2024-02-08/rust-std-1.76.0-x86_64-linux-android.tar.xz": "a9ca7f9e5d459a347f961acf9aeb0cab9653b5b763cf95bb7ca0ebc2986d1b23", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-solaris.tar.gz": "b420e2aa77442b643607dc6e6aab1644f50d51757d8a1a8254e5f5cb9982fc38", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-solaris.tar.xz": "18e42b37dd389e238f3d0deda70d9bc08e5a7fa1becc87760241ff478ff9b5ee", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-windows-gnu.tar.gz": "c591feb8835524de4c2f0ff077b718c9eab55cecf49330074093e36ec0389244", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-windows-gnu.tar.xz": "0c033a6b0df62fee63767820145efd5d3602c0652a01f3415ac4af079835ed1f", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-windows-msvc.tar.gz": "03fa58b8e3640976de5674f4fa943361472a7bed74ac2108f3c40167489d6928", + "dist/2024-02-08/rust-std-1.76.0-x86_64-pc-windows-msvc.tar.xz": "d7f61c3d61944a9309a1ed801559c9b565b0a694e428f1734f873c7d9119134b", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-freebsd.tar.gz": "8a4f3899707f02bce32a6c2694faf039e8cffcd759e2bb625f70f583b50babc3", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-freebsd.tar.xz": "8239857289d9389651210434d5e951098937f58882b8f1e5dad01bf4a841835b", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-fuchsia.tar.gz": "79d486e55d9a9ea938917b4b797b5dc3c0dc5d2d85826ae08a90a9a8984829b3", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-fuchsia.tar.xz": "8699f020b92ff4812d752ab93f7da281a80ac263dceb12caefa4f8f96d3b52fb", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-illumos.tar.gz": "d4abfcf0f89a77299d93e58023e2ba824fcbcc3c0498b41ec71d90d04fab30ad", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-illumos.tar.xz": "f7ae49d64568691d44d219d1da1ca05effbd3f8f67e3942013577746f22f58fa", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-gnu.tar.gz": "403e78b46d0730a21d6b25fe80ec947dc0ac4807c1f0930db68a4866552d839d", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-gnu.tar.xz": "e41150b52d923a3bbe166c4ecc5719f56576274b0d034d764768aee279ae2063", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-gnux32.tar.gz": "26de79e142b1af0befd756e64056bb07e07e0e64a7cf9cc440d36f72b95c96a5", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-gnux32.tar.xz": "1d5e0886e24be68ec1a228e44e582ea90d3f9988193cac745e232549386c987e", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-musl.tar.gz": "8e198eaa1ee385f88c9e73b29e555e86cfbde623c8b5e7f7d28e2b9619d74c4a", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-linux-musl.tar.xz": "995bda2aeff09ecbda9a1892a6c47beb087e99c9be924dc8fa6416f6813f4edc", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-netbsd.tar.gz": "1f668f8f574e3ec03848f0cd92fed9b81192b34ea5c0727a304f96fe6dda1776", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-netbsd.tar.xz": "691f2de9f914b3edbe0a65633bc22b9aa94441f58d88873c13ea1986632fad4e", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-none.tar.gz": "c27e22a1be6aa09f2ffccc268b70eb093e23437dae665a62b45ecfa06a53bf68", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-none.tar.xz": "0ddb8ca7d9063d956a3036e6b825d6984cacb8c317c91c0d8d2b0748fbb065d3", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-redox.tar.gz": "58696606b3f50f729929814b5d3d04c221ebb9f8dad1c87d63bb326bbffedc17", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-redox.tar.xz": "e9c08a9c3bf57d9de73f71ec71b70c3287db7667a09077590c1a6d2c4684ce3a", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-uefi.tar.gz": "7c2fb969f13f3343ccc346c62a49403d37499a4b647c014f946730fc37230d4e", + "dist/2024-02-08/rust-std-1.76.0-x86_64-unknown-uefi.tar.xz": "76650318fde4f192e041c79298022f2d743c730921f57a8e77907e3a588f7d03", + "dist/2024-02-08/rustc-1.76.0-aarch64-apple-darwin.tar.gz": "776e43b3bbdf248c9cfce9fc4a9109149a77ce74ac0fd9f541dc14d5661b782c", + "dist/2024-02-08/rustc-1.76.0-aarch64-apple-darwin.tar.xz": "03d315b0bbd1137c50486163b30d1bbba4c5e77fa6dba3a905fc3114c36575e9", + "dist/2024-02-08/rustc-1.76.0-aarch64-pc-windows-msvc.tar.gz": "7a57f86adab6b988e9eea57200469ca5b65c19f975d57c7a74ed68a3b4611c37", + "dist/2024-02-08/rustc-1.76.0-aarch64-pc-windows-msvc.tar.xz": "a2c27f0eef7194d0c7be9d41f8abc9ba1c5e245c0d6db3b2c166da7b26699b6d", + "dist/2024-02-08/rustc-1.76.0-aarch64-unknown-linux-gnu.tar.gz": "20a9b0ac8551fbf1dabfe888887682598a337ab779feaa326d2e95aab9d1e5b8", + "dist/2024-02-08/rustc-1.76.0-aarch64-unknown-linux-gnu.tar.xz": "a299b5053d2771c24e3d5787caa0317ea729618700acacf2eeb95e345a92529c", + "dist/2024-02-08/rustc-1.76.0-aarch64-unknown-linux-musl.tar.gz": "e39c9995ddb7f1780aa43e61ea7819ed6de981db220955911ad1fda34936cad3", + "dist/2024-02-08/rustc-1.76.0-aarch64-unknown-linux-musl.tar.xz": "1b616d0bc4f6c78fdd47f7770cb1f899d23320063ddb4451d3e6ce30c389e6b6", + "dist/2024-02-08/rustc-1.76.0-arm-unknown-linux-gnueabi.tar.gz": "f990e18ef1b9329bbc2afce665a503fd3a29b9793ded6b0ccf3983a24a1db5b6", + "dist/2024-02-08/rustc-1.76.0-arm-unknown-linux-gnueabi.tar.xz": "b8500b0add940ce80bae5218f35b1c54dcf6009991046e418a98f173300e205c", + "dist/2024-02-08/rustc-1.76.0-arm-unknown-linux-gnueabihf.tar.gz": "49be48cc05fe46f3d408efc66a1e8ca2c0a64a3436d8be01401ba49ad4be7b5b", + "dist/2024-02-08/rustc-1.76.0-arm-unknown-linux-gnueabihf.tar.xz": "f398547fd5ad0e2f5904ace4eddaf74c615d0a75221b36ed2667fbb9a6324714", + "dist/2024-02-08/rustc-1.76.0-armv7-unknown-linux-gnueabihf.tar.gz": "a3b1f2d6c64b937f6d697d840c4ef9e660f65222e0b8aef3ecd4fbf87c247042", + "dist/2024-02-08/rustc-1.76.0-armv7-unknown-linux-gnueabihf.tar.xz": "4e2c65c00528d6a157b633f47f90727a61dc43a787dd34d2ea3f1d757f63dd6d", + "dist/2024-02-08/rustc-1.76.0-i686-pc-windows-gnu.tar.gz": "0881d85c03b1cea2142509907a4e2979a8bfb872cc73ef44231629a59cf10b88", + "dist/2024-02-08/rustc-1.76.0-i686-pc-windows-gnu.tar.xz": "5bd588f8aa376f4223586ff4c6cf39379a8a7e11734fa772b3b8796cc6de780d", + "dist/2024-02-08/rustc-1.76.0-i686-pc-windows-msvc.tar.gz": "c0dc8240748b21a1f0ded379c66133b2aa7ca70c5b9762d2cd3c85503f7c827f", + "dist/2024-02-08/rustc-1.76.0-i686-pc-windows-msvc.tar.xz": "5c2db6ce9e3967cd02d591915194a9b7956457a6c8ff74d36f40d4c6c796ab8c", + "dist/2024-02-08/rustc-1.76.0-i686-unknown-linux-gnu.tar.gz": "8e90b82641a4f60276ca39c31fce2c901fd1318ebe3e6095667d070b53386bb0", + "dist/2024-02-08/rustc-1.76.0-i686-unknown-linux-gnu.tar.xz": "e52ff92c605284b049e88912343a0f1c9c4cef7cc4a501d4e8f1ab9e4d9b1d7e", + "dist/2024-02-08/rustc-1.76.0-loongarch64-unknown-linux-gnu.tar.gz": "bc77ab00bdee73dda735cd8fca40f24f2622d6fde41274531b2060c454e5a1fb", + "dist/2024-02-08/rustc-1.76.0-loongarch64-unknown-linux-gnu.tar.xz": "59c8ec9441a73223873bf561f0c36719b130788a03e8e04955e3b79625a8d68c", + "dist/2024-02-08/rustc-1.76.0-powerpc-unknown-linux-gnu.tar.gz": "79617f047e3873b8ecde8235da0b0aab014906416f2a52f6d94af392e4e37b7c", + "dist/2024-02-08/rustc-1.76.0-powerpc-unknown-linux-gnu.tar.xz": "00b27ff304d5af9663778a6f6dd70a85a98fe8db877054bb4080206372faf571", + "dist/2024-02-08/rustc-1.76.0-powerpc64-unknown-linux-gnu.tar.gz": "d4feee95a68ea4579b8ec6cfd5ffcaf87da5e05b95888467ccf3ca32ed50c512", + "dist/2024-02-08/rustc-1.76.0-powerpc64-unknown-linux-gnu.tar.xz": "ab397f7ea75b18b5c5e01b878772f1c91f102a09b46c60dae5110318cb17c677", + "dist/2024-02-08/rustc-1.76.0-powerpc64le-unknown-linux-gnu.tar.gz": "e0dd96d4c57c68f167bc961699f19d0f65707ca0b0224024b65df4a734e321f8", + "dist/2024-02-08/rustc-1.76.0-powerpc64le-unknown-linux-gnu.tar.xz": "51ad28e1e646c6659110ecc8189fc519916e9317c50a05d20e4555e919751edb", + "dist/2024-02-08/rustc-1.76.0-riscv64gc-unknown-linux-gnu.tar.gz": "1a651f4a2108d71836776fa20ccac3251accaaad3c06ac74caff3dd16b8938fd", + "dist/2024-02-08/rustc-1.76.0-riscv64gc-unknown-linux-gnu.tar.xz": "f0661f1ae574947c6762b8ffd756de7e9199ff4790f1fcb9c994a3b49684a9a0", + "dist/2024-02-08/rustc-1.76.0-s390x-unknown-linux-gnu.tar.gz": "51720b449d2916888aa8dcbb4aaefbf127764b94a84d96a23ff5d21c2ffd93d5", + "dist/2024-02-08/rustc-1.76.0-s390x-unknown-linux-gnu.tar.xz": "c59a8246e5bd960b5875d8ab4e66be9d9adf376b61e99dee32a3e3e66f8197e6", + "dist/2024-02-08/rustc-1.76.0-x86_64-apple-darwin.tar.gz": "2a4574a4b5f3f262bc6961fd3f47ecfdb4df848522bb1b46fbaa20be1e952341", + "dist/2024-02-08/rustc-1.76.0-x86_64-apple-darwin.tar.xz": "7c25c4f9146b54d87c4ffbe70207b0ed848d106137cf341a29fdf6e211cd425e", + "dist/2024-02-08/rustc-1.76.0-x86_64-pc-windows-gnu.tar.gz": "6a549091907408cbe927486ec433dbebf20c66840ee527097099a4ce6fb9ca43", + "dist/2024-02-08/rustc-1.76.0-x86_64-pc-windows-gnu.tar.xz": "48587401ede6d244ce57ef2789be19c15b4dd5c42d35050a7efa49a2c2642ba3", + "dist/2024-02-08/rustc-1.76.0-x86_64-pc-windows-msvc.tar.gz": "c5306c9e3575155435f5ba4d9c2a4005206500b50afc60b577baf24df5e77518", + "dist/2024-02-08/rustc-1.76.0-x86_64-pc-windows-msvc.tar.xz": "bdea47c1fcc10533912ad75220a1a8612e53532c182207adbce9fb0a1559147f", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-freebsd.tar.gz": "3cf6a578df40c4e772416bac114831614c3c8786c64747ed09f645115d5ad3c4", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-freebsd.tar.xz": "86b4b858993e2531036174c9c3dc54050fdf4ad185aed87600dcf8130f2e3e0a", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-illumos.tar.gz": "b16aed46cd3fa89588f7e5bf9d1fc8550933eae3519d2abfad40efa34d60625f", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-illumos.tar.xz": "7af675aa0eefb4646d50cb1e986e5b3aab6e4505f75a86bafc6e3c7f22e6d9c0", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-linux-gnu.tar.gz": "529f12c8874f4d912059b5b1d012f0d67bfaa89b7669509a6a2df8512da3f124", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-linux-gnu.tar.xz": "9fadfcf71bc6a0ddfd026b9624163faf1c5689dd4a1f7cc1f857167ade4aa6eb", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-linux-musl.tar.gz": "5ce5de8de07c5699931222637348687f3fc13ac27718a3717022ba0bc0703b24", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-linux-musl.tar.xz": "3669762d7ee90d06bc3b532e15fc29e7918b40b85c93ea314b98d6cad18f435b", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-netbsd.tar.gz": "3ef659dda22760af881dcd7434cbe12b1aee7915a750b5d6ce1d2b065ea4c808", + "dist/2024-02-08/rustc-1.76.0-x86_64-unknown-netbsd.tar.xz": "6e03deb21ed463cedcc91cf670acd77a655e0634edb4ca72011c595fd91cb5e3" } } From 0e09fe125082ee6077718dc5d276691391a754d1 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 31 Jan 2024 09:43:33 -0800 Subject: [PATCH 06/42] Correct paths for hexagon-unknown-none-elf platform doc Update the library paths to correctly refer to libdemo{1,2}_hexagon and switch to the release build instead. Update references to libstandalone to the specific G0/PIC archive instead. (cherry picked from commit 647a4536572ed51e15989ab82504df99aa9cc3bc) --- .../hexagon-unknown-none-elf.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/doc/rustc/src/platform-support/hexagon-unknown-none-elf.md b/src/doc/rustc/src/platform-support/hexagon-unknown-none-elf.md index 06423f0f8fa53..3ac1d2c24603c 100644 --- a/src/doc/rustc/src/platform-support/hexagon-unknown-none-elf.md +++ b/src/doc/rustc/src/platform-support/hexagon-unknown-none-elf.md @@ -128,7 +128,8 @@ q6_arch=v65 g0_lib_path=${sdk_libs}/${q6_arch}/G0 pic_lib_path=${sdk_libs}/${q6_arch}/G0/pic -cargo build --target=hexagon-unknown-none-elf -Zbuild-std +build_cfg=release +cargo build --target=hexagon-unknown-none-elf -Zbuild-std --release # Builds an executable against "hexagon standalone OS" suitable for emulation: ${cc} --target=hexagon-unknown-none-elf -o testit \ @@ -142,12 +143,12 @@ ${cc} --target=hexagon-unknown-none-elf -o testit \ -L${sdk_libs}/${q6_arch}/ \ -L${sdk_libs}/ \ testit.c \ - target/hexagon-unknown-none-elf/debug/libmin_ex_lib_lin.rlib \ - target/hexagon-unknown-none-elf/debug/deps/libcore-*.rlib \ - target/hexagon-unknown-none-elf/debug/deps/libcompiler_builtins-*.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/libdemo1_hexagon.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/deps/libcore-*.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/deps/libcompiler_builtins-*.rlib \ -Wl,--start-group \ -Wl,--defsym,_SDA_BASE_=0,--defsym,__sbss_start=0,--defsym,__sbss_end=0 \ - -lstandalone \ + ${g0_lib_path}/libstandalone.a \ ${g0_lib_path}/libc.a \ -lgcc \ -lc_eh \ @@ -248,9 +249,9 @@ ${cc} --target=hexagon-unknown-none-elf -o testit.so \ -Wl,--wrap=memalign \ -m${q6_arch} \ testit.c \ - target/hexagon-unknown-none-elf/debug/libmin_ex_lib_lin.rlib \ - target/hexagon-unknown-none-elf/debug/deps/libcore-*.rlib \ - target/hexagon-unknown-none-elf/debug/deps/libcompiler_builtins-*.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/libdemo2_hexagon.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/deps/libcore-*.rlib \ + target/hexagon-unknown-none-elf/${build_cfg}/deps/libcompiler_builtins-*.rlib \ -Wl,-soname=testit \ ${pic_lib_path}/libc.so From 1412627f3f0ca0c037d59c28837e655514a9e510 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 31 Jan 2024 19:02:58 -0800 Subject: [PATCH 07/42] CI: Use ninja on apple builders (cherry picked from commit 2aebe6c302088dcd75ae18f40b40f6860c505450) --- .github/workflows/ci.yml | 10 +++++----- src/ci/github-actions/ci.yml | 7 +++---- src/ci/scripts/install-ninja.sh | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 346bdd41b0a40..02a2193ad883f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -319,7 +319,7 @@ jobs: - name: dist-x86_64-apple env: SCRIPT: "./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin" - RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin" + RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 SELECT_XCODE: /Applications/Xcode_13.4.1.app @@ -332,7 +332,7 @@ jobs: - name: dist-apple-various env: SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim" - RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 SELECT_XCODE: /Applications/Xcode_13.4.1.app @@ -343,7 +343,7 @@ jobs: - name: x86_64-apple-1 env: SCRIPT: "./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps" - RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 @@ -354,7 +354,7 @@ jobs: - name: x86_64-apple-2 env: SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps" - RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 @@ -365,7 +365,7 @@ jobs: - name: dist-aarch64-apple env: SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2" - RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 SELECT_XCODE: /Applications/Xcode_13.4.1.app USE_XCODE_CLANG: 1 diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index fef2245e672c9..61e0e2c0bc7f5 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -511,7 +511,7 @@ jobs: - name: dist-x86_64-apple env: SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin - RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin + RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 SELECT_XCODE: /Applications/Xcode_13.4.1.app @@ -525,7 +525,7 @@ jobs: - name: dist-apple-various env: SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim - RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false + RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 SELECT_XCODE: /Applications/Xcode_13.4.1.app @@ -537,7 +537,7 @@ jobs: - name: x86_64-apple-1 env: &env-x86_64-apple-tests SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps - RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false + RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 @@ -565,7 +565,6 @@ jobs: --enable-profiler --disable-docs --set rust.jemalloc - --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 SELECT_XCODE: /Applications/Xcode_13.4.1.app USE_XCODE_CLANG: 1 diff --git a/src/ci/scripts/install-ninja.sh b/src/ci/scripts/install-ninja.sh index b8261d8a6f284..5145a03e353de 100755 --- a/src/ci/scripts/install-ninja.sh +++ b/src/ci/scripts/install-ninja.sh @@ -13,4 +13,6 @@ if isWindows; then rm ninja.zip ciCommandSetEnv "RUST_CONFIGURE_ARGS" "${RUST_CONFIGURE_ARGS} --enable-ninja" ciCommandAddPath "$(pwd)/ninja" +elif isMacOS; then + brew install ninja fi From 53320b221ba0c032ebb077dc8c3cfbc7920b9e44 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 1 Feb 2024 14:56:41 +0100 Subject: [PATCH 08/42] Correctly check `never_type` feature gating (cherry picked from commit 2c0030ff2cb373a31d4dfa7f7cb3596739090ff3) --- compiler/rustc_ast_passes/src/feature_gate.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 82236d2e30678..409aef9185d92 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -362,6 +362,19 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } + fn visit_generic_args(&mut self, args: &'a ast::GenericArgs) { + // This check needs to happen here because the never type can be returned from a function, + // but cannot be used in any other context. If this check was in `visit_fn_ret_ty`, it + // include both functions and generics like `impl Fn() -> !`. + if let ast::GenericArgs::Parenthesized(generic_args) = args + && let ast::FnRetTy::Ty(ref ty) = generic_args.output + && matches!(ty.kind, ast::TyKind::Never) + { + gate!(&self, never_type, ty.span, "the `!` type is experimental"); + } + visit::walk_generic_args(self, args); + } + fn visit_expr(&mut self, e: &'a ast::Expr) { match e.kind { ast::ExprKind::TryBlock(_) => { From 9ae7a36e6b09c7fc055536807099a27872a153c4 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 1 Feb 2024 14:57:01 +0100 Subject: [PATCH 09/42] Update `never_type` feature gate ui test (cherry picked from commit 0f21e45e95ea879ec13a690390c9d0bd327bfe58) --- .../feature-gates/feature-gate-never_type.rs | 9 ++++++ .../feature-gate-never_type.stderr | 32 ++++++++++++++++++- .../never-type-in-nested-fn-decl.rs | 7 ++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/ui/never_type/never-type-in-nested-fn-decl.rs diff --git a/tests/ui/feature-gates/feature-gate-never_type.rs b/tests/ui/feature-gates/feature-gate-never_type.rs index be8c27dbb1b02..f5d28a4877fdf 100644 --- a/tests/ui/feature-gates/feature-gate-never_type.rs +++ b/tests/ui/feature-gates/feature-gate-never_type.rs @@ -13,5 +13,14 @@ impl Foo for Meeshka { type Wub = !; //~ ERROR type is experimental } +fn look_ma_no_feature_gate !>() {} //~ ERROR type is experimental +fn tadam(f: &dyn Fn() -> !) {} //~ ERROR type is experimental +fn panic() -> ! { + panic!(); +} +fn toudoum() -> impl Fn() -> ! { //~ ERROR type is experimental + panic +} + fn main() { } diff --git a/tests/ui/feature-gates/feature-gate-never_type.stderr b/tests/ui/feature-gates/feature-gate-never_type.stderr index 0fca58519ce13..33e4e019b18d3 100644 --- a/tests/ui/feature-gates/feature-gate-never_type.stderr +++ b/tests/ui/feature-gates/feature-gate-never_type.stderr @@ -48,6 +48,36 @@ LL | type Wub = !; = help: add `#![feature(never_type)]` 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: aborting due to 5 previous errors +error[E0658]: the `!` type is experimental + --> $DIR/feature-gate-never_type.rs:16:43 + | +LL | fn look_ma_no_feature_gate !>() {} + | ^ + | + = note: see issue #35121 for more information + = help: add `#![feature(never_type)]` 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[E0658]: the `!` type is experimental + --> $DIR/feature-gate-never_type.rs:17:26 + | +LL | fn tadam(f: &dyn Fn() -> !) {} + | ^ + | + = note: see issue #35121 for more information + = help: add `#![feature(never_type)]` 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[E0658]: the `!` type is experimental + --> $DIR/feature-gate-never_type.rs:21:30 + | +LL | fn toudoum() -> impl Fn() -> ! { + | ^ + | + = note: see issue #35121 for more information + = help: add `#![feature(never_type)]` 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: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/never_type/never-type-in-nested-fn-decl.rs b/tests/ui/never_type/never-type-in-nested-fn-decl.rs new file mode 100644 index 0000000000000..df546c4717eb6 --- /dev/null +++ b/tests/ui/never_type/never-type-in-nested-fn-decl.rs @@ -0,0 +1,7 @@ +// build-pass + +trait X {} + +fn hello ! { loop {} } 1 }>>() {} + +fn main() {} From a686e61cd826265179e3a26eca745969d9dc371f Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 1 Feb 2024 22:53:25 +0000 Subject: [PATCH 10/42] Revert unsound libcore changes of #119911 (cherry picked from commit 6ac035df442a27cf9e99ab4ec25bb6147a700902) --- library/core/src/lib.rs | 1 - library/core/src/num/int_macros.rs | 284 ++++++++-------------------- library/core/src/num/uint_macros.rs | 249 ++++++++---------------- tests/codegen/pow_of_two.rs | 55 ------ 4 files changed, 149 insertions(+), 440 deletions(-) delete mode 100644 tests/codegen/pow_of_two.rs diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 2af242d4b5071..ead8cbe0e2f43 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -200,7 +200,6 @@ // // Language features: // tidy-alphabetical-start -#![cfg_attr(not(bootstrap), feature(is_val_statically_known))] #![feature(abi_unadjusted)] #![feature(adt_const_params)] #![feature(allow_internal_unsafe)] diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index bb35b6128ea5a..d052dcc3e6ee6 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1374,59 +1374,26 @@ macro_rules! int_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn checked_pow(self, mut exp: u32) -> Option { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.unsigned_abs().is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return Some(1); - } - if self == -1 { // Avoid divide by zero - return Some(if exp & 1 != 0 { -1 } else { 1 }); - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self.wrapping_abs()) as u32 }; - if exp > Self::BITS / power_used { return None; } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - let res = unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )}; - // LLVM doesn't always optimize out the checks - // at the ir level. - - let sign = self.is_negative() && exp & 1 != 0; - if !sign && res == Self::MIN { - None - } else if sign { - Some(res.wrapping_neg()) - } else { - Some(res) - } - } else { - if exp == 0 { - return Some(1); - } - let mut base = self; - let mut acc: Self = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = try_opt!(acc.checked_mul(base)); - } - exp /= 2; - base = try_opt!(base.checked_mul(base)); + if exp == 0 { + return Some(1); + } + let mut base = self; + let mut acc: Self = 1; + + while exp > 1 { + if (exp & 1) == 1 { + acc = try_opt!(acc.checked_mul(base)); } - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - acc.checked_mul(base) + exp /= 2; + base = try_opt!(base.checked_mul(base)); } + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc.checked_mul(base) } /// Strict exponentiation. Computes `self.pow(exp)`, panicking if @@ -2091,58 +2058,27 @@ macro_rules! int_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn wrapping_pow(self, mut exp: u32) -> Self { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.unsigned_abs().is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return 1; - } - if self == -1 { // Avoid divide by zero - return if exp & 1 != 0 { -1 } else { 1 }; - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self.wrapping_abs()) as u32 }; - if exp > Self::BITS / power_used { return 0; } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - let res = unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )}; - // LLVM doesn't always optimize out the checks - // at the ir level. - - let sign = self.is_negative() && exp & 1 != 0; - if sign { - res.wrapping_neg() - } else { - res - } - } else { - if exp == 0 { - return 1; - } - let mut base = self; - let mut acc: Self = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = acc.wrapping_mul(base); - } - exp /= 2; - base = base.wrapping_mul(base); - } + if exp == 0 { + return 1; + } + let mut base = self; + let mut acc: Self = 1; - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - acc.wrapping_mul(base) + while exp > 1 { + if (exp & 1) == 1 { + acc = acc.wrapping_mul(base); + } + exp /= 2; + base = base.wrapping_mul(base); } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc.wrapping_mul(base) } /// Calculates `self` + `rhs` @@ -2625,68 +2561,36 @@ macro_rules! int_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn overflowing_pow(self, mut exp: u32) -> (Self, bool) { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.unsigned_abs().is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return (1, false); - } - if self == -1 { // Avoid divide by zero - return (if exp & 1 != 0 { -1 } else { 1 }, false); - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self.wrapping_abs()) as u32 }; - if exp > Self::BITS / power_used { return (0, true); } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - let res = unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )}; - // LLVM doesn't always optimize out the checks - // at the ir level. - - let sign = self.is_negative() && exp & 1 != 0; - let overflow = res == Self::MIN; - if sign { - (res.wrapping_neg(), overflow) - } else { - (res, overflow) - } - } else { - if exp == 0 { - return (1,false); - } - let mut base = self; - let mut acc: Self = 1; - let mut overflown = false; - // Scratch space for storing results of overflowing_mul. - let mut r; - - while exp > 1 { - if (exp & 1) == 1 { - r = acc.overflowing_mul(base); - acc = r.0; - overflown |= r.1; - } - exp /= 2; - r = base.overflowing_mul(base); - base = r.0; + if exp == 0 { + return (1,false); + } + let mut base = self; + let mut acc: Self = 1; + let mut overflown = false; + // Scratch space for storing results of overflowing_mul. + let mut r; + + while exp > 1 { + if (exp & 1) == 1 { + r = acc.overflowing_mul(base); + acc = r.0; overflown |= r.1; } - - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - r = acc.overflowing_mul(base); - r.1 |= overflown; - r + exp /= 2; + r = base.overflowing_mul(base); + base = r.0; + overflown |= r.1; } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + r = acc.overflowing_mul(base); + r.1 |= overflown; + r } /// Raises self to the power of `exp`, using exponentiation by squaring. @@ -2704,68 +2608,28 @@ macro_rules! int_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] #[rustc_inherit_overflow_checks] - #[track_caller] // Hides the hackish overflow check for powers of two. pub const fn pow(self, mut exp: u32) -> Self { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.unsigned_abs().is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return 1; - } - if self == -1 { // Avoid divide by zero - return if exp & 1 != 0 { -1 } else { 1 }; - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self.wrapping_abs()) as u32 }; - if exp > Self::BITS / power_used { // Division of constants is free - #[allow(arithmetic_overflow)] - return Self::MAX * Self::MAX * 0; - } + if exp == 0 { + return 1; + } + let mut base = self; + let mut acc = 1; - // SAFETY: exp <= Self::BITS / power_used - let res = unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )}; - // LLVM doesn't always optimize out the checks - // at the ir level. - - let sign = self.is_negative() && exp & 1 != 0; - #[allow(arithmetic_overflow)] - if !sign && res == Self::MIN { - // So it panics. - _ = Self::MAX * Self::MAX; - } - if sign { - res.wrapping_neg() - } else { - res - } - } else { - if exp == 0 { - return 1; - } - let mut base = self; - let mut acc = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = acc * base; - } - exp /= 2; - base = base * base; + while exp > 1 { + if (exp & 1) == 1 { + acc = acc * base; } - - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - acc * base + exp /= 2; + base = base * base; } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc * base } /// Returns the square root of the number, rounded down. diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index d450c68a5b230..a217c2e259d2b 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1364,49 +1364,28 @@ macro_rules! uint_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn checked_pow(self, mut exp: u32) -> Option { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return Some(1); - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self) as u32 }; - if exp > Self::BITS / power_used { return None; } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - unsafe { Some(intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )) } - // LLVM doesn't always optimize out the checks - // at the ir level. - } else { - if exp == 0 { - return Some(1); - } - let mut base = self; - let mut acc: Self = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = try_opt!(acc.checked_mul(base)); - } - exp /= 2; - base = try_opt!(base.checked_mul(base)); + if exp == 0 { + return Some(1); + } + let mut base = self; + let mut acc: Self = 1; + + while exp > 1 { + if (exp & 1) == 1 { + acc = try_opt!(acc.checked_mul(base)); } + exp /= 2; + base = try_opt!(base.checked_mul(base)); + } - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. - acc.checked_mul(base) - } + acc.checked_mul(base) } /// Strict exponentiation. Computes `self.pow(exp)`, panicking if @@ -1908,48 +1887,27 @@ macro_rules! uint_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn wrapping_pow(self, mut exp: u32) -> Self { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return 1; - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self) as u32 }; - if exp > Self::BITS / power_used { return 0; } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )} - // LLVM doesn't always optimize out the checks - // at the ir level. - } else { - if exp == 0 { - return 1; - } - let mut base = self; - let mut acc: Self = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = acc.wrapping_mul(base); - } - exp /= 2; - base = base.wrapping_mul(base); - } + if exp == 0 { + return 1; + } + let mut base = self; + let mut acc: Self = 1; - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - acc.wrapping_mul(base) + while exp > 1 { + if (exp & 1) == 1 { + acc = acc.wrapping_mul(base); + } + exp /= 2; + base = base.wrapping_mul(base); } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc.wrapping_mul(base) } /// Calculates `self` + `rhs` @@ -2383,58 +2341,37 @@ macro_rules! uint_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] pub const fn overflowing_pow(self, mut exp: u32) -> (Self, bool) { - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return (1, false); - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self) as u32 }; - if exp > Self::BITS / power_used { return (0, true); } // Division of constants is free - - // SAFETY: exp <= Self::BITS / power_used - unsafe { (intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - ), false) } - // LLVM doesn't always optimize out the checks - // at the ir level. - } else { - if exp == 0{ - return (1,false); - } - let mut base = self; - let mut acc: Self = 1; - let mut overflown = false; - // Scratch space for storing results of overflowing_mul. - let mut r; - - while exp > 1 { - if (exp & 1) == 1 { - r = acc.overflowing_mul(base); - acc = r.0; - overflown |= r.1; - } - exp /= 2; - r = base.overflowing_mul(base); - base = r.0; + if exp == 0{ + return (1,false); + } + let mut base = self; + let mut acc: Self = 1; + let mut overflown = false; + // Scratch space for storing results of overflowing_mul. + let mut r; + + while exp > 1 { + if (exp & 1) == 1 { + r = acc.overflowing_mul(base); + acc = r.0; overflown |= r.1; } + exp /= 2; + r = base.overflowing_mul(base); + base = r.0; + overflown |= r.1; + } - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - r = acc.overflowing_mul(base); - r.1 |= overflown; + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + r = acc.overflowing_mul(base); + r.1 |= overflown; - r - } + r } /// Raises self to the power of `exp`, using exponentiation by squaring. @@ -2450,64 +2387,28 @@ macro_rules! uint_impl { #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_allow_const_fn_unstable(is_val_statically_known, const_int_unchecked_arith)] #[inline] #[rustc_inherit_overflow_checks] - #[track_caller] // Hides the hackish overflow check for powers of two. pub const fn pow(self, mut exp: u32) -> Self { - // LLVM now knows that `self` is a constant value, but not a - // constant in Rust. This allows us to compute the power used at - // compile-time. - // - // This will likely add a branch in debug builds, but this should - // be ok. - // - // This is a massive performance boost in release builds as you can - // get the power of a power of two and the exponent through a `shl` - // instruction, but we must add a couple more checks for parity with - // our own `pow`. - // SAFETY: This path has the same behavior as the other. - if unsafe { intrinsics::is_val_statically_known(self) } - && self.is_power_of_two() - { - if self == 1 { // Avoid divide by zero - return 1; - } - // SAFETY: We just checked this is a power of two. and above zero. - let power_used = unsafe { intrinsics::cttz_nonzero(self) as u32 }; - if exp > Self::BITS / power_used { // Division of constants is free - #[allow(arithmetic_overflow)] - return Self::MAX * Self::MAX * 0; - } + if exp == 0 { + return 1; + } + let mut base = self; + let mut acc = 1; - // SAFETY: exp <= Self::BITS / power_used - unsafe { intrinsics::unchecked_shl( - 1 as Self, - intrinsics::unchecked_mul(power_used, exp) as Self - )} - // LLVM doesn't always optimize out the checks - // at the ir level. - } else { - if exp == 0 { - return 1; - } - let mut base = self; - let mut acc = 1; - - while exp > 1 { - if (exp & 1) == 1 { - acc = acc * base; - } - exp /= 2; - base = base * base; + while exp > 1 { + if (exp & 1) == 1 { + acc = acc * base; } - - // since exp!=0, finally the exp must be 1. - // Deal with the final bit of the exponent separately, since - // squaring the base afterwards is not necessary and may cause a - // needless overflow. - acc * base + exp /= 2; + base = base * base; } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc * base } /// Returns the square root of the number, rounded down. diff --git a/tests/codegen/pow_of_two.rs b/tests/codegen/pow_of_two.rs deleted file mode 100644 index 372360dfd12c7..0000000000000 --- a/tests/codegen/pow_of_two.rs +++ /dev/null @@ -1,55 +0,0 @@ -// compile-flags: --crate-type=lib -Zmerge-functions=disabled -O -C overflow-checks=false - -// CHECK-LABEL: @a( -#[no_mangle] -pub fn a(exp: u32) -> u64 { - // CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 64 - // CHECK: %{{[^ ]+}} = zext{{( nneg)?}} i32 %exp to i64 - // CHECK: %{{[^ ]+}} = shl nuw i64 {{[^ ]+}}, %{{[^ ]+}} - // CHECK: ret i64 %{{[^ ]+}} - 2u64.pow(exp) -} - -// CHECK-LABEL: @b( -#[no_mangle] -pub fn b(exp: u32) -> i64 { - // CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 64 - // CHECK: %{{[^ ]+}} = zext{{( nneg)?}} i32 %exp to i64 - // CHECK: %{{[^ ]+}} = shl nuw i64 {{[^ ]+}}, %{{[^ ]+}} - // CHECK: ret i64 %{{[^ ]+}} - 2i64.pow(exp) -} - -// CHECK-LABEL: @c( -#[no_mangle] -pub fn c(exp: u32) -> u32 { - // CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 16 - // CHECK: %{{[^ ]+}} = shl nuw nsw i32 %exp, 1 - // CHECK: %{{[^ ]+}} = shl nuw i32 1, %{{[^ ]+}} - // CHECK: %{{[^ ]+}} = select i1 %{{[^ ]+}}, i32 0, i32 %{{[^ ]+}} - // CHECK: ret i32 %{{[^ ]+}} - 4u32.pow(exp) -} - -// CHECK-LABEL: @d( -#[no_mangle] -pub fn d(exp: u32) -> u32 { - // CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 6 - // CHECK: %{{[^ ]+}} = mul nuw nsw i32 %exp, 5 - // CHECK: %{{[^ ]+}} = shl nuw nsw i32 1, %{{[^ ]+}} - // CHECK: %{{[^ ]+}} = select i1 {{[^ ]+}}, i32 0, i32 %{{[^ ]+}} - // CHECK: ret i32 %{{[^ ]+}} - 32u32.pow(exp) -} - -// CHECK-LABEL: @e( -#[no_mangle] -pub fn e(exp: u32) -> i32 { - // CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 6 - // CHECK: %{{[^ ]+}} = mul nuw {{(nsw )?}}i32 %exp, 5 - // CHECK: %{{[^ ]+}} = shl nuw {{(nsw )?}}i32 1, %{{[^ ]+}} - // CHECK: %{{[^ ]+}} = select i1 {{[^ ]+}}, i32 0, i32 %{{[^ ]+}} - // CHECK: ret i32 %{{[^ ]+}} - 32i32.pow(exp) -} -// note: d and e are expected to yield the same IR From 533019d96e761d1315986d7be48a6f1a4856340b Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 10 Feb 2024 20:59:20 -0800 Subject: [PATCH 11/42] Downgrade Xcode from the default (15.0) to 14.3.1. This seems to fix two sporadic errors that have been appearing in CI. One is an issue with cmake being unable to verify that cmake is able to build a simple test program. The other is a `invalid r_symbolnum` linking error when trying to build one of cranelift's tests. This is intended as a temporary fix until we can figure out how to resolve those issues. (cherry picked from commit 4fd3cf96a1db7771ef4f332b9eb1ad17fa0fd091) --- .github/workflows/ci.yml | 8 +++++--- src/ci/github-actions/ci.yml | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02a2193ad883f..236dd1d9c44e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,7 +322,7 @@ jobs: RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -335,7 +335,7 @@ jobs: RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -347,6 +347,7 @@ jobs: RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -358,6 +359,7 @@ jobs: RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -367,7 +369,7 @@ jobs: SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2" RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app USE_XCODE_CLANG: 1 MACOSX_DEPLOYMENT_TARGET: 11.0 MACOSX_STD_DEPLOYMENT_TARGET: 11.0 diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 61e0e2c0bc7f5..f2effcbd867c5 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -514,7 +514,7 @@ jobs: RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -528,7 +528,7 @@ jobs: RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -541,6 +541,7 @@ jobs: RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 MACOSX_STD_DEPLOYMENT_TARGET: 10.12 + SELECT_XCODE: /Applications/Xcode_14.3.1.app NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 @@ -566,7 +567,7 @@ jobs: --disable-docs --set rust.jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 - SELECT_XCODE: /Applications/Xcode_13.4.1.app + SELECT_XCODE: /Applications/Xcode_14.3.1.app USE_XCODE_CLANG: 1 MACOSX_DEPLOYMENT_TARGET: 11.0 MACOSX_STD_DEPLOYMENT_TARGET: 11.0 From 5df5175361a3d99804bfc45c2da06dadc65cdc94 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 10 Feb 2024 21:02:16 -0800 Subject: [PATCH 12/42] Require that SELECT_XCODE is set. Allowing the Xcode version to "float" based on whatever default GitHub selects creates an unreliable environment. When GitHub changes the default, we can have multiple jobs in the same run using different versions as it rolls out across machines. It can also cause oscillation between runs as different machines are used. It also causes unpredictable timing when the updates happen. This change helps ensure that the version that is used is pinned. The downside is that it requires manually bumping the version, and the risk that if we take too long, older Xcodes will be removed and that will break the build. (cherry picked from commit 4ce1f1cffc7c63928cac447afe8010e6daaa42d6) --- src/ci/scripts/select-xcode.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ci/scripts/select-xcode.sh b/src/ci/scripts/select-xcode.sh index 3b9c77d42ba5f..569c4a4136d97 100755 --- a/src/ci/scripts/select-xcode.sh +++ b/src/ci/scripts/select-xcode.sh @@ -7,7 +7,5 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" if isMacOS; then - if [[ -s "${SELECT_XCODE-}" ]]; then - sudo xcode-select -s "${SELECT_XCODE}" - fi + sudo xcode-select -s "${SELECT_XCODE}" fi From 131e1fc968dfff4f8d2a986b4200089a92d48dc4 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 9 Feb 2024 19:11:37 +0300 Subject: [PATCH 13/42] Update jobserver-rs to 0.1.28 (cherry picked from commit 83f3bc42714250633cacadcde8b15da28bf443f0) --- Cargo.lock | 4 ++-- compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_data_structures/src/jobserver.rs | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25f4959bf141f..2a576385c7cf7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2090,9 +2090,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 7d2f5bb193a39..c4aaf421444ec 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -9,7 +9,7 @@ ar_archive_writer = "0.1.5" bitflags = "2.4.1" cc = "1.0.69" itertools = "0.11" -jobserver = "0.1.27" +jobserver = "0.1.28" pathdiff = "0.2.0" regex = "1.4" rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 08aa68ca54a7a..0635d8552ae55 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -11,7 +11,7 @@ either = "1.0" elsa = "=1.7.1" ena = "0.14.2" indexmap = { version = "2.0.0" } -jobserver_crate = { version = "0.1.27", package = "jobserver" } +jobserver_crate = { version = "0.1.28", package = "jobserver" } libc = "0.2" measureme = "11" rustc-hash = "1.1.0" diff --git a/compiler/rustc_data_structures/src/jobserver.rs b/compiler/rustc_data_structures/src/jobserver.rs index 412e33aaa6551..89088bc5c1b87 100644 --- a/compiler/rustc_data_structures/src/jobserver.rs +++ b/compiler/rustc_data_structures/src/jobserver.rs @@ -23,7 +23,10 @@ static GLOBAL_CLIENT: LazyLock> = LazyLock::new(|| { if matches!( error.kind(), - FromEnvErrorKind::NoEnvVar | FromEnvErrorKind::NoJobserver | FromEnvErrorKind::Unsupported + FromEnvErrorKind::NoEnvVar + | FromEnvErrorKind::NoJobserver + | FromEnvErrorKind::NegativeFd + | FromEnvErrorKind::Unsupported ) { return Ok(default_client()); } From 20d17c457a180361b6c0e3d5679134aa85471e77 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 14 Feb 2024 09:42:18 +0100 Subject: [PATCH 14/42] Update LLVM submodule (cherry picked from commit 7e1897cea0718043a776dba53281f69a1e97230a) --- src/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm-project b/src/llvm-project index 700fbf978e6c5..d1e9093dbbf9a 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 700fbf978e6c5bb297d12963206f7487722de480 +Subproject commit d1e9093dbbf9a7f2e4051ff8e14a85003aa7f80b From 8336e18ead7ccd6bf5524eb35363024be0a54f1c Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Fri, 16 Feb 2024 22:59:00 -0500 Subject: [PATCH 15/42] Update cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index c8a48facdaabe..837c09f040223 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit c8a48facdaabe1d1fa8de11f90737801f38d8fa1 +Subproject commit 837c09f04022352c26cf445f37492709922b24ef From 356d024a1b5123cd1e21ad6cdd997cd812d46088 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 28 Feb 2024 22:42:11 -0500 Subject: [PATCH 16/42] [beta-1.77.0] backport cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index 837c09f040223..3fe68eabf93cb 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 837c09f04022352c26cf445f37492709922b24ef +Subproject commit 3fe68eabf93cbf3772bbcad09a9206c783e2de3f From 0656ed6afbbd190d0824d3810e8e57194109f075 Mon Sep 17 00:00:00 2001 From: Obei Sideg Date: Sat, 17 Feb 2024 22:01:56 +0300 Subject: [PATCH 17/42] Improve wording of static_mut_ref Rename `static_mut_ref` lint to `static_mut_refs`. (cherry picked from commit 408eeae59d35cbcaab2cfb345d24373954e74fc5) --- .../example/mini_core_hello_world.rs | 4 +- .../example/mini_core_hello_world.rs | 4 +- .../src/error_codes/E0796.md | 26 +++--- compiler/rustc_hir_analysis/messages.ftl | 31 ++++--- compiler/rustc_hir_analysis/src/check/errs.rs | 28 ++---- compiler/rustc_hir_analysis/src/errors.rs | 28 ++---- compiler/rustc_lint/src/lib.rs | 1 + compiler/rustc_lint_defs/src/builtin.rs | 8 +- library/panic_unwind/src/seh.rs | 8 +- library/std/src/panicking.rs | 4 +- .../sys/pal/common/thread_local/fast_local.rs | 4 +- .../pal/common/thread_local/static_local.rs | 4 +- library/std/src/thread/local.rs | 4 +- .../miri/tests/fail/tls/tls_static_dealloc.rs | 4 +- src/tools/miri/tests/pass/static_mut.rs | 4 +- src/tools/miri/tests/pass/tls/tls_static.rs | 4 +- tests/ui/abi/statics/static-mut-foreign.rs | 4 +- .../ui/abi/statics/static-mut-foreign.stderr | 22 ++--- .../borrowck/borrowck-access-permissions.rs | 2 +- .../borrowck-access-permissions.stderr | 12 +-- .../borrowck-unsafe-static-mutable-borrows.rs | 2 +- ...rowck-unsafe-static-mutable-borrows.stderr | 12 +-- tests/ui/borrowck/issue-20801.rs | 2 +- tests/ui/borrowck/issue-20801.stderr | 12 +-- ...ue-55492-borrowck-migrate-scans-parents.rs | 6 +- ...5492-borrowck-migrate-scans-parents.stderr | 32 +++---- tests/ui/consts/const_let_assign2.rs | 2 +- tests/ui/consts/const_let_assign2.stderr | 12 +-- .../ui/consts/issue-17718-const-bad-values.rs | 2 +- .../issue-17718-const-bad-values.stderr | 12 +-- ..._refers_to_static_cross_crate.32bit.stderr | 12 +-- ..._refers_to_static_cross_crate.64bit.stderr | 12 +-- .../const_refers_to_static_cross_crate.rs | 2 +- .../mutable_references_err.32bit.stderr | 70 +++++++------- .../mutable_references_err.64bit.stderr | 70 +++++++------- .../miri_unleashed/mutable_references_err.rs | 13 ++- .../consts/static_mut_containing_mut_ref.rs | 2 +- .../static_mut_containing_mut_ref.stderr | 12 +-- ...ic_mut_containing_mut_ref2.mut_refs.stderr | 12 +-- .../consts/static_mut_containing_mut_ref2.rs | 4 +- ...tatic_mut_containing_mut_ref2.stock.stderr | 12 +-- .../issue-23338-ensure-param-drop-order.rs | 2 +- ...issue-23338-ensure-param-drop-order.stderr | 12 +-- tests/ui/error-codes/E0017.rs | 2 +- tests/ui/error-codes/E0017.stderr | 12 +-- .../issues/issue-23611-enum-swap-in-drop.rs | 2 +- .../issue-23611-enum-swap-in-drop.stderr | 12 +-- ...ead-local-static-mut-borrow-outlives-fn.rs | 2 +- ...local-static-mut-borrow-outlives-fn.stderr | 12 +-- .../reference-of-mut-static-safe.e2021.stderr | 26 ------ .../reference-of-mut-static-safe.e2024.stderr | 15 --- .../reference-of-mut-static-unsafe-fn.rs | 15 +-- .../reference-of-mut-static-unsafe-fn.stderr | 70 ++++++++------ .../reference-of-mut-static.e2021.stderr | 64 ++++++------- .../reference-of-mut-static.e2024.stderr | 48 +++++----- tests/ui/static/reference-of-mut-static.rs | 26 +++--- .../reference-to-mut-static-safe.e2021.stderr | 26 ++++++ .../reference-to-mut-static-safe.e2024.stderr | 15 +++ ...afe.rs => reference-to-mut-static-safe.rs} | 4 +- .../reference-to-mut-static-unsafe-fn.rs | 26 ++++++ .../reference-to-mut-static-unsafe-fn.stderr | 75 +++++++++++++++ .../reference-to-mut-static.e2021.stderr | 91 +++++++++++++++++++ .../reference-to-mut-static.e2024.stderr | 75 +++++++++++++++ tests/ui/static/reference-to-mut-static.rs | 50 ++++++++++ tests/ui/static/safe-extern-statics-mut.rs | 4 +- .../ui/static/safe-extern-statics-mut.stderr | 22 ++--- tests/ui/statics/issue-15261.rs | 2 +- tests/ui/statics/issue-15261.stderr | 12 +-- tests/ui/statics/static-mut-xc.rs | 4 +- tests/ui/statics/static-mut-xc.stderr | 22 ++--- tests/ui/statics/static-recursive.rs | 2 +- tests/ui/statics/static-recursive.stderr | 12 +-- tests/ui/thread-local/thread-local-static.rs | 2 +- .../thread-local/thread-local-static.stderr | 12 +-- 74 files changed, 810 insertions(+), 487 deletions(-) delete mode 100644 tests/ui/static/reference-of-mut-static-safe.e2021.stderr delete mode 100644 tests/ui/static/reference-of-mut-static-safe.e2024.stderr create mode 100644 tests/ui/static/reference-to-mut-static-safe.e2021.stderr create mode 100644 tests/ui/static/reference-to-mut-static-safe.e2024.stderr rename tests/ui/static/{reference-of-mut-static-safe.rs => reference-to-mut-static-safe.rs} (62%) create mode 100644 tests/ui/static/reference-to-mut-static-unsafe-fn.rs create mode 100644 tests/ui/static/reference-to-mut-static-unsafe-fn.stderr create mode 100644 tests/ui/static/reference-to-mut-static.e2021.stderr create mode 100644 tests/ui/static/reference-to-mut-static.e2024.stderr create mode 100644 tests/ui/static/reference-to-mut-static.rs diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index 2a7b1107ffcaa..8b0b9123ac7df 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -112,8 +112,8 @@ fn start( static mut NUM: u8 = 6 * 7; -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[allow(static_mut_refs)] static NUM_REF: &'static u8 = unsafe { &NUM }; unsafe fn zeroed() -> T { diff --git a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs index 9827e299f2a31..add77880716c8 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs @@ -99,8 +99,8 @@ fn start( static mut NUM: u8 = 6 * 7; -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[allow(static_mut_refs)] static NUM_REF: &'static u8 = unsafe { &NUM }; macro_rules! assert { diff --git a/compiler/rustc_error_codes/src/error_codes/E0796.md b/compiler/rustc_error_codes/src/error_codes/E0796.md index cea18f8db851f..7ac429e521581 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0796.md +++ b/compiler/rustc_error_codes/src/error_codes/E0796.md @@ -1,22 +1,26 @@ -Reference of mutable static. +You have created a reference to a mutable static. Erroneous code example: ```compile_fail,edition2024,E0796 static mut X: i32 = 23; -static mut Y: i32 = 24; -unsafe { - let y = &X; - let ref x = X; - let (x, y) = (&X, &Y); - foo(&X); +fn work() { + let _val = unsafe { X }; } -fn foo<'a>(_x: &'a i32) {} +let x_ref = unsafe { &mut X }; +work(); +// The next line has Undefined Behavior! +// `x_ref` is a mutable reference and allows no aliases, +// but `work` has been reading the reference between +// the moment `x_ref` was created and when it was used. +// This violates the uniqueness of `x_ref`. +*x_ref = 42; ``` -Mutable statics can be written to by multiple threads: aliasing violations or -data races will cause undefined behavior. +A reference to a mutable static has lifetime `'static`. This is very dangerous +as it is easy to accidentally overlap the lifetime of that reference with +other, conflicting accesses to the same static. -Reference of mutable static is a hard error from 2024 edition. +References to mutable statics are a hard error in the 2024 edition. diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 432c9c12cbfbc..849ff3f4f8958 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -350,19 +350,24 @@ hir_analysis_start_not_target_feature = `#[start]` function is not allowed to ha hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]` .label = `#[start]` function is not allowed to be `#[track_caller]` -hir_analysis_static_mut_ref = reference of mutable static is disallowed - .label = reference of mutable static - .note = mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - .suggestion = shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer - .suggestion_mut = mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer - -hir_analysis_static_mut_ref_lint = {$shared}reference of mutable static is discouraged - .label = shared reference of mutable static - .label_mut = mutable reference of mutable static - .suggestion = shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer - .suggestion_mut = mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer - .note = reference of mutable static is a hard error from 2024 edition - .why_note = mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior +hir_analysis_static_mut_ref = creating a {$shared} reference to a mutable static + .label = {$shared} reference to mutable static + .note = {$shared -> + [shared] this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + *[mutable] this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + } + .suggestion = use `addr_of!` instead to create a raw pointer + .suggestion_mut = use `addr_of_mut!` instead to create a raw pointer + +hir_analysis_static_mut_refs_lint = creating a {$shared} reference to mutable static is discouraged + .label = {$shared} reference to mutable static + .suggestion = use `addr_of!` instead to create a raw pointer + .suggestion_mut = use `addr_of_mut!` instead to create a raw pointer + .note = this will be a hard error in the 2024 edition + .why_note = {$shared -> + [shared] this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + *[mutable] this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + } hir_analysis_static_specialize = cannot specialize on `'static` lifetime diff --git a/compiler/rustc_hir_analysis/src/check/errs.rs b/compiler/rustc_hir_analysis/src/check/errs.rs index 87a1f3d342580..4a7ace274c5bb 100644 --- a/compiler/rustc_hir_analysis/src/check/errs.rs +++ b/compiler/rustc_hir_analysis/src/check/errs.rs @@ -1,6 +1,6 @@ use rustc_hir as hir; use rustc_hir_pretty::qpath_to_string; -use rustc_lint_defs::builtin::STATIC_MUT_REF; +use rustc_lint_defs::builtin::STATIC_MUT_REFS; use rustc_middle::ty::TyCtxt; use rustc_span::Span; use rustc_type_ir::Mutability; @@ -66,32 +66,24 @@ fn handle_static_mut_ref( hir_id: hir::HirId, ) { if e2024 { - let sugg = if mutable { - errors::StaticMutRefSugg::Mut { span, var } + let (sugg, shared) = if mutable { + (errors::StaticMutRefSugg::Mut { span, var }, "mutable") } else { - errors::StaticMutRefSugg::Shared { span, var } + (errors::StaticMutRefSugg::Shared { span, var }, "shared") }; - tcx.sess.parse_sess.dcx.emit_err(errors::StaticMutRef { span, sugg }); + tcx.sess.parse_sess.dcx.emit_err(errors::StaticMutRef { span, sugg, shared }); return; } - let (label, sugg, shared) = if mutable { - ( - errors::RefOfMutStaticLabel::Mut { span }, - errors::RefOfMutStaticSugg::Mut { span, var }, - "mutable ", - ) + let (sugg, shared) = if mutable { + (errors::RefOfMutStaticSugg::Mut { span, var }, "mutable") } else { - ( - errors::RefOfMutStaticLabel::Shared { span }, - errors::RefOfMutStaticSugg::Shared { span, var }, - "shared ", - ) + (errors::RefOfMutStaticSugg::Shared { span, var }, "shared") }; tcx.emit_node_span_lint( - STATIC_MUT_REF, + STATIC_MUT_REFS, hir_id, span, - errors::RefOfMutStatic { shared, why_note: (), label, sugg }, + errors::RefOfMutStatic { span, sugg, shared }, ); } diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index e5871276d6414..5818e7e7258bb 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1414,12 +1414,13 @@ pub struct OnlyCurrentTraitsPointerSugg<'a> { #[derive(Diagnostic)] #[diag(hir_analysis_static_mut_ref, code = E0796)] #[note] -pub struct StaticMutRef { +pub struct StaticMutRef<'a> { #[primary_span] #[label] pub span: Span, #[subdiagnostic] pub sugg: StaticMutRefSugg, + pub shared: &'a str, } #[derive(Subdiagnostic)] @@ -1450,30 +1451,15 @@ pub enum StaticMutRefSugg { // STATIC_MUT_REF lint #[derive(LintDiagnostic)] -#[diag(hir_analysis_static_mut_ref_lint)] +#[diag(hir_analysis_static_mut_refs_lint)] #[note] +#[note(hir_analysis_why_note)] pub struct RefOfMutStatic<'a> { - pub shared: &'a str, - #[note(hir_analysis_why_note)] - pub why_note: (), - #[subdiagnostic] - pub label: RefOfMutStaticLabel, + #[label] + pub span: Span, #[subdiagnostic] pub sugg: RefOfMutStaticSugg, -} - -#[derive(Subdiagnostic)] -pub enum RefOfMutStaticLabel { - #[label(hir_analysis_label)] - Shared { - #[primary_span] - span: Span, - }, - #[label(hir_analysis_label_mut)] - Mut { - #[primary_span] - span: Span, - }, + pub shared: &'a str, } #[derive(Subdiagnostic)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 60b43b1625642..fd4d655dcd170 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -327,6 +327,7 @@ fn register_builtins(store: &mut LintStore) { store.register_renamed("or_patterns_back_compat", "rust_2021_incompatible_or_patterns"); store.register_renamed("non_fmt_panic", "non_fmt_panics"); store.register_renamed("unused_tuple_struct_fields", "dead_code"); + store.register_renamed("static_mut_ref", "static_mut_refs"); // These were moved to tool lints, but rustc still sees them when compiling normally, before // tool lints are registered, so `check_tool_name_for_backwards_compat` doesn't work. Use diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index e6d837ecd92bd..f209e083d2de5 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -88,7 +88,7 @@ declare_lint_pass! { SINGLE_USE_LIFETIMES, SOFT_UNSTABLE, STABLE_FEATURES, - STATIC_MUT_REF, + STATIC_MUT_REFS, SUSPICIOUS_AUTO_TRAIT_IMPLS, TEST_UNSTABLE_LINT, TEXT_DIRECTION_CODEPOINT_IN_COMMENT, @@ -1768,7 +1768,7 @@ declare_lint! { } declare_lint! { - /// The `static_mut_ref` lint checks for shared or mutable references + /// The `static_mut_refs` lint checks for shared or mutable references /// of mutable static inside `unsafe` blocks and `unsafe` functions. /// /// ### Example @@ -1806,9 +1806,9 @@ declare_lint! { /// Shared or mutable references of mutable static are almost always a mistake and /// can lead to undefined behavior and various other problems in your code. /// - /// This lint is "warn" by default on editions up to 2021, from 2024 there is + /// This lint is "warn" by default on editions up to 2021, in 2024 there is /// a hard error instead. - pub STATIC_MUT_REF, + pub STATIC_MUT_REFS, Warn, "shared references or mutable references of mutable static is discouraged", @future_incompatible = FutureIncompatibleInfo { diff --git a/library/panic_unwind/src/seh.rs b/library/panic_unwind/src/seh.rs index ccae406cc286c..5063864d498cc 100644 --- a/library/panic_unwind/src/seh.rs +++ b/library/panic_unwind/src/seh.rs @@ -261,8 +261,8 @@ cfg_if::cfg_if! { } } -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[cfg_attr(not(bootstrap), allow(static_mut_ref))] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] pub unsafe fn panic(data: Box) -> u32 { use core::intrinsics::atomic_store_seqcst; @@ -324,8 +324,8 @@ pub unsafe fn panic(data: Box) -> u32 { _CxxThrowException(throw_ptr, &mut THROW_INFO as *mut _ as *mut _); } -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[cfg_attr(not(bootstrap), allow(static_mut_ref))] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] pub unsafe fn cleanup(payload: *mut u8) -> Box { // A null payload here means that we got here from the catch (...) of // __rust_try. This happens when a non-Rust foreign exception is caught. diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index c80f15d8a611b..f5d28a9c581e4 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -337,8 +337,8 @@ pub mod panic_count { #[doc(hidden)] #[cfg(not(feature = "panic_immediate_abort"))] #[unstable(feature = "update_panic_count", issue = "none")] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[cfg_attr(not(bootstrap), allow(static_mut_ref))] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] pub mod panic_count { use crate::cell::Cell; use crate::sync::atomic::{AtomicUsize, Ordering}; diff --git a/library/std/src/sys/pal/common/thread_local/fast_local.rs b/library/std/src/sys/pal/common/thread_local/fast_local.rs index 9206588be064e..08d6546e5de39 100644 --- a/library/std/src/sys/pal/common/thread_local/fast_local.rs +++ b/library/std/src/sys/pal/common/thread_local/fast_local.rs @@ -13,8 +13,8 @@ pub macro thread_local_inner { (@key $t:ty, const $init:expr) => {{ #[inline] #[deny(unsafe_op_in_unsafe_fn)] - // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint - #[cfg_attr(not(bootstrap), allow(static_mut_ref))] + // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint + #[cfg_attr(not(bootstrap), allow(static_mut_refs))] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, ) -> $crate::option::Option<&'static $t> { diff --git a/library/std/src/sys/pal/common/thread_local/static_local.rs b/library/std/src/sys/pal/common/thread_local/static_local.rs index 51cba66fad76d..9624fac86d3eb 100644 --- a/library/std/src/sys/pal/common/thread_local/static_local.rs +++ b/library/std/src/sys/pal/common/thread_local/static_local.rs @@ -11,8 +11,8 @@ pub macro thread_local_inner { (@key $t:ty, const $init:expr) => {{ #[inline] // see comments below #[deny(unsafe_op_in_unsafe_fn)] - // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint - #[cfg_attr(not(bootstrap), allow(static_mut_ref))] + // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint + #[cfg_attr(not(bootstrap), allow(static_mut_refs))] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, ) -> $crate::option::Option<&'static $t> { diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 2e13f433dcffb..d1213e2f16686 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -180,8 +180,8 @@ impl fmt::Debug for LocalKey { #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "thread_local_macro")] #[allow_internal_unstable(thread_local_internals)] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[cfg_attr(not(bootstrap), allow(static_mut_ref))] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] macro_rules! thread_local { // empty (base case for the recursion) () => {}; diff --git a/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs index 762a8d85314f2..d47a05d8475cf 100644 --- a/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs @@ -1,8 +1,8 @@ //! Ensure that thread-local statics get deallocated when the thread dies. #![feature(thread_local)] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#![allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#![allow(static_mut_refs)] #[thread_local] static mut TLS: u8 = 0; diff --git a/src/tools/miri/tests/pass/static_mut.rs b/src/tools/miri/tests/pass/static_mut.rs index c1e58b70adb0b..6b0c0297726f3 100644 --- a/src/tools/miri/tests/pass/static_mut.rs +++ b/src/tools/miri/tests/pass/static_mut.rs @@ -1,7 +1,7 @@ static mut FOO: i32 = 42; -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[allow(static_mut_refs)] static BAR: Foo = Foo(unsafe { &FOO as *const _ }); #[allow(dead_code)] diff --git a/src/tools/miri/tests/pass/tls/tls_static.rs b/src/tools/miri/tests/pass/tls/tls_static.rs index 9be00af47aa35..fea5bb1db5e6b 100644 --- a/src/tools/miri/tests/pass/tls/tls_static.rs +++ b/src/tools/miri/tests/pass/tls/tls_static.rs @@ -8,8 +8,8 @@ //! test, we also check that thread-locals act as per-thread statics. #![feature(thread_local)] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#![allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#![allow(static_mut_refs)] use std::thread; diff --git a/tests/ui/abi/statics/static-mut-foreign.rs b/tests/ui/abi/statics/static-mut-foreign.rs index eb732e7c2c31f..5d7cf1477c1c1 100644 --- a/tests/ui/abi/statics/static-mut-foreign.rs +++ b/tests/ui/abi/statics/static-mut-foreign.rs @@ -33,9 +33,9 @@ unsafe fn run() { rust_dbg_static_mut = -3; assert_eq!(rust_dbg_static_mut, -3); static_bound(&rust_dbg_static_mut); - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] static_bound_set(&mut rust_dbg_static_mut); - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } pub fn main() { diff --git a/tests/ui/abi/statics/static-mut-foreign.stderr b/tests/ui/abi/statics/static-mut-foreign.stderr index 144ac056f87e4..f393088ff9f33 100644 --- a/tests/ui/abi/statics/static-mut-foreign.stderr +++ b/tests/ui/abi/statics/static-mut-foreign.stderr @@ -1,28 +1,28 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/static-mut-foreign.rs:35:18 | LL | static_bound(&rust_dbg_static_mut); - | ^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | static_bound(addr_of!(rust_dbg_static_mut)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/static-mut-foreign.rs:37:22 | LL | static_bound_set(&mut rust_dbg_static_mut); - | ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | static_bound_set(addr_of_mut!(rust_dbg_static_mut)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/borrowck/borrowck-access-permissions.rs b/tests/ui/borrowck/borrowck-access-permissions.rs index 1638644103ba4..be11286a523df 100644 --- a/tests/ui/borrowck/borrowck-access-permissions.rs +++ b/tests/ui/borrowck/borrowck-access-permissions.rs @@ -16,7 +16,7 @@ fn main() { let _y1 = &mut static_x; //~ ERROR [E0596] unsafe { let _y2 = &mut static_x_mut; - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } } diff --git a/tests/ui/borrowck/borrowck-access-permissions.stderr b/tests/ui/borrowck/borrowck-access-permissions.stderr index 93d92295dd9b6..11e2b63bd6cd7 100644 --- a/tests/ui/borrowck/borrowck-access-permissions.stderr +++ b/tests/ui/borrowck/borrowck-access-permissions.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/borrowck-access-permissions.rs:18:23 | LL | let _y2 = &mut static_x_mut; - | ^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | let _y2 = addr_of_mut!(static_x_mut); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs index 1bf079e24cae4..76a28f928e3c0 100644 --- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs +++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs @@ -17,7 +17,7 @@ impl Foo { fn main() { unsafe { let sfoo: *mut Foo = &mut SFOO; - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] let x = (*sfoo).x(); (*sfoo).x[1] += 1; *x += 1; diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr index 7a3824f79a4c2..354d70eb1ad49 100644 --- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr +++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/borrowck-unsafe-static-mutable-borrows.rs:19:30 | LL | let sfoo: *mut Foo = &mut SFOO; - | ^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | let sfoo: *mut Foo = addr_of_mut!(SFOO); | ~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/borrowck/issue-20801.rs b/tests/ui/borrowck/issue-20801.rs index ec83af5d5dfc6..7e3d3703dc765 100644 --- a/tests/ui/borrowck/issue-20801.rs +++ b/tests/ui/borrowck/issue-20801.rs @@ -12,7 +12,7 @@ fn imm_ref() -> &'static T { fn mut_ref() -> &'static mut T { unsafe { &mut GLOBAL_MUT_T } - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } fn mut_ptr() -> *mut T { diff --git a/tests/ui/borrowck/issue-20801.stderr b/tests/ui/borrowck/issue-20801.stderr index b2bee2d880394..97294afd3df9e 100644 --- a/tests/ui/borrowck/issue-20801.stderr +++ b/tests/ui/borrowck/issue-20801.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-20801.rs:14:14 | LL | unsafe { &mut GLOBAL_MUT_T } - | ^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | unsafe { addr_of_mut!(GLOBAL_MUT_T) } | ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs index 9b172b4131911..c3909d0596339 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs @@ -10,7 +10,7 @@ mod borrowck_closures_unique { //~^ ERROR is not declared as mutable unsafe { c1(&mut Y); - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } } } @@ -25,7 +25,7 @@ mod borrowck_closures_unique_grandparent { }; unsafe { c1(&mut Z); - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } } } @@ -62,7 +62,7 @@ fn main() { static mut X: isize = 2; unsafe { borrowck_closures_unique::e(&mut X); - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } mutability_errors::capture_assign_whole((1000,)); diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr index e4e4947fce1c1..098a2964e9fc7 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr @@ -1,42 +1,42 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:12:16 | LL | c1(&mut Y); - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | c1(addr_of_mut!(Y)); | ~~~~~~~~~~~~~~~ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:27:16 | LL | c1(&mut Z); - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | c1(addr_of_mut!(Z)); | ~~~~~~~~~~~~~~~ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:37 | LL | borrowck_closures_unique::e(&mut X); - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | borrowck_closures_unique::e(addr_of_mut!(X)); | ~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/const_let_assign2.rs b/tests/ui/consts/const_let_assign2.rs index 1c7afe0e3d6cb..f375f0f603df5 100644 --- a/tests/ui/consts/const_let_assign2.rs +++ b/tests/ui/consts/const_let_assign2.rs @@ -16,7 +16,7 @@ static mut BB: AA = AA::new(); fn main() { let ptr = unsafe { &mut BB }; - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] for a in ptr.data.iter() { println!("{}", a); } diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr index 2764153a8a590..5ae8fd353dd78 100644 --- a/tests/ui/consts/const_let_assign2.stderr +++ b/tests/ui/consts/const_let_assign2.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/const_let_assign2.rs:18:24 | LL | let ptr = unsafe { &mut BB }; - | ^^^^^^^ mutable reference of mutable static + | ^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | let ptr = unsafe { addr_of_mut!(BB) }; | ~~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs index 4fedc48452bec..ba6a082c98ef9 100644 --- a/tests/ui/consts/issue-17718-const-bad-values.rs +++ b/tests/ui/consts/issue-17718-const-bad-values.rs @@ -3,7 +3,7 @@ const C1: &'static mut [usize] = &mut []; static mut S: usize = 3; const C2: &'static mut usize = unsafe { &mut S }; -//~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] +//~^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] //~^^ ERROR: constants cannot refer to statics //~| ERROR: constants cannot refer to statics diff --git a/tests/ui/consts/issue-17718-const-bad-values.stderr b/tests/ui/consts/issue-17718-const-bad-values.stderr index 2dc91f52669e7..241780ef1437a 100644 --- a/tests/ui/consts/issue-17718-const-bad-values.stderr +++ b/tests/ui/consts/issue-17718-const-bad-values.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-17718-const-bad-values.rs:5:41 | LL | const C2: &'static mut usize = unsafe { &mut S }; - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | const C2: &'static mut usize = unsafe { addr_of_mut!(S) }; | ~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr index ed9db67542641..31a30ad7e3d99 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/const_refers_to_static_cross_crate.rs:13:14 | LL | unsafe { &static_cross_crate::ZERO } - | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | unsafe { addr_of!(static_cross_crate::ZERO) } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr index 275323bc286c0..956eaa4dd6648 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/const_refers_to_static_cross_crate.rs:13:14 | LL | unsafe { &static_cross_crate::ZERO } - | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | unsafe { addr_of!(static_cross_crate::ZERO) } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs index 3eafa58d9f9fd..6e7ec207e7240 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs @@ -11,7 +11,7 @@ const SLICE_MUT: &[u8; 1] = { //~^ ERROR undefined behavior to use this value //~| encountered a reference pointing to a static variable unsafe { &static_cross_crate::ZERO } - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs] }; const U8_MUT: &u8 = { diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr index 2df80020fdc91..5e79b9755010b 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr @@ -5,13 +5,13 @@ LL | const MUH: Meh = Meh { | ^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:27:1 + --> $DIR/mutable_references_err.rs:28:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:32:1 + --> $DIR/mutable_references_err.rs:33:1 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` @@ -22,13 +22,13 @@ LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:35:1 + --> $DIR/mutable_references_err.rs:36:1 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^^^^^^^^^^^^^^^ error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:40:1 + --> $DIR/mutable_references_err.rs:41:1 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory @@ -39,7 +39,7 @@ LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const } error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:47:1 + --> $DIR/mutable_references_err.rs:48:1 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant @@ -50,43 +50,43 @@ LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; } error[E0080]: evaluation of constant value failed - --> $DIR/mutable_references_err.rs:51:43 + --> $DIR/mutable_references_err.rs:52:43 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^^^ constant accesses static error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:55:1 + --> $DIR/mutable_references_err.rs:56:1 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:57:1 + --> $DIR/mutable_references_err.rs:58:1 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:59:1 + --> $DIR/mutable_references_err.rs:60:1 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:69:1 + --> $DIR/mutable_references_err.rs:72:1 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:71:1 + --> $DIR/mutable_references_err.rs:74:1 | -LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:73:1 + --> $DIR/mutable_references_err.rs:76:1 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -94,102 +94,102 @@ LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; warning: skipping const checks | help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:18:8 + --> $DIR/mutable_references_err.rs:19:8 | LL | x: &UnsafeCell::new(42), | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:27:27 + --> $DIR/mutable_references_err.rs:28:27 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:40 + --> $DIR/mutable_references_err.rs:33:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:40 + --> $DIR/mutable_references_err.rs:33:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:35 + --> $DIR/mutable_references_err.rs:33:35 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:35:25 + --> $DIR/mutable_references_err.rs:36:25 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:47:44 + --> $DIR/mutable_references_err.rs:48:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:47:44 + --> $DIR/mutable_references_err.rs:48:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:50:36 + --> $DIR/mutable_references_err.rs:51:36 | LL | static mut MUTABLE_REF: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:45 + --> $DIR/mutable_references_err.rs:52:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:45 + --> $DIR/mutable_references_err.rs:52:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:55:45 + --> $DIR/mutable_references_err.rs:56:45 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:57:46 + --> $DIR/mutable_references_err.rs:58:46 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:59:47 + --> $DIR/mutable_references_err.rs:60:47 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:69:51 + --> $DIR/mutable_references_err.rs:72:51 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:71:50 + --> $DIR/mutable_references_err.rs:74:49 | -LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; - | ^^^^^^^ +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; + | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:73:51 + --> $DIR/mutable_references_err.rs:76:51 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr index 3ff6811ea61fb..5a0b6af1a7b8f 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr @@ -5,13 +5,13 @@ LL | const MUH: Meh = Meh { | ^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:27:1 + --> $DIR/mutable_references_err.rs:28:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:32:1 + --> $DIR/mutable_references_err.rs:33:1 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` @@ -22,13 +22,13 @@ LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:35:1 + --> $DIR/mutable_references_err.rs:36:1 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^^^^^^^^^^^^^^^ error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:40:1 + --> $DIR/mutable_references_err.rs:41:1 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory @@ -39,7 +39,7 @@ LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const } error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:47:1 + --> $DIR/mutable_references_err.rs:48:1 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant @@ -50,43 +50,43 @@ LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; } error[E0080]: evaluation of constant value failed - --> $DIR/mutable_references_err.rs:51:43 + --> $DIR/mutable_references_err.rs:52:43 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^^^ constant accesses static error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:55:1 + --> $DIR/mutable_references_err.rs:56:1 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:57:1 + --> $DIR/mutable_references_err.rs:58:1 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:59:1 + --> $DIR/mutable_references_err.rs:60:1 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:69:1 + --> $DIR/mutable_references_err.rs:72:1 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:71:1 + --> $DIR/mutable_references_err.rs:74:1 | -LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:73:1 + --> $DIR/mutable_references_err.rs:76:1 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -94,102 +94,102 @@ LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; warning: skipping const checks | help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:18:8 + --> $DIR/mutable_references_err.rs:19:8 | LL | x: &UnsafeCell::new(42), | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:27:27 + --> $DIR/mutable_references_err.rs:28:27 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:40 + --> $DIR/mutable_references_err.rs:33:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:40 + --> $DIR/mutable_references_err.rs:33:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:32:35 + --> $DIR/mutable_references_err.rs:33:35 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:35:25 + --> $DIR/mutable_references_err.rs:36:25 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:40:49 + --> $DIR/mutable_references_err.rs:41:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:47:44 + --> $DIR/mutable_references_err.rs:48:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:47:44 + --> $DIR/mutable_references_err.rs:48:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:50:36 + --> $DIR/mutable_references_err.rs:51:36 | LL | static mut MUTABLE_REF: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:45 + --> $DIR/mutable_references_err.rs:52:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:45 + --> $DIR/mutable_references_err.rs:52:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:55:45 + --> $DIR/mutable_references_err.rs:56:45 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:57:46 + --> $DIR/mutable_references_err.rs:58:46 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:59:47 + --> $DIR/mutable_references_err.rs:60:47 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:69:51 + --> $DIR/mutable_references_err.rs:72:51 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:71:50 + --> $DIR/mutable_references_err.rs:74:49 | -LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; - | ^^^^^^^ +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; + | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:73:51 + --> $DIR/mutable_references_err.rs:76:51 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.rs b/tests/ui/consts/miri_unleashed/mutable_references_err.rs index 83a460dadd0ef..3bfb0346d6abf 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.rs +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.rs @@ -1,9 +1,9 @@ // stderr-per-bitwidth // compile-flags: -Zunleash-the-miri-inside-of-you -#![allow(invalid_reference_casting, static_mut_ref)] +#![allow(invalid_reference_casting, static_mut_refs)] -use std::sync::atomic::*; use std::cell::UnsafeCell; +use std::sync::atomic::*; // this test ensures that our mutability story is sound @@ -14,7 +14,8 @@ unsafe impl Sync for Meh {} // the following will never be ok! no interior mut behind consts, because // all allocs interned here will be marked immutable. -const MUH: Meh = Meh { //~ ERROR: mutable pointer in final value +const MUH: Meh = Meh { + //~^ ERROR encountered mutable pointer in final value of constant x: &UnsafeCell::new(42), }; @@ -59,7 +60,9 @@ const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; //~^ ERROR: mutable pointer in final value -struct SyncPtr { x : *const T } +struct SyncPtr { + x: *const T, +} unsafe impl Sync for SyncPtr {} // These pass the lifetime checks because of the "tail expression" / "outer scope" rule. @@ -68,7 +71,7 @@ unsafe impl Sync for SyncPtr {} // (Also see `static-no-inner-mut` for similar tests on `static`.) const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; //~^ ERROR mutable pointer in final value -const RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; +const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; //~^ ERROR mutable pointer in final value const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; //~^ ERROR mutable pointer in final value diff --git a/tests/ui/consts/static_mut_containing_mut_ref.rs b/tests/ui/consts/static_mut_containing_mut_ref.rs index 874aa59df0bb6..d3ddf27045119 100644 --- a/tests/ui/consts/static_mut_containing_mut_ref.rs +++ b/tests/ui/consts/static_mut_containing_mut_ref.rs @@ -3,6 +3,6 @@ static mut STDERR_BUFFER_SPACE: [u8; 42] = [0u8; 42]; pub static mut STDERR_BUFFER: *mut [u8] = unsafe { &mut STDERR_BUFFER_SPACE }; -//~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] +//~^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] fn main() {} diff --git a/tests/ui/consts/static_mut_containing_mut_ref.stderr b/tests/ui/consts/static_mut_containing_mut_ref.stderr index 56ceba41cf88c..9a768b5979b54 100644 --- a/tests/ui/consts/static_mut_containing_mut_ref.stderr +++ b/tests/ui/consts/static_mut_containing_mut_ref.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/static_mut_containing_mut_ref.rs:5:52 | LL | pub static mut STDERR_BUFFER: *mut [u8] = unsafe { &mut STDERR_BUFFER_SPACE }; - | ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | pub static mut STDERR_BUFFER: *mut [u8] = unsafe { addr_of_mut!(STDERR_BUFFER_SPACE) }; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr b/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr index bc32ecc2c35ff..0f378ba281437 100644 --- a/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr +++ b/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/static_mut_containing_mut_ref2.rs:8:6 | LL | *(&mut STDERR_BUFFER_SPACE) = 42; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | *addr_of_mut!(STDERR_BUFFER_SPACE) = 42; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.rs b/tests/ui/consts/static_mut_containing_mut_ref2.rs index fa79a78eab424..39162d6f7e5ea 100644 --- a/tests/ui/consts/static_mut_containing_mut_ref2.rs +++ b/tests/ui/consts/static_mut_containing_mut_ref2.rs @@ -8,8 +8,8 @@ pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; //[mut_refs]~^ ERROR could not evaluate static initializer //[stock]~^^ ERROR mutable references are not allowed in statics - //[mut_refs]~^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref] - //[stock]~^^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //[mut_refs]~^^^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] + //[stock]~^^^^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] }; fn main() {} diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr b/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr index e9fe82d2f87a6..6da42fa3fa17e 100644 --- a/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr +++ b/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/static_mut_containing_mut_ref2.rs:8:6 | LL | *(&mut STDERR_BUFFER_SPACE) = 42; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | *addr_of_mut!(STDERR_BUFFER_SPACE) = 42; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs index 52603744c45fc..a6796bd17df17 100644 --- a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs +++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs @@ -91,7 +91,7 @@ pub mod d { pub fn max_width() -> u32 { unsafe { (mem::size_of_val(&trails) * 8) as u32 - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] } } diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr index fd36ccbcbee47..de1194e74b40d 100644 --- a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr +++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/issue-23338-ensure-param-drop-order.rs:93:31 | LL | (mem::size_of_val(&trails) * 8) as u32 - | ^^^^^^^ shared reference of mutable static + | ^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | (mem::size_of_val(addr_of!(trails)) * 8) as u32 | ~~~~~~~~~~~~~~~~ diff --git a/tests/ui/error-codes/E0017.rs b/tests/ui/error-codes/E0017.rs index 9d3433fa543fd..1ea54baa4e515 100644 --- a/tests/ui/error-codes/E0017.rs +++ b/tests/ui/error-codes/E0017.rs @@ -13,6 +13,6 @@ static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are no //~| WARN taking a mutable static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR mutable references are not -//~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] +//~^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] fn main() {} diff --git a/tests/ui/error-codes/E0017.stderr b/tests/ui/error-codes/E0017.stderr index 2a70f2ee0ae82..f4a51dca207d9 100644 --- a/tests/ui/error-codes/E0017.stderr +++ b/tests/ui/error-codes/E0017.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/E0017.rs:15:52 | LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { addr_of_mut!(M) }; | ~~~~~~~~~~~~~~~ diff --git a/tests/ui/issues/issue-23611-enum-swap-in-drop.rs b/tests/ui/issues/issue-23611-enum-swap-in-drop.rs index b967e6aecdd43..0582ff5e80ad9 100644 --- a/tests/ui/issues/issue-23611-enum-swap-in-drop.rs +++ b/tests/ui/issues/issue-23611-enum-swap-in-drop.rs @@ -187,7 +187,7 @@ pub mod d { pub fn max_width() -> u32 { unsafe { (mem::size_of_val(&trails) * 8) as u32 - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] } } diff --git a/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr b/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr index 14a986a333264..bdf46abea8a1f 100644 --- a/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr +++ b/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/issue-23611-enum-swap-in-drop.rs:189:31 | LL | (mem::size_of_val(&trails) * 8) as u32 - | ^^^^^^^ shared reference of mutable static + | ^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | (mem::size_of_val(addr_of!(trails)) * 8) as u32 | ~~~~~~~~~~~~~~~~ diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs index 8eb544e8ab9d2..39d594b0e3227 100644 --- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs +++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs @@ -15,7 +15,7 @@ struct S1 { impl S1 { fn new(_x: u64) -> S1 { S1 { a: unsafe { &mut X1 } } - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } } diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr index 17217cd5859d0..82065cc06ea1d 100644 --- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr +++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/borrowck-thread-local-static-mut-borrow-outlives-fn.rs:17:26 | LL | S1 { a: unsafe { &mut X1 } } - | ^^^^^^^ mutable reference of mutable static + | ^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | S1 { a: unsafe { addr_of_mut!(X1) } } | ~~~~~~~~~~~~~~~~ diff --git a/tests/ui/static/reference-of-mut-static-safe.e2021.stderr b/tests/ui/static/reference-of-mut-static-safe.e2021.stderr deleted file mode 100644 index 16f47ace3a930..0000000000000 --- a/tests/ui/static/reference-of-mut-static-safe.e2021.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: shared reference of mutable static is discouraged - --> $DIR/reference-of-mut-static-safe.rs:9:14 - | -LL | let _x = &X; - | ^^ shared reference of mutable static - | - = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer - | -LL | let _x = addr_of!(X); - | ~~~~~~~~~~~ - -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/reference-of-mut-static-safe.rs:9:15 - | -LL | let _x = &X; - | ^ use of mutable static - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - -error: aborting due to 1 previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/static/reference-of-mut-static-safe.e2024.stderr b/tests/ui/static/reference-of-mut-static-safe.e2024.stderr deleted file mode 100644 index 53f81179de55a..0000000000000 --- a/tests/ui/static/reference-of-mut-static-safe.e2024.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0796]: reference of mutable static is disallowed - --> $DIR/reference-of-mut-static-safe.rs:9:14 - | -LL | let _x = &X; - | ^^ reference of mutable static - | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer - | -LL | let _x = addr_of!(X); - | ~~~~~~~~~~~ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0796`. diff --git a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs b/tests/ui/static/reference-of-mut-static-unsafe-fn.rs index 6b1e77850e50d..737fcb996af18 100644 --- a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs +++ b/tests/ui/static/reference-of-mut-static-unsafe-fn.rs @@ -7,17 +7,20 @@ unsafe fn _foo() { static mut Y: i32 = 1; let _y = &X; - //~^ ERROR reference of mutable static is disallowed + //~^ ERROR creating a shared reference to a mutable static [E0796] let ref _a = X; - //~^ ERROR reference of mutable static is disallowed + //~^ ERROR creating a shared reference to a mutable static [E0796] - let (_b, _c) = (&X, &Y); - //~^ ERROR reference of mutable static is disallowed - //~^^ ERROR reference of mutable static is disallowed + let ref mut _a = X; + //~^ ERROR creating a mutable reference to a mutable static [E0796] + + let (_b, _c) = (&X, &mut Y); + //~^ ERROR creating a shared reference to a mutable static [E0796] + //~^^ ERROR creating a mutable reference to a mutable static [E0796] foo(&X); - //~^ ERROR reference of mutable static is disallowed + //~^ ERROR creating a shared reference to a mutable static [E0796] } fn foo<'a>(_x: &'a i32) {} diff --git a/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr index 5c6fdedfa96f7..5675d313e0763 100644 --- a/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr +++ b/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr @@ -1,63 +1,75 @@ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static-unsafe-fn.rs:9:14 | LL | let _y = &X; - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let _y = addr_of!(X); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static-unsafe-fn.rs:12:18 | LL | let ref _a = X; - | ^ reference of mutable static + | ^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let ref _a = addr_of!(X); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed - --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:21 +error[E0796]: creating a mutable reference to a mutable static + --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:22 | -LL | let (_b, _c) = (&X, &Y); - | ^^ reference of mutable static +LL | let ref mut _a = X; + | ^ mutable reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | -LL | let (_b, _c) = (addr_of!(X), &Y); +LL | let ref mut _a = addr_of_mut!(X); + | ~~~~~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-of-mut-static-unsafe-fn.rs:18:21 + | +LL | let (_b, _c) = (&X, &mut Y); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (addr_of!(X), &mut Y); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed - --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:25 +error[E0796]: creating a mutable reference to a mutable static + --> $DIR/reference-of-mut-static-unsafe-fn.rs:18:25 | -LL | let (_b, _c) = (&X, &Y); - | ^^ reference of mutable static +LL | let (_b, _c) = (&X, &mut Y); + | ^^^^^^ mutable reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | -LL | let (_b, _c) = (&X, addr_of!(Y)); - | ~~~~~~~~~~~ +LL | let (_b, _c) = (&X, addr_of_mut!(Y)); + | ~~~~~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed - --> $DIR/reference-of-mut-static-unsafe-fn.rs:19:9 +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-of-mut-static-unsafe-fn.rs:22:9 | LL | foo(&X); - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | foo(addr_of!(X)); | ~~~~~~~~~~~ -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0796`. diff --git a/tests/ui/static/reference-of-mut-static.e2021.stderr b/tests/ui/static/reference-of-mut-static.e2021.stderr index 77a6b3d304bdb..f7ad51b615711 100644 --- a/tests/ui/static/reference-of-mut-static.e2021.stderr +++ b/tests/ui/static/reference-of-mut-static.e2021.stderr @@ -1,88 +1,88 @@ -error: shared reference of mutable static is discouraged +error: creating a shared reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:16:18 | LL | let _y = &X; - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior note: the lint level is defined here --> $DIR/reference-of-mut-static.rs:6:9 | -LL | #![deny(static_mut_ref)] - | ^^^^^^^^^^^^^^ -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer +LL | #![deny(static_mut_refs)] + | ^^^^^^^^^^^^^^^ +help: use `addr_of!` instead to create a raw pointer | LL | let _y = addr_of!(X); | ~~~~~~~~~~~ -error: mutable reference of mutable static is discouraged +error: creating a mutable reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:20:18 | LL | let _y = &mut X; - | ^^^^^^ mutable reference of mutable static + | ^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | let _y = addr_of_mut!(X); | ~~~~~~~~~~~~~~~ -error: shared reference of mutable static is discouraged +error: creating a shared reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:28:22 | LL | let ref _a = X; - | ^ shared reference of mutable static + | ^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let ref _a = addr_of!(X); | ~~~~~~~~~~~ -error: shared reference of mutable static is discouraged +error: creating a shared reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:32:25 | LL | let (_b, _c) = (&X, &Y); - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let (_b, _c) = (addr_of!(X), &Y); | ~~~~~~~~~~~ -error: shared reference of mutable static is discouraged +error: creating a shared reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:32:29 | LL | let (_b, _c) = (&X, &Y); - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let (_b, _c) = (&X, addr_of!(Y)); | ~~~~~~~~~~~ -error: shared reference of mutable static is discouraged +error: creating a shared reference to mutable static is discouraged --> $DIR/reference-of-mut-static.rs:38:13 | LL | foo(&X); - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | foo(addr_of!(X)); | ~~~~~~~~~~~ diff --git a/tests/ui/static/reference-of-mut-static.e2024.stderr b/tests/ui/static/reference-of-mut-static.e2024.stderr index f445ec65a5d24..6205c10ac416f 100644 --- a/tests/ui/static/reference-of-mut-static.e2024.stderr +++ b/tests/ui/static/reference-of-mut-static.e2024.stderr @@ -1,71 +1,71 @@ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static.rs:16:18 | LL | let _y = &X; - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let _y = addr_of!(X); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a mutable reference to a mutable static --> $DIR/reference-of-mut-static.rs:20:18 | LL | let _y = &mut X; - | ^^^^^^ reference of mutable static + | ^^^^^^ mutable reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | let _y = addr_of_mut!(X); | ~~~~~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static.rs:28:22 | LL | let ref _a = X; - | ^ reference of mutable static + | ^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let ref _a = addr_of!(X); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static.rs:32:25 | LL | let (_b, _c) = (&X, &Y); - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let (_b, _c) = (addr_of!(X), &Y); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static.rs:32:29 | LL | let (_b, _c) = (&X, &Y); - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let (_b, _c) = (&X, addr_of!(Y)); | ~~~~~~~~~~~ -error[E0796]: reference of mutable static is disallowed +error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-of-mut-static.rs:38:13 | LL | foo(&X); - | ^^ reference of mutable static + | ^^ shared reference to mutable static | - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | foo(addr_of!(X)); | ~~~~~~~~~~~ diff --git a/tests/ui/static/reference-of-mut-static.rs b/tests/ui/static/reference-of-mut-static.rs index 01a3b1fbd9b51..b9aecd5185a09 100644 --- a/tests/ui/static/reference-of-mut-static.rs +++ b/tests/ui/static/reference-of-mut-static.rs @@ -3,7 +3,7 @@ // [e2021] edition:2021 // [e2024] compile-flags: --edition 2024 -Z unstable-options -#![deny(static_mut_ref)] +#![deny(static_mut_refs)] use std::ptr::{addr_of, addr_of_mut}; @@ -14,30 +14,30 @@ fn main() { unsafe { let _y = &X; - //[e2024]~^ ERROR reference of mutable static is disallowed - //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref] + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] let _y = &mut X; - //[e2024]~^ ERROR reference of mutable static is disallowed - //[e2021]~^^ ERROR mutable reference of mutable static is discouraged [static_mut_ref] + //[e2024]~^ ERROR creating a mutable reference to a mutable static [E0796] + //[e2021]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs] let _z = addr_of_mut!(X); let _p = addr_of!(X); let ref _a = X; - //[e2024]~^ ERROR reference of mutable static is disallowed - //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref] + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] let (_b, _c) = (&X, &Y); - //[e2024]~^ ERROR reference of mutable static is disallowed - //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref] - //[e2024]~^^^ ERROR reference of mutable static is disallowed - //[e2021]~^^^^ ERROR shared reference of mutable static is discouraged [static_mut_ref] + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + //[e2024]~^^^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] foo(&X); - //[e2024]~^ ERROR reference of mutable static is disallowed - //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref] + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] static mut Z: &[i32; 3] = &[0, 1, 2]; diff --git a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr new file mode 100644 index 0000000000000..9ea34290e36d6 --- /dev/null +++ b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr @@ -0,0 +1,26 @@ +warning: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static-safe.rs:9:14 + | +LL | let _x = &X; + | ^^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer + | +LL | let _x = addr_of!(X); + | ~~~~~~~~~~~ + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/reference-to-mut-static-safe.rs:9:15 + | +LL | let _x = &X; + | ^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr new file mode 100644 index 0000000000000..607c1bba1352a --- /dev/null +++ b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr @@ -0,0 +1,15 @@ +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static-safe.rs:9:14 + | +LL | let _x = &X; + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let _x = addr_of!(X); + | ~~~~~~~~~~~ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0796`. diff --git a/tests/ui/static/reference-of-mut-static-safe.rs b/tests/ui/static/reference-to-mut-static-safe.rs similarity index 62% rename from tests/ui/static/reference-of-mut-static-safe.rs rename to tests/ui/static/reference-to-mut-static-safe.rs index 5cb1a03bef512..cc3ef63a2ace3 100644 --- a/tests/ui/static/reference-of-mut-static-safe.rs +++ b/tests/ui/static/reference-to-mut-static-safe.rs @@ -7,7 +7,7 @@ fn main() { static mut X: i32 = 1; let _x = &X; - //[e2024]~^ reference of mutable static is disallowed [E0796] + //[e2024]~^ creating a shared reference to a mutable static [E0796] //[e2021]~^^ use of mutable static is unsafe and requires unsafe function or block [E0133] - //[e2021]~^^^ shared reference of mutable static is discouraged [static_mut_ref] + //[e2021]~^^^ shared reference to mutable static is discouraged [static_mut_refs] } diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.rs b/tests/ui/static/reference-to-mut-static-unsafe-fn.rs new file mode 100644 index 0000000000000..737fcb996af18 --- /dev/null +++ b/tests/ui/static/reference-to-mut-static-unsafe-fn.rs @@ -0,0 +1,26 @@ +// compile-flags: --edition 2024 -Z unstable-options + +fn main() {} + +unsafe fn _foo() { + static mut X: i32 = 1; + static mut Y: i32 = 1; + + let _y = &X; + //~^ ERROR creating a shared reference to a mutable static [E0796] + + let ref _a = X; + //~^ ERROR creating a shared reference to a mutable static [E0796] + + let ref mut _a = X; + //~^ ERROR creating a mutable reference to a mutable static [E0796] + + let (_b, _c) = (&X, &mut Y); + //~^ ERROR creating a shared reference to a mutable static [E0796] + //~^^ ERROR creating a mutable reference to a mutable static [E0796] + + foo(&X); + //~^ ERROR creating a shared reference to a mutable static [E0796] +} + +fn foo<'a>(_x: &'a i32) {} diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr new file mode 100644 index 0000000000000..77d2aa5d1aec6 --- /dev/null +++ b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr @@ -0,0 +1,75 @@ +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:9:14 + | +LL | let _y = &X; + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let _y = addr_of!(X); + | ~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:12:18 + | +LL | let ref _a = X; + | ^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let ref _a = addr_of!(X); + | ~~~~~~~~~~~ + +error[E0796]: creating a mutable reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:15:22 + | +LL | let ref mut _a = X; + | ^ mutable reference to mutable static + | + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer + | +LL | let ref mut _a = addr_of_mut!(X); + | ~~~~~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:18:21 + | +LL | let (_b, _c) = (&X, &mut Y); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (addr_of!(X), &mut Y); + | ~~~~~~~~~~~ + +error[E0796]: creating a mutable reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:18:25 + | +LL | let (_b, _c) = (&X, &mut Y); + | ^^^^^^ mutable reference to mutable static + | + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer + | +LL | let (_b, _c) = (&X, addr_of_mut!(Y)); + | ~~~~~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static-unsafe-fn.rs:22:9 + | +LL | foo(&X); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | foo(addr_of!(X)); + | ~~~~~~~~~~~ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0796`. diff --git a/tests/ui/static/reference-to-mut-static.e2021.stderr b/tests/ui/static/reference-to-mut-static.e2021.stderr new file mode 100644 index 0000000000000..f477e5ac6c5c2 --- /dev/null +++ b/tests/ui/static/reference-to-mut-static.e2021.stderr @@ -0,0 +1,91 @@ +error: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:16:18 + | +LL | let _y = &X; + | ^^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +note: the lint level is defined here + --> $DIR/reference-to-mut-static.rs:6:9 + | +LL | #![deny(static_mut_refs)] + | ^^^^^^^^^^^^^^^ +help: use `addr_of!` instead to create a raw pointer + | +LL | let _y = addr_of!(X); + | ~~~~~~~~~~~ + +error: creating a mutable reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:20:18 + | +LL | let _y = &mut X; + | ^^^^^^ mutable reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer + | +LL | let _y = addr_of_mut!(X); + | ~~~~~~~~~~~~~~~ + +error: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:28:22 + | +LL | let ref _a = X; + | ^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let ref _a = addr_of!(X); + | ~~~~~~~~~~~ + +error: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:32:25 + | +LL | let (_b, _c) = (&X, &Y); + | ^^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (addr_of!(X), &Y); + | ~~~~~~~~~~~ + +error: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:32:29 + | +LL | let (_b, _c) = (&X, &Y); + | ^^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (&X, addr_of!(Y)); + | ~~~~~~~~~~~ + +error: creating a shared reference to mutable static is discouraged + --> $DIR/reference-to-mut-static.rs:38:13 + | +LL | foo(&X); + | ^^ shared reference to mutable static + | + = note: for more information, see issue #114447 + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | foo(addr_of!(X)); + | ~~~~~~~~~~~ + +error: aborting due to 6 previous errors + diff --git a/tests/ui/static/reference-to-mut-static.e2024.stderr b/tests/ui/static/reference-to-mut-static.e2024.stderr new file mode 100644 index 0000000000000..b18e214e84fea --- /dev/null +++ b/tests/ui/static/reference-to-mut-static.e2024.stderr @@ -0,0 +1,75 @@ +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static.rs:16:18 + | +LL | let _y = &X; + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let _y = addr_of!(X); + | ~~~~~~~~~~~ + +error[E0796]: creating a mutable reference to a mutable static + --> $DIR/reference-to-mut-static.rs:20:18 + | +LL | let _y = &mut X; + | ^^^^^^ mutable reference to mutable static + | + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer + | +LL | let _y = addr_of_mut!(X); + | ~~~~~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static.rs:28:22 + | +LL | let ref _a = X; + | ^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let ref _a = addr_of!(X); + | ~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static.rs:32:25 + | +LL | let (_b, _c) = (&X, &Y); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (addr_of!(X), &Y); + | ~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static.rs:32:29 + | +LL | let (_b, _c) = (&X, &Y); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | let (_b, _c) = (&X, addr_of!(Y)); + | ~~~~~~~~~~~ + +error[E0796]: creating a shared reference to a mutable static + --> $DIR/reference-to-mut-static.rs:38:13 + | +LL | foo(&X); + | ^^ shared reference to mutable static + | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer + | +LL | foo(addr_of!(X)); + | ~~~~~~~~~~~ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0796`. diff --git a/tests/ui/static/reference-to-mut-static.rs b/tests/ui/static/reference-to-mut-static.rs new file mode 100644 index 0000000000000..b9aecd5185a09 --- /dev/null +++ b/tests/ui/static/reference-to-mut-static.rs @@ -0,0 +1,50 @@ +// revisions: e2021 e2024 + +// [e2021] edition:2021 +// [e2024] compile-flags: --edition 2024 -Z unstable-options + +#![deny(static_mut_refs)] + +use std::ptr::{addr_of, addr_of_mut}; + +fn main() { + static mut X: i32 = 1; + + static mut Y: i32 = 1; + + unsafe { + let _y = &X; + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + + let _y = &mut X; + //[e2024]~^ ERROR creating a mutable reference to a mutable static [E0796] + //[e2021]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs] + + let _z = addr_of_mut!(X); + + let _p = addr_of!(X); + + let ref _a = X; + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + + let (_b, _c) = (&X, &Y); + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + //[e2024]~^^^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + + foo(&X); + //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796] + //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs] + + static mut Z: &[i32; 3] = &[0, 1, 2]; + + let _ = Z.len(); + let _ = Z[0]; + let _ = format!("{:?}", Z); + } +} + +fn foo<'a>(_x: &'a i32) {} diff --git a/tests/ui/static/safe-extern-statics-mut.rs b/tests/ui/static/safe-extern-statics-mut.rs index 1c0662e0a6cec..05cc6dd01917c 100644 --- a/tests/ui/static/safe-extern-statics-mut.rs +++ b/tests/ui/static/safe-extern-statics-mut.rs @@ -10,8 +10,8 @@ extern "C" { fn main() { let b = B; //~ ERROR use of mutable static is unsafe let rb = &B; //~ ERROR use of mutable static is unsafe - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] let xb = XB; //~ ERROR use of mutable static is unsafe let xrb = &XB; //~ ERROR use of mutable static is unsafe - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] } diff --git a/tests/ui/static/safe-extern-statics-mut.stderr b/tests/ui/static/safe-extern-statics-mut.stderr index eda353ce6736f..9a4b651405f23 100644 --- a/tests/ui/static/safe-extern-statics-mut.stderr +++ b/tests/ui/static/safe-extern-statics-mut.stderr @@ -1,28 +1,28 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/safe-extern-statics-mut.rs:12:14 | LL | let rb = &B; - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | let rb = addr_of!(B); | ~~~~~~~~~~~ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/safe-extern-statics-mut.rs:15:15 | LL | let xrb = &XB; - | ^^^ shared reference of mutable static + | ^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior +help: use `addr_of!` instead to create a raw pointer | LL | let xrb = addr_of!(XB); | ~~~~~~~~~~~~ diff --git a/tests/ui/statics/issue-15261.rs b/tests/ui/statics/issue-15261.rs index 14422329b7dc8..a6f99bd13c605 100644 --- a/tests/ui/statics/issue-15261.rs +++ b/tests/ui/statics/issue-15261.rs @@ -7,6 +7,6 @@ static mut n_mut: usize = 0; static n: &'static usize = unsafe { &n_mut }; -//~^ WARN shared reference of mutable static is discouraged [static_mut_ref] +//~^ WARN shared reference to mutable static is discouraged [static_mut_refs] fn main() {} diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr index 72d88ce1b3832..c31793f3d8f15 100644 --- a/tests/ui/statics/issue-15261.stderr +++ b/tests/ui/statics/issue-15261.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/issue-15261.rs:9:37 | LL | static n: &'static usize = unsafe { &n_mut }; - | ^^^^^^ shared reference of mutable static + | ^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | static n: &'static usize = unsafe { addr_of!(n_mut) }; | ~~~~~~~~~~~~~~~ diff --git a/tests/ui/statics/static-mut-xc.rs b/tests/ui/statics/static-mut-xc.rs index 2fc265e02eaa3..f242836eccfbc 100644 --- a/tests/ui/statics/static-mut-xc.rs +++ b/tests/ui/statics/static-mut-xc.rs @@ -26,9 +26,9 @@ unsafe fn run() { static_mut_xc::a = -3; assert_eq!(static_mut_xc::a, -3); static_bound(&static_mut_xc::a); - //~^ WARN shared reference of mutable static is discouraged [static_mut_ref] + //~^ WARN shared reference to mutable static is discouraged [static_mut_refs] static_bound_set(&mut static_mut_xc::a); - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs] } pub fn main() { diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr index 37aa336bc50f7..d381328c07178 100644 --- a/tests/ui/statics/static-mut-xc.stderr +++ b/tests/ui/statics/static-mut-xc.stderr @@ -1,28 +1,28 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/static-mut-xc.rs:28:18 | LL | static_bound(&static_mut_xc::a); - | ^^^^^^^^^^^^^^^^^ shared reference of mutable static + | ^^^^^^^^^^^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | static_bound(addr_of!(static_mut_xc::a)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/static-mut-xc.rs:30:22 | LL | static_bound_set(&mut static_mut_xc::a); - | ^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior +help: use `addr_of_mut!` instead to create a raw pointer | LL | static_bound_set(addr_of_mut!(static_mut_xc::a)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/ui/statics/static-recursive.rs b/tests/ui/statics/static-recursive.rs index 216beb0206d9c..52660888986da 100644 --- a/tests/ui/statics/static-recursive.rs +++ b/tests/ui/statics/static-recursive.rs @@ -1,7 +1,7 @@ // run-pass static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 }; -//~^ WARN shared reference of mutable static is discouraged [static_mut_ref] +//~^ WARN shared reference to mutable static is discouraged [static_mut_refs] struct StaticDoubleLinked { prev: &'static StaticDoubleLinked, diff --git a/tests/ui/statics/static-recursive.stderr b/tests/ui/statics/static-recursive.stderr index 15888e5c68d84..cd285c6c2a463 100644 --- a/tests/ui/statics/static-recursive.stderr +++ b/tests/ui/statics/static-recursive.stderr @@ -1,14 +1,14 @@ -warning: shared reference of mutable static is discouraged +warning: creating a shared reference to mutable static is discouraged --> $DIR/static-recursive.rs:3:36 | LL | static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 }; - | ^^ shared reference of mutable static + | ^^ shared reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of!` instead to create a raw pointer | LL | static mut S: *const u8 = unsafe { addr_of!(S) as *const *const u8 as *const u8 }; | ~~~~~~~~~~~ diff --git a/tests/ui/thread-local/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs index f5fb098489746..3f3ac3cc244c1 100644 --- a/tests/ui/thread-local/thread-local-static.rs +++ b/tests/ui/thread-local/thread-local-static.rs @@ -8,7 +8,7 @@ static mut STATIC_VAR_2: [u32; 8] = [4; 8]; const fn g(x: &mut [u32; 8]) { //~^ ERROR mutable references are not allowed std::mem::swap(x, &mut STATIC_VAR_2) - //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref] + //~^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs] //~^^ ERROR thread-local statics cannot be accessed //~| ERROR mutable references are not allowed //~| ERROR use of mutable static is unsafe diff --git a/tests/ui/thread-local/thread-local-static.stderr b/tests/ui/thread-local/thread-local-static.stderr index 59bd17b39d85e..e1b1c4d03ff5c 100644 --- a/tests/ui/thread-local/thread-local-static.stderr +++ b/tests/ui/thread-local/thread-local-static.stderr @@ -1,14 +1,14 @@ -warning: mutable reference of mutable static is discouraged +warning: creating a mutable reference to mutable static is discouraged --> $DIR/thread-local-static.rs:10:23 | LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^^^^^^ mutable reference of mutable static + | ^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 - = note: reference of mutable static is a hard error from 2024 edition - = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior - = note: `#[warn(static_mut_ref)]` on by default -help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer + = note: this will be a hard error in the 2024 edition + = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior + = note: `#[warn(static_mut_refs)]` on by default +help: use `addr_of_mut!` instead to create a raw pointer | LL | std::mem::swap(x, addr_of_mut!(STATIC_VAR_2)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~ From e774bc0b0dfd61044854b48d30b1f1934c3dbffd Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Wed, 21 Feb 2024 16:49:01 +0100 Subject: [PATCH 18/42] Solaris linker does not support --strip-debug Fixes #121381 (cherry picked from commit a17211b05c883eaeb4057f0a9207947bcbcc3688) --- compiler/rustc_codegen_ssa/src/back/linker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 9f06f398288f2..1f3383815e226 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -626,7 +626,7 @@ impl<'a> Linker for GccLinker<'a> { // it does support --strip-all as a compatibility alias for -s. // The --strip-debug case is handled by running an external // `strip` utility as a separate step after linking. - if self.sess.target.os != "illumos" { + if !self.sess.target.is_like_solaris { self.linker_arg("--strip-debug"); } } From 1aeacb074bf3893d79e720c557bea4bb99bfeadd Mon Sep 17 00:00:00 2001 From: Quinn Sinclair Date: Mon, 22 Jan 2024 00:16:47 +0100 Subject: [PATCH 19/42] Fixed FP for `thread_local_initializer_can_be_made_const` for `os_local` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `os_local` impl of `thread_local` — regardless of whether it is const and unlike other implementations — includes an `fn __init(): EXPR`. Existing implementation of the lint checked for the presence of said function and whether the expr can be made const. Because for `os_local` we always have an `__init()`, it triggers for const implementations. The solution is to check whether the `__init()` function is already const. If it is `const`, there is nothing to do. Otherwise, we verify that we can make it const. Co-authored-by: Alejandra González --- ...ead_local_initializer_can_be_made_const.rs | 64 +++++++++++++------ ..._local_initializer_can_be_made_const.fixed | 7 ++ ...ead_local_initializer_can_be_made_const.rs | 7 ++ ...local_initializer_can_be_made_const.stderr | 14 +++- 4 files changed, 71 insertions(+), 21 deletions(-) diff --git a/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs b/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs index 9fee4c062007f..2dac5ff0c3a87 100644 --- a/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs +++ b/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs @@ -1,12 +1,11 @@ use clippy_config::msrvs::Msrv; use clippy_utils::diagnostics::span_lint_and_sugg; -use clippy_utils::fn_has_unsatisfiable_preds; use clippy_utils::qualify_min_const_fn::is_min_const_fn; use clippy_utils::source::snippet; +use clippy_utils::{fn_has_unsatisfiable_preds, peel_blocks}; use rustc_errors::Applicability; use rustc_hir::{intravisit, ExprKind}; -use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_middle::lint::in_external_macro; +use rustc_lint::{LateContext, LateLintPass}; use rustc_session::impl_lint_pass; use rustc_span::sym::thread_local_macro; @@ -57,6 +56,31 @@ impl ThreadLocalInitializerCanBeMadeConst { impl_lint_pass!(ThreadLocalInitializerCanBeMadeConst => [THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST]); +#[inline] +fn is_thread_local_initializer( + cx: &LateContext<'_>, + fn_kind: rustc_hir::intravisit::FnKind<'_>, + span: rustc_span::Span, +) -> Option { + let macro_def_id = span.source_callee()?.macro_def_id?; + Some( + cx.tcx.is_diagnostic_item(thread_local_macro, macro_def_id) + && matches!(fn_kind, intravisit::FnKind::ItemFn(..)), + ) +} + +#[inline] +fn initializer_can_be_made_const(cx: &LateContext<'_>, defid: rustc_span::def_id::DefId, msrv: &Msrv) -> bool { + // Building MIR for `fn`s with unsatisfiable preds results in ICE. + if !fn_has_unsatisfiable_preds(cx, defid) + && let mir = cx.tcx.optimized_mir(defid) + && let Ok(()) = is_min_const_fn(cx.tcx, mir, msrv) + { + return true; + } + false +} + impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst { fn check_fn( &mut self, @@ -65,31 +89,31 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst { _: &'tcx rustc_hir::FnDecl<'tcx>, body: &'tcx rustc_hir::Body<'tcx>, span: rustc_span::Span, - defid: rustc_span::def_id::LocalDefId, + local_defid: rustc_span::def_id::LocalDefId, ) { - if in_external_macro(cx.sess(), span) - && let Some(callee) = span.source_callee() - && let Some(macro_def_id) = callee.macro_def_id - && cx.tcx.is_diagnostic_item(thread_local_macro, macro_def_id) - && let intravisit::FnKind::ItemFn(..) = fn_kind - // Building MIR for `fn`s with unsatisfiable preds results in ICE. - && !fn_has_unsatisfiable_preds(cx, defid.to_def_id()) - && let mir = cx.tcx.optimized_mir(defid.to_def_id()) - && let Ok(()) = is_min_const_fn(cx.tcx, mir, &self.msrv) - // this is the `__init` function emitted by the `thread_local!` macro - // when the `const` keyword is not used. We avoid checking the `__init` directly - // as that is not a public API. - // we know that the function is const-qualifiable, so now we need only to get the - // initializer expression to span-lint it. + let defid = local_defid.to_def_id(); + if is_thread_local_initializer(cx, fn_kind, span).unwrap_or(false) + // Some implementations of `thread_local!` include an initializer fn. + // In the case of a const initializer, the init fn is also const, + // so we can skip the lint in that case. This occurs only on some + // backends due to conditional compilation: + // https://doc.rust-lang.org/src/std/sys/common/thread_local/mod.rs.html + // for details on this issue, see: + // https://github.com/rust-lang/rust-clippy/pull/12276 + && !cx.tcx.is_const_fn(defid) + && initializer_can_be_made_const(cx, defid, &self.msrv) + // we know that the function is const-qualifiable, so now + // we need only to get the initializer expression to span-lint it. && let ExprKind::Block(block, _) = body.value.kind - && let Some(ret_expr) = block.expr + && let Some(unpeeled) = block.expr + && let ret_expr = peel_blocks(unpeeled) && let initializer_snippet = snippet(cx, ret_expr.span, "thread_local! { ... }") && initializer_snippet != "thread_local! { ... }" { span_lint_and_sugg( cx, THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST, - ret_expr.span, + unpeeled.span, "initializer for `thread_local` value can be made `const`", "replace with", format!("const {{ {initializer_snippet} }}"), diff --git a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed index bbde25b0a88b5..1a2c5ffc56f2b 100644 --- a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed +++ b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed @@ -27,4 +27,11 @@ fn main() { } //~^^^^ ERROR: initializer for `thread_local` value can be made `const` //~^^^ ERROR: initializer for `thread_local` value can be made `const` + + thread_local! { + static PEEL_ME: i32 = const { 1 }; + //~^ ERROR: initializer for `thread_local` value can be made `const` + static PEEL_ME_MANY: i32 = const { { let x = 1; x * x } }; + //~^ ERROR: initializer for `thread_local` value can be made `const` + } } diff --git a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs index 3d7aacf2f094f..7fb00cd13427f 100644 --- a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs +++ b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs @@ -27,4 +27,11 @@ fn main() { } //~^^^^ ERROR: initializer for `thread_local` value can be made `const` //~^^^ ERROR: initializer for `thread_local` value can be made `const` + + thread_local! { + static PEEL_ME: i32 = { 1 }; + //~^ ERROR: initializer for `thread_local` value can be made `const` + static PEEL_ME_MANY: i32 = { let x = 1; x * x }; + //~^ ERROR: initializer for `thread_local` value can be made `const` + } } diff --git a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.stderr b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.stderr index b35bd306b5230..2cb51850c4855 100644 --- a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.stderr +++ b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.stderr @@ -25,5 +25,17 @@ error: initializer for `thread_local` value can be made `const` LL | static BUF_4_CAN_BE_MADE_CONST: RefCell = RefCell::new(String::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(String::new()) }` -error: aborting due to 4 previous errors +error: initializer for `thread_local` value can be made `const` + --> $DIR/thread_local_initializer_can_be_made_const.rs:32:31 + | +LL | static PEEL_ME: i32 = { 1 }; + | ^^^^^ help: replace with: `const { 1 }` + +error: initializer for `thread_local` value can be made `const` + --> $DIR/thread_local_initializer_can_be_made_const.rs:34:36 + | +LL | static PEEL_ME_MANY: i32 = { let x = 1; x * x }; + | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { { let x = 1; x * x } }` + +error: aborting due to 6 previous errors From 6eeb080232490e583cb9c7c025b8ebe51a7dcceb Mon Sep 17 00:00:00 2001 From: Quinn Sinclair Date: Sun, 3 Mar 2024 15:42:03 +0100 Subject: [PATCH 20/42] Added msrv to threadlocal initializer --- src/tools/clippy/clippy_config/src/msrvs.rs | 1 + .../src/thread_local_initializer_can_be_made_const.rs | 5 +++-- .../ui/thread_local_initializer_can_be_made_const.fixed | 7 +++++++ .../tests/ui/thread_local_initializer_can_be_made_const.rs | 7 +++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/tools/clippy/clippy_config/src/msrvs.rs b/src/tools/clippy/clippy_config/src/msrvs.rs index 72d5b9aff28df..0c6368d33f48b 100644 --- a/src/tools/clippy/clippy_config/src/msrvs.rs +++ b/src/tools/clippy/clippy_config/src/msrvs.rs @@ -21,6 +21,7 @@ msrv_aliases! { 1,68,0 { PATH_MAIN_SEPARATOR_STR } 1,65,0 { LET_ELSE, POINTER_CAST_CONSTNESS } 1,62,0 { BOOL_THEN_SOME, DEFAULT_ENUM_ATTRIBUTE } + 1,59,0 { THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST } 1,58,0 { FORMAT_ARGS_CAPTURE, PATTERN_TRAIT_CHAR_ARRAY } 1,55,0 { SEEK_REWIND } 1,54,0 { INTO_KEYS } diff --git a/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs b/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs index 2dac5ff0c3a87..1af3733ebfa4b 100644 --- a/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs +++ b/src/tools/clippy/clippy_lints/src/thread_local_initializer_can_be_made_const.rs @@ -1,4 +1,4 @@ -use clippy_config::msrvs::Msrv; +use clippy_config::msrvs::{self, Msrv}; use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::qualify_min_const_fn::is_min_const_fn; use clippy_utils::source::snippet; @@ -92,7 +92,8 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst { local_defid: rustc_span::def_id::LocalDefId, ) { let defid = local_defid.to_def_id(); - if is_thread_local_initializer(cx, fn_kind, span).unwrap_or(false) + if self.msrv.meets(msrvs::THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST) + && is_thread_local_initializer(cx, fn_kind, span).unwrap_or(false) // Some implementations of `thread_local!` include an initializer fn. // In the case of a const initializer, the init fn is also const, // so we can skip the lint in that case. This occurs only on some diff --git a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed index 1a2c5ffc56f2b..a6ed59d49c54f 100644 --- a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed +++ b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.fixed @@ -35,3 +35,10 @@ fn main() { //~^ ERROR: initializer for `thread_local` value can be made `const` } } + +#[clippy::msrv = "1.58"] +fn f() { + thread_local! { + static TLS: i32 = 1; + } +} diff --git a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs index 7fb00cd13427f..3f0159c58065c 100644 --- a/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs +++ b/src/tools/clippy/tests/ui/thread_local_initializer_can_be_made_const.rs @@ -35,3 +35,10 @@ fn main() { //~^ ERROR: initializer for `thread_local` value can be made `const` } } + +#[clippy::msrv = "1.58"] +fn f() { + thread_local! { + static TLS: i32 = 1; + } +} From 38adec81035cd17e044b5e43ea228c2641603d22 Mon Sep 17 00:00:00 2001 From: granddaifuku Date: Sun, 11 Feb 2024 03:51:26 +0900 Subject: [PATCH 21/42] fix: ICE when array index exceeds usize --- src/tools/clippy/clippy_lints/src/indexing_slicing.rs | 1 + src/tools/clippy/tests/ui/crashes/ice-12253.rs | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/tools/clippy/tests/ui/crashes/ice-12253.rs diff --git a/src/tools/clippy/clippy_lints/src/indexing_slicing.rs b/src/tools/clippy/clippy_lints/src/indexing_slicing.rs index 391db0b0df726..35fcd8cdd3547 100644 --- a/src/tools/clippy/clippy_lints/src/indexing_slicing.rs +++ b/src/tools/clippy/clippy_lints/src/indexing_slicing.rs @@ -174,6 +174,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing { // only `usize` index is legal in rust array index // leave other type to rustc if let Constant::Int(off) = constant + && off <= usize::MAX as u128 && let ty::Uint(utype) = cx.typeck_results().expr_ty(index).kind() && *utype == ty::UintTy::Usize && let ty::Array(_, s) = ty.kind() diff --git a/src/tools/clippy/tests/ui/crashes/ice-12253.rs b/src/tools/clippy/tests/ui/crashes/ice-12253.rs new file mode 100644 index 0000000000000..41f50035144a7 --- /dev/null +++ b/src/tools/clippy/tests/ui/crashes/ice-12253.rs @@ -0,0 +1,5 @@ +#[allow(overflowing_literals, unconditional_panic, clippy::no_effect)] +fn main() { + let arr: [i32; 5] = [0; 5]; + arr[0xfffffe7ffffffffffffffffffffffff]; +} From 274a6fb21e5c63e9c627b02c8563d83d1e668cc1 Mon Sep 17 00:00:00 2001 From: y21 <30553356+y21@users.noreply.github.com> Date: Sat, 20 Jan 2024 20:26:06 +0100 Subject: [PATCH 22/42] [`unconditional_recursion`]: compare by types instead of `DefId`s --- .../src/unconditional_recursion.rs | 86 ++++++++++--------- .../tests/ui/unconditional_recursion.rs | 35 ++++++++ 2 files changed, 82 insertions(+), 39 deletions(-) diff --git a/src/tools/clippy/clippy_lints/src/unconditional_recursion.rs b/src/tools/clippy/clippy_lints/src/unconditional_recursion.rs index 209035804e43e..224ec475c5107 100644 --- a/src/tools/clippy/clippy_lints/src/unconditional_recursion.rs +++ b/src/tools/clippy/clippy_lints/src/unconditional_recursion.rs @@ -69,14 +69,6 @@ fn span_error(cx: &LateContext<'_>, method_span: Span, expr: &Expr<'_>) { ); } -fn get_ty_def_id(ty: Ty<'_>) -> Option { - match ty.peel_refs().kind() { - ty::Adt(adt, _) => Some(adt.did()), - ty::Foreign(def_id) => Some(*def_id), - _ => None, - } -} - fn get_hir_ty_def_id<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: rustc_hir::Ty<'tcx>) -> Option { let TyKind::Path(qpath) = hir_ty.kind else { return None }; match qpath { @@ -131,21 +123,49 @@ fn get_impl_trait_def_id(cx: &LateContext<'_>, method_def_id: LocalDefId) -> Opt } } -#[allow(clippy::unnecessary_def_path)] +/// When we have `x == y` where `x = &T` and `y = &T`, then that resolves to +/// `<&T as PartialEq<&T>>::eq`, which is not the same as `>::eq`, +/// however we still would want to treat it the same, because we know that it's a blanket impl +/// that simply delegates to the `PartialEq` impl with one reference removed. +/// +/// Still, we can't just do `lty.peel_refs() == rty.peel_refs()` because when we have `x = &T` and +/// `y = &&T`, this is not necessarily the same as `>::eq` +/// +/// So to avoid these FNs and FPs, we keep removing a layer of references from *both* sides +/// until both sides match the expected LHS and RHS type (or they don't). +fn matches_ty<'tcx>( + mut left: Ty<'tcx>, + mut right: Ty<'tcx>, + expected_left: Ty<'tcx>, + expected_right: Ty<'tcx>, +) -> bool { + while let (&ty::Ref(_, lty, _), &ty::Ref(_, rty, _)) = (left.kind(), right.kind()) { + if lty == expected_left && rty == expected_right { + return true; + } + left = lty; + right = rty; + } + false +} + fn check_partial_eq(cx: &LateContext<'_>, method_span: Span, method_def_id: LocalDefId, name: Ident, expr: &Expr<'_>) { - let args = cx - .tcx - .instantiate_bound_regions_with_erased(cx.tcx.fn_sig(method_def_id).skip_binder()) - .inputs(); + let Some(sig) = cx + .typeck_results() + .liberated_fn_sigs() + .get(cx.tcx.local_def_id_to_hir_id(method_def_id)) + else { + return; + }; + // That has two arguments. - if let [self_arg, other_arg] = args - && let Some(self_arg) = get_ty_def_id(*self_arg) - && let Some(other_arg) = get_ty_def_id(*other_arg) + if let [self_arg, other_arg] = sig.inputs() + && let &ty::Ref(_, self_arg, _) = self_arg.kind() + && let &ty::Ref(_, other_arg, _) = other_arg.kind() // The two arguments are of the same type. - && self_arg == other_arg && let Some(trait_def_id) = get_impl_trait_def_id(cx, method_def_id) // The trait is `PartialEq`. - && Some(trait_def_id) == get_trait_def_id(cx, &["core", "cmp", "PartialEq"]) + && cx.tcx.is_diagnostic_item(sym::PartialEq, trait_def_id) { let to_check_op = if name.name == sym::eq { BinOpKind::Eq @@ -154,31 +174,19 @@ fn check_partial_eq(cx: &LateContext<'_>, method_span: Span, method_def_id: Loca }; let is_bad = match expr.kind { ExprKind::Binary(op, left, right) if op.node == to_check_op => { - // Then we check if the left-hand element is of the same type as `self`. - if let Some(left_ty) = cx.typeck_results().expr_ty_opt(left) - && let Some(left_id) = get_ty_def_id(left_ty) - && self_arg == left_id - && let Some(right_ty) = cx.typeck_results().expr_ty_opt(right) - && let Some(right_id) = get_ty_def_id(right_ty) - && other_arg == right_id - { - true - } else { - false - } + // Then we check if the LHS matches self_arg and RHS matches other_arg + let left_ty = cx.typeck_results().expr_ty_adjusted(left); + let right_ty = cx.typeck_results().expr_ty_adjusted(right); + matches_ty(left_ty, right_ty, self_arg, other_arg) }, - ExprKind::MethodCall(segment, receiver, &[_arg], _) if segment.ident.name == name.name => { - if let Some(ty) = cx.typeck_results().expr_ty_opt(receiver) - && let Some(ty_id) = get_ty_def_id(ty) - && self_arg != ty_id - { - // Since this called on a different type, the lint should not be - // triggered here. - return; - } + ExprKind::MethodCall(segment, receiver, [arg], _) if segment.ident.name == name.name => { + let receiver_ty = cx.typeck_results().expr_ty_adjusted(receiver); + let arg_ty = cx.typeck_results().expr_ty_adjusted(arg); + if let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) && let Some(trait_id) = cx.tcx.trait_of_item(fn_id) && trait_id == trait_def_id + && matches_ty(receiver_ty, arg_ty, self_arg, other_arg) { true } else { diff --git a/src/tools/clippy/tests/ui/unconditional_recursion.rs b/src/tools/clippy/tests/ui/unconditional_recursion.rs index 7b898a6e0e784..2ad7c410da59d 100644 --- a/src/tools/clippy/tests/ui/unconditional_recursion.rs +++ b/src/tools/clippy/tests/ui/unconditional_recursion.rs @@ -288,4 +288,39 @@ impl PartialEq for S15<'_> { } } +mod issue12154 { + struct MyBox(T); + + impl std::ops::Deref for MyBox { + type Target = T; + fn deref(&self) -> &T { + &self.0 + } + } + + impl PartialEq for MyBox { + fn eq(&self, other: &Self) -> bool { + (**self).eq(&**other) + } + } + + // Not necessarily related to the issue but another FP from the http crate that was fixed with it: + // https://docs.rs/http/latest/src/http/header/name.rs.html#1424 + // We used to simply peel refs from the LHS and RHS, so we couldn't differentiate + // between `PartialEq for &T` and `PartialEq<&T> for T` impls. + #[derive(PartialEq)] + struct HeaderName; + impl<'a> PartialEq<&'a HeaderName> for HeaderName { + fn eq(&self, other: &&'a HeaderName) -> bool { + *self == **other + } + } + + impl<'a> PartialEq for &'a HeaderName { + fn eq(&self, other: &HeaderName) -> bool { + *other == *self + } + } +} + fn main() {} From 046eb84794947d4abfebc0ae329c4f951fef880c Mon Sep 17 00:00:00 2001 From: y21 <30553356+y21@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:33:03 +0100 Subject: [PATCH 23/42] add a test for rust-lang/rust-clippy#12181 --- .../tests/ui/unconditional_recursion.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/tools/clippy/tests/ui/unconditional_recursion.rs b/src/tools/clippy/tests/ui/unconditional_recursion.rs index 2ad7c410da59d..263fdf26d4d2f 100644 --- a/src/tools/clippy/tests/ui/unconditional_recursion.rs +++ b/src/tools/clippy/tests/ui/unconditional_recursion.rs @@ -321,6 +321,30 @@ mod issue12154 { *other == *self } } + + // Issue #12181 but also fixed by the same PR + struct Foo; + + impl Foo { + fn as_str(&self) -> &str { + "Foo" + } + } + + impl PartialEq for Foo { + fn eq(&self, other: &Self) -> bool { + self.as_str().eq(other.as_str()) + } + } + + impl PartialEq for Foo + where + for<'a> &'a str: PartialEq, + { + fn eq(&self, other: &T) -> bool { + (&self.as_str()).eq(other) + } + } } fn main() {} From 92512b17b3a5ab066ca406228df3ed7bc5529ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Tue, 5 Mar 2024 00:02:35 +0100 Subject: [PATCH 24/42] AST validation: Improve handling of inherent impls nested within functions and anon consts (cherry picked from commit 7d428db605d305198481b2201f46f5f91d5f8369) --- .../rustc_ast_passes/src/ast_validation.rs | 57 ++++++++++--------- ...mpls-nested-within-anon-consts-semantic.rs | 35 ++++++++++++ .../impls-nested-within-fns-semantic-0.rs | 15 +++++ .../impls-nested-within-fns-semantic-1.rs | 22 +++++++ 4 files changed, 102 insertions(+), 27 deletions(-) create mode 100644 tests/ui/parser/impls-nested-within-anon-consts-semantic.rs create mode 100644 tests/ui/parser/impls-nested-within-fns-semantic-0.rs create mode 100644 tests/ui/parser/impls-nested-within-fns-semantic-1.rs diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 9ea5d1ed5fa27..559ca24d5afc0 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -925,35 +925,38 @@ impl<'a> Visitor<'a> for AstValidator<'a> { only_trait: only_trait.then_some(()), }; - self.visibility_not_permitted( - &item.vis, - errors::VisibilityNotPermittedNote::IndividualImplItems, - ); - if let &Unsafe::Yes(span) = unsafety { - self.dcx().emit_err(errors::InherentImplCannotUnsafe { - span: self_ty.span, - annotation_span: span, - annotation: "unsafe", - self_ty: self_ty.span, - }); - } - if let &ImplPolarity::Negative(span) = polarity { - self.dcx().emit_err(error(span, "negative", false)); - } - if let &Defaultness::Default(def_span) = defaultness { - self.dcx().emit_err(error(def_span, "`default`", true)); - } - if let &Const::Yes(span) = constness { - self.dcx().emit_err(error(span, "`const`", true)); - } + self.with_in_trait_impl(None, |this| { + this.visibility_not_permitted( + &item.vis, + errors::VisibilityNotPermittedNote::IndividualImplItems, + ); + if let &Unsafe::Yes(span) = unsafety { + this.dcx().emit_err(errors::InherentImplCannotUnsafe { + span: self_ty.span, + annotation_span: span, + annotation: "unsafe", + self_ty: self_ty.span, + }); + } + if let &ImplPolarity::Negative(span) = polarity { + this.dcx().emit_err(error(span, "negative", false)); + } + if let &Defaultness::Default(def_span) = defaultness { + this.dcx().emit_err(error(def_span, "`default`", true)); + } + if let &Const::Yes(span) = constness { + this.dcx().emit_err(error(span, "`const`", true)); + } - self.visit_vis(&item.vis); - self.visit_ident(item.ident); - self.with_tilde_const(Some(DisallowTildeConstContext::Impl(item.span)), |this| { - this.visit_generics(generics) + this.visit_vis(&item.vis); + this.visit_ident(item.ident); + this.with_tilde_const( + Some(DisallowTildeConstContext::Impl(item.span)), + |this| this.visit_generics(generics), + ); + this.visit_ty(self_ty); + walk_list!(this, visit_assoc_item, items, AssocCtxt::Impl); }); - self.visit_ty(self_ty); - walk_list!(self, visit_assoc_item, items, AssocCtxt::Impl); walk_list!(self, visit_attribute, &item.attrs); return; // Avoid visiting again. } diff --git a/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs b/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs new file mode 100644 index 0000000000000..b74dc3d49263e --- /dev/null +++ b/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs @@ -0,0 +1,35 @@ +// Regression test for issue #89342 and for part of #119924. +// check-pass + +struct Expr; + +trait Trait0 { + fn required(_: Expr<{ + struct Type; + + impl Type { + // This visibility qualifier used to get rejected. + pub fn perform() {} + } + + 0 + }>); +} + +trait Trait1 {} + +impl Trait1 for () +where + [(); { + struct Type; + + impl Type { + // This visibility qualifier used to get rejected. + pub const STORE: Self = Self; + } + + 0 + }]: +{} + +fn main() {} diff --git a/tests/ui/parser/impls-nested-within-fns-semantic-0.rs b/tests/ui/parser/impls-nested-within-fns-semantic-0.rs new file mode 100644 index 0000000000000..ac7eb5c72b025 --- /dev/null +++ b/tests/ui/parser/impls-nested-within-fns-semantic-0.rs @@ -0,0 +1,15 @@ +// Regression test for #121607 and for part of issue #119924. +// check-pass + +trait Trait { + fn provided() { + pub struct Type; + + impl Type { + // This visibility qualifier used to get rejected. + pub fn perform() {} + } + } +} + +fn main() {} diff --git a/tests/ui/parser/impls-nested-within-fns-semantic-1.rs b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs new file mode 100644 index 0000000000000..7aef3282af111 --- /dev/null +++ b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs @@ -0,0 +1,22 @@ +// Regression test for part of issue #119924. +// check-pass + +#![feature(const_trait_impl, effects)] + +#[const_trait] +trait Trait { + fn required(); +} + +impl const Trait for () { + fn required() { + pub struct Type; + + impl Type { + // This visibility qualifier used to get rejected. + pub fn perform() {} + } + } +} + +fn main() {} From 25d3cbb10ec281014b4842540923cbe217eebb97 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 8 Mar 2024 11:24:48 -0500 Subject: [PATCH 25/42] downgrade mutable-ptr-in-final-value from hard-error to future-incompat lint to address issue 121610. (cherry picked from commit a8549b4152566d8fbd34c097236df1db3d9afd3c) --- compiler/rustc_const_eval/src/errors.rs | 7 ++-- .../rustc_const_eval/src/interpret/intern.rs | 12 ++++--- compiler/rustc_lint_defs/src/builtin.rs | 36 +++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 4d2b1ba3eec89..7736dc6d5c428 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -27,10 +27,13 @@ pub(crate) struct DanglingPtrInFinal { pub kind: InternKind, } -#[derive(Diagnostic)] +#[derive(LintDiagnostic)] #[diag(const_eval_mutable_ptr_in_final)] pub(crate) struct MutablePtrInFinal { - #[primary_span] + // rust-lang/rust#122153: This was marked as `#[primary_span]` under + // `derive(Diagnostic)`. Since we expect we may hard-error in future, we are + // keeping the field (and skipping it under `derive(LintDiagnostic)`). + #[skip_arg] pub span: Span, pub kind: InternKind, } diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 751fbfacaad00..61f170620ea6b 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -19,6 +19,7 @@ use rustc_errors::ErrorGuaranteed; use rustc_hir as hir; use rustc_middle::mir::interpret::{CtfeProvenance, InterpResult}; use rustc_middle::ty::layout::TyAndLayout; +use rustc_session::lint; use super::{AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy}; use crate::const_eval; @@ -195,10 +196,13 @@ pub fn intern_const_alloc_recursive< })?; } if found_bad_mutable_pointer { - return Err(ecx - .tcx - .dcx() - .emit_err(MutablePtrInFinal { span: ecx.tcx.span, kind: intern_kind })); + let err_diag = MutablePtrInFinal { span: ecx.tcx.span, kind: intern_kind }; + ecx.tcx.emit_node_span_lint( + lint::builtin::CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE, + ecx.best_lint_scope(), + err_diag.span, + err_diag, + ) } Ok(()) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index f209e083d2de5..050478149b0a6 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -27,6 +27,7 @@ declare_lint_pass! { CENUM_IMPL_DROP_CAST, COHERENCE_LEAK_CHECK, CONFLICTING_REPR_HINTS, + CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE, CONST_EVALUATABLE_UNCHECKED, CONST_ITEM_MUTATION, CONST_PATTERNS_WITHOUT_PARTIAL_EQ, @@ -2905,6 +2906,41 @@ declare_lint! { @feature_gate = sym::strict_provenance; } +declare_lint! { + /// The `const_eval_mutable_ptr_in_final_value` lint detects if a mutable pointer + /// has leaked into the final value of a const expression. + /// + /// ### Example + /// + /// ```rust + /// pub enum JsValue { + /// Undefined, + /// Object(std::cell::Cell), + /// } + /// + /// impl ::std::ops::Drop for JsValue { + /// fn drop(&mut self) {} + /// } + /// + /// const UNDEFINED: &JsValue = &JsValue::Undefined; + /// + /// fn main() { + /// } + /// ``` + /// + /// This is a [future-incompatible] lint to ease the transition to an error. + /// See [issue #122153] for more details. + /// + /// [issue #122153]: https://github.com/rust-lang/rust/issues/122153 + pub CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE, + Warn, + "detects a mutable pointer that has leaked into final value of a const expression", + @future_incompatible = FutureIncompatibleInfo { + reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps, + reference: "issue #122153 ", + }; +} + declare_lint! { /// The `const_evaluatable_unchecked` lint detects a generic constant used /// in a type. From 6c06ca001b67842760a6f4a64716e06bf1254ec8 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 8 Mar 2024 11:46:17 -0500 Subject: [PATCH 26/42] regression test from 121610. (cherry picked from commit f86b46a9cc0dadaee69ca4e4a911ce122db17b24) --- ...pat-mutable-in-final-value-issue-121610.rs | 18 +++++++++++++++ ...mutable-in-final-value-issue-121610.stderr | 23 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.rs create mode 100644 tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.stderr diff --git a/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.rs b/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.rs new file mode 100644 index 0000000000000..94defbd7d9c09 --- /dev/null +++ b/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.rs @@ -0,0 +1,18 @@ +// check-pass +use std::cell::Cell; + +pub enum JsValue { + Undefined, + Object(Cell), +} + +impl ::std::ops::Drop for JsValue { + fn drop(&mut self) {} +} + +const UNDEFINED: &JsValue = &JsValue::Undefined; + //~^ WARN encountered mutable pointer in final value of constant + //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + +fn main() { +} diff --git a/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.stderr b/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.stderr new file mode 100644 index 0000000000000..85de4e7ff32e1 --- /dev/null +++ b/tests/ui/consts/future-incompat-mutable-in-final-value-issue-121610.stderr @@ -0,0 +1,23 @@ +warning: encountered mutable pointer in final value of constant + --> $DIR/future-incompat-mutable-in-final-value-issue-121610.rs:13:1 + | +LL | const UNDEFINED: &JsValue = &JsValue::Undefined; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + = note: `#[warn(const_eval_mutable_ptr_in_final_value)]` on by default + +warning: 1 warning emitted + +Future incompatibility report: Future breakage diagnostic: +warning: encountered mutable pointer in final value of constant + --> $DIR/future-incompat-mutable-in-final-value-issue-121610.rs:13:1 + | +LL | const UNDEFINED: &JsValue = &JsValue::Undefined; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + = note: `#[warn(const_eval_mutable_ptr_in_final_value)]` on by default + From 9cf28f2fc787bfadb3a0ad4e11a4e577bf2e0b70 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 8 Mar 2024 14:13:57 -0500 Subject: [PATCH 27/42] Added `deny(const_eval_mutable_ptr_in_final_value)` attribute to all tests that were expecting the hard error for it. I attempted to do this in a manner that preserved the line numbers to reduce the review effort on the resulting diff, but we still have to deal with the ramifications of how a future-incompat lint behaves compared to a hard-error (in terms of its impact on the diagnostic output). (cherry picked from commit 1c3424bfc1354db47fd3901cb1b76c22fbe33392) --- .../heap/alloc_intrinsic_untyped.rs | 2 + .../heap/alloc_intrinsic_untyped.stderr | 25 +- .../mutable_references_err.32bit.stderr | 270 +++++++++++++++--- .../mutable_references_err.64bit.stderr | 270 +++++++++++++++--- .../miri_unleashed/mutable_references_err.rs | 19 +- .../static-no-inner-mut.32bit.stderr | 202 ++++++++++++- .../static-no-inner-mut.64bit.stderr | 202 ++++++++++++- .../miri_unleashed/static-no-inner-mut.rs | 29 +- 8 files changed, 916 insertions(+), 103 deletions(-) diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs index 105e8e38d84eb..b8fed212c97f9 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs @@ -1,9 +1,11 @@ #![feature(core_intrinsics)] #![feature(const_heap)] #![feature(const_mut_refs)] +#![deny(const_eval_mutable_ptr_in_final_value)] use std::intrinsics; const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; //~^ error: mutable pointer in final value of constant +//~| WARNING this was previously accepted by the compiler fn main() {} diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr index bd82e6781be1e..bb47adacb9f95 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr @@ -1,8 +1,31 @@ error: encountered mutable pointer in final value of constant - --> $DIR/alloc_intrinsic_untyped.rs:6:1 + --> $DIR/alloc_intrinsic_untyped.rs:7:1 | LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; | ^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/alloc_intrinsic_untyped.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error +Future incompatibility report: Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/alloc_intrinsic_untyped.rs:7:1 + | +LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; + | ^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/alloc_intrinsic_untyped.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr index 5e79b9755010b..c9156958329a9 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr @@ -3,197 +3,397 @@ error: encountered mutable pointer in final value of constant | LL | const MUH: Meh = Meh { | ^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:17:1 + | +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ constructing invalid value at .x.: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC0╼ │ ╾──╼ + } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:28:1 + --> $DIR/mutable_references_err.rs:30:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:33:1 + --> $DIR/mutable_references_err.rs:30:1 + | +LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 4) { + ╾ALLOC1╼ ╾ALLOC2╼ │ ╾──╼╾──╼ + } + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:37:1 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { - ╾ALLOC0╼ │ ╾──╼ + ╾ALLOC3╼ │ ╾──╼ } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:36:1 + --> $DIR/mutable_references_err.rs:41:1 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:41:1 | +LL | const BLUNT: &mut i32 = &mut 42; + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC4╼ │ ╾──╼ + } + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:48:1 + | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { - ╾ALLOC1╼ │ ╾──╼ + ╾ALLOC5╼ │ ╾──╼ } error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:48:1 + --> $DIR/mutable_references_err.rs:55:1 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { - ╾ALLOC2╼ │ ╾──╼ + ╾ALLOC6╼ │ ╾──╼ } error[E0080]: evaluation of constant value failed - --> $DIR/mutable_references_err.rs:52:43 + --> $DIR/mutable_references_err.rs:59:43 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^^^ constant accesses static error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:56:1 + --> $DIR/mutable_references_err.rs:63:1 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:58:1 + --> $DIR/mutable_references_err.rs:67:1 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:60:1 + --> $DIR/mutable_references_err.rs:71:1 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:72:1 + --> $DIR/mutable_references_err.rs:84:1 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:74:1 + --> $DIR/mutable_references_err.rs:88:1 | LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:76:1 + --> $DIR/mutable_references_err.rs:92:1 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 warning: skipping const checks | help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:19:8 + --> $DIR/mutable_references_err.rs:21:8 | LL | x: &UnsafeCell::new(42), | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:28:27 + --> $DIR/mutable_references_err.rs:30:27 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:40 + --> $DIR/mutable_references_err.rs:37:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:40 + --> $DIR/mutable_references_err.rs:37:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:35 + --> $DIR/mutable_references_err.rs:37:35 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:36:25 + --> $DIR/mutable_references_err.rs:41:25 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:48:44 + --> $DIR/mutable_references_err.rs:55:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:48:44 + --> $DIR/mutable_references_err.rs:55:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:36 + --> $DIR/mutable_references_err.rs:58:36 | LL | static mut MUTABLE_REF: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:52:45 + --> $DIR/mutable_references_err.rs:59:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:52:45 + --> $DIR/mutable_references_err.rs:59:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:56:45 + --> $DIR/mutable_references_err.rs:63:45 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:58:46 + --> $DIR/mutable_references_err.rs:67:46 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:60:47 + --> $DIR/mutable_references_err.rs:71:47 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:72:51 + --> $DIR/mutable_references_err.rs:84:51 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:74:49 + --> $DIR/mutable_references_err.rs:88:49 | LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:76:51 + --> $DIR/mutable_references_err.rs:92:51 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ -error: aborting due to 13 previous errors; 1 warning emitted +error: aborting due to 16 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:17:1 + | +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:30:1 + | +LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:41:1 + | +LL | const BLUNT: &mut i32 = &mut 42; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:63:1 + | +LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:67:1 + | +LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:71:1 + | +LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:84:1 + | +LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:88:1 + | +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:92:1 + | +LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr index 5a0b6af1a7b8f..9bec536635b49 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr @@ -3,197 +3,397 @@ error: encountered mutable pointer in final value of constant | LL | const MUH: Meh = Meh { | ^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:17:1 + | +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ constructing invalid value at .x.: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC0╼ │ ╾──────╼ + } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:28:1 + --> $DIR/mutable_references_err.rs:30:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:33:1 + --> $DIR/mutable_references_err.rs:30:1 + | +LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 16, align: 8) { + ╾ALLOC1╼ ╾ALLOC2╼ │ ╾──────╼╾──────╼ + } + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:37:1 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { - ╾ALLOC0╼ │ ╾──────╼ + ╾ALLOC3╼ │ ╾──────╼ } error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:36:1 + --> $DIR/mutable_references_err.rs:41:1 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:41:1 | +LL | const BLUNT: &mut i32 = &mut 42; + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC4╼ │ ╾──────╼ + } + +error[E0080]: it is undefined behavior to use this value + --> $DIR/mutable_references_err.rs:48:1 + | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { - ╾ALLOC1╼ │ ╾──────╼ + ╾ALLOC5╼ │ ╾──────╼ } error[E0080]: it is undefined behavior to use this value - --> $DIR/mutable_references_err.rs:48:1 + --> $DIR/mutable_references_err.rs:55:1 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { - ╾ALLOC2╼ │ ╾──────╼ + ╾ALLOC6╼ │ ╾──────╼ } error[E0080]: evaluation of constant value failed - --> $DIR/mutable_references_err.rs:52:43 + --> $DIR/mutable_references_err.rs:59:43 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^^^ constant accesses static error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:56:1 + --> $DIR/mutable_references_err.rs:63:1 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:58:1 + --> $DIR/mutable_references_err.rs:67:1 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:60:1 + --> $DIR/mutable_references_err.rs:71:1 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:72:1 + --> $DIR/mutable_references_err.rs:84:1 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:74:1 + --> $DIR/mutable_references_err.rs:88:1 | LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of constant - --> $DIR/mutable_references_err.rs:76:1 + --> $DIR/mutable_references_err.rs:92:1 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 warning: skipping const checks | help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:19:8 + --> $DIR/mutable_references_err.rs:21:8 | LL | x: &UnsafeCell::new(42), | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:28:27 + --> $DIR/mutable_references_err.rs:30:27 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:40 + --> $DIR/mutable_references_err.rs:37:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:40 + --> $DIR/mutable_references_err.rs:37:40 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:33:35 + --> $DIR/mutable_references_err.rs:37:35 | LL | const SUBTLE: &mut i32 = unsafe { &mut FOO }; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:36:25 + --> $DIR/mutable_references_err.rs:41:25 | LL | const BLUNT: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:41:49 + --> $DIR/mutable_references_err.rs:48:49 | LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:48:44 + --> $DIR/mutable_references_err.rs:55:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:48:44 + --> $DIR/mutable_references_err.rs:55:44 | LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:51:36 + --> $DIR/mutable_references_err.rs:58:36 | LL | static mut MUTABLE_REF: &mut i32 = &mut 42; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:52:45 + --> $DIR/mutable_references_err.rs:59:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:52:45 + --> $DIR/mutable_references_err.rs:59:45 | LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; | ^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:56:45 + --> $DIR/mutable_references_err.rs:63:45 | LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:58:46 + --> $DIR/mutable_references_err.rs:67:46 | LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:60:47 + --> $DIR/mutable_references_err.rs:71:47 | LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; | ^^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:72:51 + --> $DIR/mutable_references_err.rs:84:51 | LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:74:49 + --> $DIR/mutable_references_err.rs:88:49 | LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/mutable_references_err.rs:76:51 + --> $DIR/mutable_references_err.rs:92:51 | LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ -error: aborting due to 13 previous errors; 1 warning emitted +error: aborting due to 16 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:17:1 + | +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:30:1 + | +LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:41:1 + | +LL | const BLUNT: &mut i32 = &mut 42; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:63:1 + | +LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:67:1 + | +LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:71:1 + | +LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:84:1 + | +LL | const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:88:1 + | +LL | const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of constant + --> $DIR/mutable_references_err.rs:92:1 + | +LL | const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/mutable_references_err.rs:4:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.rs b/tests/ui/consts/miri_unleashed/mutable_references_err.rs index 3bfb0346d6abf..f652bf37a2ee8 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references_err.rs +++ b/tests/ui/consts/miri_unleashed/mutable_references_err.rs @@ -1,7 +1,7 @@ // stderr-per-bitwidth // compile-flags: -Zunleash-the-miri-inside-of-you #![allow(invalid_reference_casting, static_mut_refs)] - +#![deny(const_eval_mutable_ptr_in_final_value)] use std::cell::UnsafeCell; use std::sync::atomic::*; @@ -16,6 +16,8 @@ unsafe impl Sync for Meh {} // all allocs interned here will be marked immutable. const MUH: Meh = Meh { //~^ ERROR encountered mutable pointer in final value of constant + //~| WARNING this was previously accepted by the compiler + //~| ERROR: it is undefined behavior to use this value x: &UnsafeCell::new(42), }; @@ -27,14 +29,19 @@ unsafe impl Sync for Synced {} // Make sure we also catch this behind a type-erased `dyn Trait` reference. const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; //~^ ERROR: mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value // Make sure we also catch mutable references in values that shouldn't have them. static mut FOO: i32 = 0; const SUBTLE: &mut i32 = unsafe { &mut FOO }; //~^ ERROR: it is undefined behavior to use this value //~| static + const BLUNT: &mut i32 = &mut 42; //~^ ERROR: mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value // Check for mutable references to read-only memory. static READONLY: i32 = 0; @@ -55,10 +62,15 @@ const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; //~^ ERROR: mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; //~^ ERROR: mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; //~^ ERROR: mutable pointer in final value +//~| WARNING this was previously accepted by the compiler struct SyncPtr { x: *const T, @@ -71,10 +83,15 @@ unsafe impl Sync for SyncPtr {} // (Also see `static-no-inner-mut` for similar tests on `static`.) const RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + const RAW_MUT_CAST: SyncPtr = SyncPtr { x: &mut 42 as *mut _ as *const _ }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + const RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler fn main() { unsafe { diff --git a/tests/ui/consts/miri_unleashed/static-no-inner-mut.32bit.stderr b/tests/ui/consts/miri_unleashed/static-no-inner-mut.32bit.stderr index e8ed6742fab3a..b980f056c5382 100644 --- a/tests/ui/consts/miri_unleashed/static-no-inner-mut.32bit.stderr +++ b/tests/ui/consts/miri_unleashed/static-no-inner-mut.32bit.stderr @@ -3,42 +3,112 @@ error: encountered mutable pointer in final value of static | LL | static REF: &AtomicI32 = &AtomicI32::new(42); | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:9:1 + | +LL | static REF: &AtomicI32 = &AtomicI32::new(42); + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..v: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC0╼ │ ╾──╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:10:1 + --> $DIR/static-no-inner-mut.rs:14:1 | LL | static REFMUT: &mut i32 = &mut 0; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:14:1 + | +LL | static REFMUT: &mut i32 = &mut 0; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC1╼ │ ╾──╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:13:1 + --> $DIR/static-no-inner-mut.rs:20:1 | LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:20:1 + | +LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..v: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC2╼ │ ╾──╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:14:1 + --> $DIR/static-no-inner-mut.rs:25:1 | LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:25:1 + | +LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 4, align: 4) { + ╾ALLOC3╼ │ ╾──╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:29:1 + --> $DIR/static-no-inner-mut.rs:43:1 | LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:31:1 + --> $DIR/static-no-inner-mut.rs:47:1 | LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:33:1 + --> $DIR/static-no-inner-mut.rs:51:1 | LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 warning: skipping const checks | @@ -48,35 +118,141 @@ help: skipping check that does not even have a feature gate LL | static REF: &AtomicI32 = &AtomicI32::new(42); | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:10:27 + --> $DIR/static-no-inner-mut.rs:14:27 | LL | static REFMUT: &mut i32 = &mut 0; | ^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:13:56 + --> $DIR/static-no-inner-mut.rs:20:56 | LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; | ^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:14:44 + --> $DIR/static-no-inner-mut.rs:25:44 | LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:29:52 + --> $DIR/static-no-inner-mut.rs:43:52 | LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:31:51 + --> $DIR/static-no-inner-mut.rs:47:51 | LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:33:52 + --> $DIR/static-no-inner-mut.rs:51:52 | LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ -error: aborting due to 7 previous errors; 1 warning emitted +error: aborting due to 11 previous errors; 1 warning emitted + +For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:9:1 + | +LL | static REF: &AtomicI32 = &AtomicI32::new(42); + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:14:1 + | +LL | static REFMUT: &mut i32 = &mut 0; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:20:1 + | +LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:25:1 + | +LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:43:1 + | +LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:47:1 + | +LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:51:1 + | +LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/miri_unleashed/static-no-inner-mut.64bit.stderr b/tests/ui/consts/miri_unleashed/static-no-inner-mut.64bit.stderr index e8ed6742fab3a..6542de10da993 100644 --- a/tests/ui/consts/miri_unleashed/static-no-inner-mut.64bit.stderr +++ b/tests/ui/consts/miri_unleashed/static-no-inner-mut.64bit.stderr @@ -3,42 +3,112 @@ error: encountered mutable pointer in final value of static | LL | static REF: &AtomicI32 = &AtomicI32::new(42); | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:9:1 + | +LL | static REF: &AtomicI32 = &AtomicI32::new(42); + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..v: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC0╼ │ ╾──────╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:10:1 + --> $DIR/static-no-inner-mut.rs:14:1 | LL | static REFMUT: &mut i32 = &mut 0; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:14:1 + | +LL | static REFMUT: &mut i32 = &mut 0; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC1╼ │ ╾──────╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:13:1 + --> $DIR/static-no-inner-mut.rs:20:1 | LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:20:1 + | +LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..v: encountered `UnsafeCell` in read-only memory + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC2╼ │ ╾──────╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:14:1 + --> $DIR/static-no-inner-mut.rs:25:1 | LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 + +error[E0080]: it is undefined behavior to use this value + --> $DIR/static-no-inner-mut.rs:25:1 + | +LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static` + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + = note: the raw bytes of the constant (size: 8, align: 8) { + ╾ALLOC3╼ │ ╾──────╼ + } error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:29:1 + --> $DIR/static-no-inner-mut.rs:43:1 | LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:31:1 + --> $DIR/static-no-inner-mut.rs:47:1 | LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 error: encountered mutable pointer in final value of static - --> $DIR/static-no-inner-mut.rs:33:1 + --> $DIR/static-no-inner-mut.rs:51:1 | LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 warning: skipping const checks | @@ -48,35 +118,141 @@ help: skipping check that does not even have a feature gate LL | static REF: &AtomicI32 = &AtomicI32::new(42); | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:10:27 + --> $DIR/static-no-inner-mut.rs:14:27 | LL | static REFMUT: &mut i32 = &mut 0; | ^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:13:56 + --> $DIR/static-no-inner-mut.rs:20:56 | LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; | ^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:14:44 + --> $DIR/static-no-inner-mut.rs:25:44 | LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; | ^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:29:52 + --> $DIR/static-no-inner-mut.rs:43:52 | LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:31:51 + --> $DIR/static-no-inner-mut.rs:47:51 | LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/static-no-inner-mut.rs:33:52 + --> $DIR/static-no-inner-mut.rs:51:52 | LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; | ^^^^^^ -error: aborting due to 7 previous errors; 1 warning emitted +error: aborting due to 11 previous errors; 1 warning emitted + +For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:9:1 + | +LL | static REF: &AtomicI32 = &AtomicI32::new(42); + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:14:1 + | +LL | static REFMUT: &mut i32 = &mut 0; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:20:1 + | +LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:25:1 + | +LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:43:1 + | +LL | static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:47:1 + | +LL | static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: encountered mutable pointer in final value of static + --> $DIR/static-no-inner-mut.rs:51:1 + | +LL | static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: 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 #122153 +note: the lint level is defined here + --> $DIR/static-no-inner-mut.rs:6:9 + | +LL | #![deny(const_eval_mutable_ptr_in_final_value)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/miri_unleashed/static-no-inner-mut.rs b/tests/ui/consts/miri_unleashed/static-no-inner-mut.rs index a4033eb56834e..8e8a14d12480f 100644 --- a/tests/ui/consts/miri_unleashed/static-no-inner-mut.rs +++ b/tests/ui/consts/miri_unleashed/static-no-inner-mut.rs @@ -3,15 +3,29 @@ #![feature(const_refs_to_cell, const_mut_refs)] // All "inner" allocations that come with a `static` are interned immutably. This means it is // crucial that we do not accept any form of (interior) mutability there. - +#![deny(const_eval_mutable_ptr_in_final_value)] use std::sync::atomic::*; -static REF: &AtomicI32 = &AtomicI32::new(42); //~ERROR mutable pointer in final value -static REFMUT: &mut i32 = &mut 0; //~ERROR mutable pointer in final value +static REF: &AtomicI32 = &AtomicI32::new(42); +//~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value + +static REFMUT: &mut i32 = &mut 0; +//~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value // Different way of writing this that avoids promotion. -static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; //~ERROR mutable pointer in final value -static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; //~ERROR mutable pointer in final value +static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}}; +//~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value + +static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}}; +//~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler +//~| ERROR it is undefined behavior to use this value // This one is obvious, since it is non-Sync. (It also suppresses the other errors, so it is // commented out.) @@ -28,9 +42,14 @@ unsafe impl Sync for SyncPtr {} // non-dangling raw pointers. static RAW_SYNC: SyncPtr = SyncPtr { x: &AtomicI32::new(42) }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + static RAW_MUT_CAST: SyncPtr = SyncPtr { x : &mut 42 as *mut _ as *const _ }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler + static RAW_MUT_COERCE: SyncPtr = SyncPtr { x: &mut 0 }; //~^ ERROR mutable pointer in final value +//~| WARNING this was previously accepted by the compiler fn main() {} From 2ade18afe83b7bbba2491fbaf561f6d025f47a5f Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 11 Mar 2024 11:16:23 -0400 Subject: [PATCH 28/42] Added an "Explanation" header and expanded that section for the newly added lint. (cherry picked from commit 6ca46daded8320dffe437b9008c2b353563af0a5) --- compiler/rustc_lint_defs/src/builtin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 050478149b0a6..3506040c33462 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -2928,10 +2928,18 @@ declare_lint! { /// } /// ``` /// + /// ### Explanation + /// + /// In the 1.77 release, the const evaluation machinery adopted some + /// stricter rules to reject expressions with values that could + /// end up holding mutable references to state stored in static memory + /// (which is inherently immutable). + /// /// This is a [future-incompatible] lint to ease the transition to an error. /// See [issue #122153] for more details. /// /// [issue #122153]: https://github.com/rust-lang/rust/issues/122153 + /// [future-incompatible]: ../index.md#future-incompatible-lints pub CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE, Warn, "detects a mutable pointer that has leaked into final value of a const expression", From 6b0992faa301ff8ccb280c0acc96fdbd5732aab5 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Mon, 11 Mar 2024 15:33:17 -0500 Subject: [PATCH 29/42] Add produces as tidy requires (cherry picked from commit ae374cf04a30eac81de24c4fbdfb4d1c7f4f34e4) --- compiler/rustc_lint_defs/src/builtin.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 3506040c33462..c178359cbc874 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -2928,6 +2928,8 @@ declare_lint! { /// } /// ``` /// + /// {{produces}} + /// /// ### Explanation /// /// In the 1.77 release, the const evaluation machinery adopted some From 58b55f582e10b1c572361979bb2e361ee55d5570 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 17 Mar 2024 10:39:13 -0400 Subject: [PATCH 30/42] Switch channel to stable --- src/ci/channel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/channel b/src/ci/channel index 65b2df87f7df3..2bf5ad0447d33 100644 --- a/src/ci/channel +++ b/src/ci/channel @@ -1 +1 @@ -beta +stable From 50b8779cb45f4a1e7dc95bb4b9d027bc55889e21 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 17 Mar 2024 13:40:05 -0400 Subject: [PATCH 31/42] Cherry pick release notes --- RELEASES.md | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 3fb74b52292c1..3f7814d184c66 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,213 @@ +Version 1.77.0 (2024-03-21) +========================== + + + +Language +-------- + +- [Reveal opaque types within the defining body for exhaustiveness checking.](https://github.com/rust-lang/rust/pull/116821/) +- [Stabilize C-string literals.](https://github.com/rust-lang/rust/pull/117472/) +- [Stabilize THIR unsafeck.](https://github.com/rust-lang/rust/pull/117673/) +- [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/) +- [Support async recursive calls (as long as they have indirection).](https://github.com/rust-lang/rust/pull/117703/) +- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/) +- [Make inductive cycles in coherence ambiguous always.](https://github.com/rust-lang/rust/pull/118649/) +- [Get rid of type-driven traversal in const-eval interning](https://github.com/rust-lang/rust/pull/119044/), + only as a [future compatiblity lint](https://github.com/rust-lang/rust/pull/122204) for now. +- [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/) + + + +Compiler +-------- + +- [Include lint `soft_unstable` in future breakage reports.](https://github.com/rust-lang/rust/pull/116274/) +- [Make `i128` and `u128` 16-byte aligned on x86-based targets.](https://github.com/rust-lang/rust/pull/116672/) +- [Use `--verbose` in diagnostic output.](https://github.com/rust-lang/rust/pull/119129/) +- [Improve spacing between printed tokens.](https://github.com/rust-lang/rust/pull/120227/) +- [Merge the `unused_tuple_struct_fields` lint into `dead_code`.](https://github.com/rust-lang/rust/pull/118297/) +- [Error on incorrect implied bounds in well-formedness check](https://github.com/rust-lang/rust/pull/118553/), + with a temporary exception for Bevy. +- [Fix coverage instrumentation/reports for non-ASCII source code.](https://github.com/rust-lang/rust/pull/119033/) +- [Fix `fn`/`const` items implied bounds and well-formedness check.](https://github.com/rust-lang/rust/pull/120019/) +- [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.](https://github.com/rust-lang/rust/pull/118704/) +- Add several new tier 3 targets: + - [`aarch64-unknown-illumos`](https://github.com/rust-lang/rust/pull/112936/) + - [`hexagon-unknown-none-elf`](https://github.com/rust-lang/rust/pull/117601/) + - [`riscv32imafc-esp-espidf`](https://github.com/rust-lang/rust/pull/119738/) + - [`riscv32im-risc0-zkvm-elf`](https://github.com/rust-lang/rust/pull/117958/) + +Refer to Rust's [platform support page][platform-support-doc] +for more information on Rust's tiered platform support. + + + +Libraries +--------- + +- [Implement `From<&[T; N]>` for `Cow<[T]>`.](https://github.com/rust-lang/rust/pull/113489/) +- [Remove special-case handling of `vec.split_off(0)`.](https://github.com/rust-lang/rust/pull/119917/) + + + +Stabilized APIs +--------------- + +- [`array::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref) +- [`array::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut) +- [`core::net`](https://doc.rust-lang.org/stable/core/net/index.html) +- [`f32::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even) +- [`f64::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even) +- [`mem::offset_of!`](https://doc.rust-lang.org/stable/std/mem/macro.offset_of.html) +- [`slice::first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk) +- [`slice::first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk_mut) +- [`slice::split_first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk) +- [`slice::split_first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk_mut) +- [`slice::last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk) +- [`slice::last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk_mut) +- [`slice::split_last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk) +- [`slice::split_last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk_mut) +- [`slice::chunk_by`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by) +- [`slice::chunk_by_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by_mut) +- [`Bound::map`](https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.map) +- [`File::create_new`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.create_new) +- [`Mutex::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.clear_poison) +- [`RwLock::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.clear_poison) + + + +Cargo +----- + +- [Extend the build directive syntax with `cargo::`.](https://github.com/rust-lang/cargo/pull/12201/) +- [Stabilize metadata `id` format as `PackageIDSpec`.](https://github.com/rust-lang/cargo/pull/12914/) +- [Pull out as `cargo-util-schemas` as a crate.](https://github.com/rust-lang/cargo/pull/13178/) +- [Strip all debuginfo when debuginfo is not requested.](https://github.com/rust-lang/cargo/pull/13257/) +- [Inherit jobserver from env for all kinds of runners.](https://github.com/rust-lang/cargo/pull/12776/) +- [Deprecate rustc plugin support in cargo.](https://github.com/rust-lang/cargo/pull/13248/) + + + +Rustdoc +----- + +- [Allows links in markdown headings.](https://github.com/rust-lang/rust/pull/117662/) +- [Search for tuples and unit by type with `()`.](https://github.com/rust-lang/rust/pull/118194/) +- [Clean up the source sidebar's hide button.](https://github.com/rust-lang/rust/pull/119066/) +- [Prevent JS injection from `localStorage`.](https://github.com/rust-lang/rust/pull/120250/) + + + +Misc +---- + +- [Recommend version-sorting for all sorting in style guide.](https://github.com/rust-lang/rust/pull/115046/) + + + +Internal Changes +---------------- + +These changes do not affect any public interfaces of Rust, but they represent +significant improvements to the performance or internals of rustc and related +tools. + +- [Add more weirdness to `weird-exprs.rs`.](https://github.com/rust-lang/rust/pull/119028/) + +Version 1.76.0 (2024-02-08) +========================== + + + +Language +-------- +- [Document Rust ABI compatibility between various types](https://github.com/rust-lang/rust/pull/115476/) +- [Also: guarantee that char and u32 are ABI-compatible](https://github.com/rust-lang/rust/pull/118032/) +- [Add lint `ambiguous_wide_pointer_comparisons` that supersedes `clippy::vtable_address_comparisons`](https://github.com/rust-lang/rust/pull/117758) + + + +Compiler +-------- +- [Lint pinned `#[must_use]` pointers (in particular, `Box` where `T` is `#[must_use]`) in `unused_must_use`.](https://github.com/rust-lang/rust/pull/118054/) +- [Soundness fix: fix computing the offset of an unsized field in a packed struct](https://github.com/rust-lang/rust/pull/118540/) +- [Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail](https://github.com/rust-lang/rust/pull/118538/) +- [Add `$message_type` field to distinguish json diagnostic outputs](https://github.com/rust-lang/rust/pull/115691/) +- [Enable Rust to use the EHCont security feature of Windows](https://github.com/rust-lang/rust/pull/118013/) +- [Add tier 3 {x86_64,i686}-win7-windows-msvc targets](https://github.com/rust-lang/rust/pull/118150/) +- [Add tier 3 aarch64-apple-watchos target](https://github.com/rust-lang/rust/pull/119074/) +- [Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets](https://github.com/rust-lang/rust/pull/115526/) + +Refer to Rust's [platform support page][platform-support-doc] +for more information on Rust's tiered platform support. + + + +Libraries +--------- +- [Add a column number to `dbg!()`](https://github.com/rust-lang/rust/pull/114962/) +- [Add `std::hash::{DefaultHasher, RandomState}` exports](https://github.com/rust-lang/rust/pull/115694/) +- [Fix rounding issue with exponents in fmt](https://github.com/rust-lang/rust/pull/116301/) +- [Add T: ?Sized to `RwLockReadGuard` and `RwLockWriteGuard`'s Debug impls.](https://github.com/rust-lang/rust/pull/117138/) +- [Windows: Allow `File::create` to work on hidden files](https://github.com/rust-lang/rust/pull/116438/) + + + +Stabilized APIs +--------------- + +- [`Arc::unwrap_or_clone`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.unwrap_or_clone) +- [`Rc::unwrap_or_clone`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.unwrap_or_clone) +- [`Result::inspect`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect) +- [`Result::inspect_err`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect_err) +- [`Option::inspect`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.inspect) +- [`type_name_of_val`](https://doc.rust-lang.org/stable/std/any/fn.type_name_of_val.html) +- [`std::hash::{DefaultHasher, RandomState}`](https://doc.rust-lang.org/stable/std/hash/index.html#structs) + These were previously available only through `std::collections::hash_map`. +- [`ptr::{from_ref, from_mut}`](https://doc.rust-lang.org/stable/std/ptr/fn.from_ref.html) +- [`ptr::addr_eq`](https://doc.rust-lang.org/stable/std/ptr/fn.addr_eq.html) + + + +Cargo +----- + +See [Cargo release notes](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-176-2024-02-08). + + + +Rustdoc +------- + +- [Don't merge cfg and doc(cfg) attributes for re-exports](https://github.com/rust-lang/rust/pull/113091/) +- [rustdoc: allow resizing the sidebar / hiding the top bar](https://github.com/rust-lang/rust/pull/115660/) +- [rustdoc-search: add support for traits and associated types](https://github.com/rust-lang/rust/pull/116085/) +- [rustdoc: Add highlighting for comments in items declaration](https://github.com/rust-lang/rust/pull/117869/) + + + +Compatibility Notes +------------------- +- [Add allow-by-default lint for unit bindings](https://github.com/rust-lang/rust/pull/112380/) + This is expected to be upgraded to a warning by default in a future Rust + release. Some macros emit bindings with type `()` with user-provided spans, + which means that this lint will warn for user code. +- [Remove x86_64-sun-solaris target.](https://github.com/rust-lang/rust/pull/118091/) +- [Remove asmjs-unknown-emscripten target](https://github.com/rust-lang/rust/pull/117338/) +- [Report errors in jobserver inherited through environment variables](https://github.com/rust-lang/rust/pull/113730/) + This [may warn](https://github.com/rust-lang/rust/issues/120515) on benign problems too. +- [Update the minimum external LLVM to 16.](https://github.com/rust-lang/rust/pull/117947/) +- [Improve `print_tts`](https://github.com/rust-lang/rust/pull/114571/) + This change can break some naive manual parsing of token trees in proc macro + code which expect a particular structure after `.to_string()`, rather than just arbitrary Rust code. +- [Make `IMPLIED_BOUNDS_ENTAILMENT` into a hard error from a lint](https://github.com/rust-lang/rust/pull/117984/) +- [Vec's allocation behavior was changed when collecting some iterators](https://github.com/rust-lang/rust/pull/110353) + Allocation behavior is currently not specified, nevertheless changes can be surprising. + See [`impl FromIterator for Vec`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#impl-FromIterator%3CT%3E-for-Vec%3CT%3E) + for more details. +- [Properly reject `default` on free const items](https://github.com/rust-lang/rust/pull/117818/) + Version 1.75.0 (2023-12-28) ========================== From af4c9c135a674db5c7faaebbc4f5f66a0abb8f3b Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Tue, 26 Mar 2024 15:33:11 -0400 Subject: [PATCH 32/42] [stable-1.77] cargo backport --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index 3fe68eabf93cb..e52e360061cac 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 3fe68eabf93cbf3772bbcad09a9206c783e2de3f +Subproject commit e52e360061cacbbeac79f7f1215a7a90b6f08442 From dcb198695fa9be6fda82198d4f53676a5f84edf5 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 18 Mar 2024 08:56:12 -0700 Subject: [PATCH 33/42] Fix heading anchors in doc pages. --- src/doc/rust.css | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/doc/rust.css b/src/doc/rust.css index e0bf64c33bcf0..a93c1be7d7a9e 100644 --- a/src/doc/rust.css +++ b/src/doc/rust.css @@ -136,6 +136,28 @@ h1 a:link, h1 a:visited, h2 a:link, h2 a:visited, h3 a:link, h3 a:visited, h4 a:link, h4 a:visited, h5 a:link, h5 a:visited {color: black;} +h1, h2, h3, h4, h5 { + /* This is needed to be able to position the doc-anchor. Ideally there + would be a
around the whole document, but we don't have that. */ + position: relative; +} + +a.doc-anchor { + color: black; + display: none; + position: absolute; + left: -20px; + /* We add this padding so that when the cursor moves from the heading's text to the anchor, + the anchor doesn't disappear. */ + padding-right: 5px; + /* And this padding is used to make the anchor larger and easier to click on. */ + padding-left: 3px; +} +*:hover > .doc-anchor { + display: block; +} + + /* Code */ pre, code { From 42c356d3ee820ff4ea437f9304263c1ea668173c Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 26 Mar 2024 19:33:12 -0400 Subject: [PATCH 34/42] Prepare 1.77.1 --- RELEASES.md | 10 ++++++++++ src/version | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 3f7814d184c66..29fe44a872310 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,13 @@ +Version 1.77.1 (2024-03-28) +=========================== + + + +- [Revert stripping debuginfo by default for Windows](https://github.com/rust-lang/cargo/pull/13654) + This fixes a regression in 1.77 by reverting to the previous default. + Platforms other than Windows are not affected. +- Internal: [Fix heading anchor rendering in doc pages](https://github.com/rust-lang/rust/pull/122693) + Version 1.77.0 (2024-03-21) ========================== diff --git a/src/version b/src/version index 79e15fd49370a..b1131583c6752 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -1.77.0 +1.77.1 From f6870bd63c91a4011d3b9525241f80ee01772120 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Tue, 30 Jan 2024 11:25:35 -0300 Subject: [PATCH 35/42] Disallow or quote all specials in bat args --- library/std/src/sys/pal/windows/args.rs | 105 +++++++++++++++++++++--- tests/ui/std/windows-bat-args.rs | 90 ++++++++++++++++++++ tests/ui/std/windows-bat-args1.bat | 1 + tests/ui/std/windows-bat-args2.bat | 1 + tests/ui/std/windows-bat-args3.bat | 1 + 5 files changed, 186 insertions(+), 12 deletions(-) create mode 100644 tests/ui/std/windows-bat-args.rs create mode 100644 tests/ui/std/windows-bat-args1.bat create mode 100644 tests/ui/std/windows-bat-args2.bat create mode 100644 tests/ui/std/windows-bat-args3.bat diff --git a/library/std/src/sys/pal/windows/args.rs b/library/std/src/sys/pal/windows/args.rs index fbbdbc2126595..48bcb89e669ee 100644 --- a/library/std/src/sys/pal/windows/args.rs +++ b/library/std/src/sys/pal/windows/args.rs @@ -7,7 +7,7 @@ mod tests; use super::os::current_exe; -use crate::ffi::OsString; +use crate::ffi::{OsStr, OsString}; use crate::fmt; use crate::io; use crate::num::NonZeroU16; @@ -17,6 +17,7 @@ use crate::sys::path::get_long_path; use crate::sys::process::ensure_no_nuls; use crate::sys::{c, to_u16s}; use crate::sys_common::wstr::WStrUnits; +use crate::sys_common::AsInner; use crate::vec; use crate::iter; @@ -262,16 +263,92 @@ pub(crate) fn append_arg(cmd: &mut Vec, arg: &Arg, force_quotes: bool) -> i Ok(()) } +fn append_bat_arg(cmd: &mut Vec, arg: &OsStr, mut quote: bool) -> io::Result<()> { + ensure_no_nuls(arg)?; + // If an argument has 0 characters then we need to quote it to ensure + // that it actually gets passed through on the command line or otherwise + // it will be dropped entirely when parsed on the other end. + // + // We also need to quote the argument if it ends with `\` to guard against + // bat usage such as `"%~2"` (i.e. force quote arguments) otherwise a + // trailing slash will escape the closing quote. + if arg.is_empty() || arg.as_encoded_bytes().last() == Some(&b'\\') { + quote = true; + } + for cp in arg.as_inner().inner.code_points() { + if let Some(cp) = cp.to_char() { + // Rather than trying to find every ascii symbol that must be quoted, + // we assume that all ascii symbols must be quoted unless they're known to be good. + // We also quote Unicode control blocks for good measure. + // Note an unquoted `\` is fine so long as the argument isn't otherwise quoted. + static UNQUOTED: &str = r"#$*+-./:?@\_"; + let ascii_needs_quotes = + cp.is_ascii() && !(cp.is_ascii_alphanumeric() || UNQUOTED.contains(cp)); + if ascii_needs_quotes || cp.is_control() { + quote = true; + } + } + } + + if quote { + cmd.push('"' as u16); + } + // Loop through the string, escaping `\` only if followed by `"`. + // And escaping `"` by doubling them. + let mut backslashes: usize = 0; + for x in arg.encode_wide() { + if x == '\\' as u16 { + backslashes += 1; + } else { + if x == '"' as u16 { + // Add n backslashes to total 2n before internal `"`. + cmd.extend((0..backslashes).map(|_| '\\' as u16)); + // Appending an additional double-quote acts as an escape. + cmd.push(b'"' as u16) + } else if x == '%' as u16 || x == '\r' as u16 { + // yt-dlp hack: replaces `%` with `%%cd:~,%` to stop %VAR% being expanded as an environment variable. + // + // # Explanation + // + // cmd supports extracting a substring from a variable using the following syntax: + // %variable:~start_index,end_index% + // + // In the above command `cd` is used as the variable and the start_index and end_index are left blank. + // `cd` is a built-in variable that dynamically expands to the current directory so it's always available. + // Explicitly omitting both the start and end index creates a zero-length substring. + // + // Therefore it all resolves to nothing. However, by doing this no-op we distract cmd.exe + // from potentially expanding %variables% in the argument. + cmd.extend_from_slice(&[ + '%' as u16, '%' as u16, 'c' as u16, 'd' as u16, ':' as u16, '~' as u16, + ',' as u16, + ]); + } + backslashes = 0; + } + cmd.push(x); + } + if quote { + // Add n backslashes to total 2n before ending `"`. + cmd.extend((0..backslashes).map(|_| '\\' as u16)); + cmd.push('"' as u16); + } + Ok(()) +} + pub(crate) fn make_bat_command_line( script: &[u16], args: &[Arg], force_quotes: bool, ) -> io::Result> { + const INVALID_ARGUMENT_ERROR: io::Error = + io::const_io_error!(io::ErrorKind::InvalidInput, r#"batch file arguments are invalid"#); // Set the start of the command line to `cmd.exe /c "` // It is necessary to surround the command in an extra pair of quotes, // hence the trailing quote here. It will be closed after all arguments // have been added. - let mut cmd: Vec = "cmd.exe /d /c \"".encode_utf16().collect(); + // Using /e:ON enables "command extensions" which is essential for the `%` hack to work. + let mut cmd: Vec = "cmd.exe /e:ON /v:OFF /d /c \"".encode_utf16().collect(); // Push the script name surrounded by its quote pair. cmd.push(b'"' as u16); @@ -291,18 +368,22 @@ pub(crate) fn make_bat_command_line( // reconstructed by the batch script by default. for arg in args { cmd.push(' ' as u16); - // Make sure to always quote special command prompt characters, including: - // * Characters `cmd /?` says require quotes. - // * `%` for environment variables, as in `%TMP%`. - // * `|<>` pipe/redirect characters. - const SPECIAL: &[u8] = b"\t &()[]{}^=;!'+,`~%|<>"; - let force_quotes = match arg { - Arg::Regular(arg) if !force_quotes => { - arg.as_encoded_bytes().iter().any(|c| SPECIAL.contains(c)) + match arg { + Arg::Regular(arg_os) => { + let arg_bytes = arg_os.as_encoded_bytes(); + // Disallow \r and \n as they may truncate the arguments. + const DISALLOWED: &[u8] = b"\r\n"; + if arg_bytes.iter().any(|c| DISALLOWED.contains(c)) { + return Err(INVALID_ARGUMENT_ERROR); + } + append_bat_arg(&mut cmd, arg_os, force_quotes)?; + } + _ => { + // Raw arguments are passed on as-is. + // It's the user's responsibility to properly handle arguments in this case. + append_arg(&mut cmd, arg, force_quotes)?; } - _ => force_quotes, }; - append_arg(&mut cmd, arg, force_quotes)?; } // Close the quote we left opened earlier. diff --git a/tests/ui/std/windows-bat-args.rs b/tests/ui/std/windows-bat-args.rs new file mode 100644 index 0000000000000..d2d5fe76c84d5 --- /dev/null +++ b/tests/ui/std/windows-bat-args.rs @@ -0,0 +1,90 @@ +// only-windows +// run-pass +// run-flags:--parent-process + +use std::env; +use std::io::ErrorKind::{self, InvalidInput}; +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn main() { + if env::args().nth(1).as_deref() == Some("--parent-process") { + parent(); + } else { + child(); + } +} + +fn child() { + if env::args().len() == 1 { + panic!("something went wrong :/"); + } + for arg in env::args().skip(1) { + print!("{arg}\0"); + } +} + +fn parent() { + let mut bat = PathBuf::from(file!()); + bat.set_file_name("windows-bat-args1.bat"); + let bat1 = String::from(bat.to_str().unwrap()); + bat.set_file_name("windows-bat-args2.bat"); + let bat2 = String::from(bat.to_str().unwrap()); + bat.set_file_name("windows-bat-args3.bat"); + let bat3 = String::from(bat.to_str().unwrap()); + let bat = [bat1.as_str(), bat2.as_str(), bat3.as_str()]; + + check_args(&bat, &["a", "b"]).unwrap(); + check_args(&bat, &["c is for cat", "d is for dog"]).unwrap(); + check_args(&bat, &["\"", " \""]).unwrap(); + check_args(&bat, &["\\", "\\"]).unwrap(); + check_args(&bat, &[">file.txt"]).unwrap(); + check_args(&bat, &["whoami.exe"]).unwrap(); + check_args(&bat, &["&a.exe"]).unwrap(); + check_args(&bat, &["&echo hello "]).unwrap(); + check_args(&bat, &["&echo hello", "&whoami", ">file.txt"]).unwrap(); + check_args(&bat, &["!TMP!"]).unwrap(); + check_args(&bat, &["key=value"]).unwrap(); + check_args(&bat, &["\"key=value\""]).unwrap(); + check_args(&bat, &["key = value"]).unwrap(); + check_args(&bat, &["key=[\"value\"]"]).unwrap(); + check_args(&bat, &["", "a=b"]).unwrap(); + check_args(&bat, &["key=\"foo bar\""]).unwrap(); + check_args(&bat, &["key=[\"my_value]"]).unwrap(); + check_args(&bat, &["key=[\"my_value\",\"other-value\"]"]).unwrap(); + check_args(&bat, &["key\\=value"]).unwrap(); + check_args(&bat, &["key=\"&whoami\""]).unwrap(); + check_args(&bat, &["key=\"value\"=5"]).unwrap(); + check_args(&bat, &["key=[\">file.txt\"]"]).unwrap(); + assert_eq!(check_args(&bat, &["\n"]), Err(InvalidInput)); + assert_eq!(check_args(&bat, &["\r"]), Err(InvalidInput)); + check_args(&bat, &["%hello"]).unwrap(); + check_args(&bat, &["%PATH%"]).unwrap(); + check_args(&bat, &["%%cd:~,%"]).unwrap(); + check_args(&bat, &["%PATH%PATH%"]).unwrap(); + check_args(&bat, &["\">file.txt"]).unwrap(); + check_args(&bat, &["abc\"&echo hello"]).unwrap(); + check_args(&bat, &["123\">file.txt"]).unwrap(); + check_args(&bat, &["\"&echo hello&whoami.exe"]).unwrap(); + check_args(&bat, &[r#"hello^"world"#, "hello &echo oh no >file.txt"]).unwrap(); +} + +// Check if the arguments roundtrip through a bat file and back into a Rust process. +// Our Rust process outptuts the arguments as null terminated strings. +#[track_caller] +fn check_args(bats: &[&str], args: &[&str]) -> Result<(), ErrorKind> { + for bat in bats { + let output = Command::new(&bat).args(args).output().map_err(|e| e.kind())?; + assert!(output.status.success()); + let child_args = String::from_utf8(output.stdout).unwrap(); + let mut child_args: Vec<&str> = + child_args.strip_suffix('\0').unwrap().split('\0').collect(); + // args3.bat can append spurious empty arguments, so trim them here. + child_args.truncate( + child_args.iter().rposition(|s| !s.is_empty()).unwrap_or(child_args.len() - 1) + 1, + ); + assert_eq!(&child_args, &args); + assert!(!Path::new("file.txt").exists()); + } + Ok(()) +} diff --git a/tests/ui/std/windows-bat-args1.bat b/tests/ui/std/windows-bat-args1.bat new file mode 100644 index 0000000000000..edd36bd5530e9 --- /dev/null +++ b/tests/ui/std/windows-bat-args1.bat @@ -0,0 +1 @@ +@a.exe %* diff --git a/tests/ui/std/windows-bat-args2.bat b/tests/ui/std/windows-bat-args2.bat new file mode 100644 index 0000000000000..8d5a7dd8a9e00 --- /dev/null +++ b/tests/ui/std/windows-bat-args2.bat @@ -0,0 +1 @@ +@a.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/tests/ui/std/windows-bat-args3.bat b/tests/ui/std/windows-bat-args3.bat new file mode 100644 index 0000000000000..7fe360a6d36d0 --- /dev/null +++ b/tests/ui/std/windows-bat-args3.bat @@ -0,0 +1 @@ +@a.exe "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9" From ad13f26685d218f947263785470ff17ce1853b0a Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Wed, 31 Jan 2024 08:13:38 -0300 Subject: [PATCH 36/42] Document Windows argument splitting --- library/std/src/os/windows/process.rs | 56 ++++++++++++++++++- library/std/src/process.rs | 79 +++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 2 deletions(-) diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs index 5bf0154eae306..19a593c4ab997 100644 --- a/library/std/src/os/windows/process.rs +++ b/library/std/src/os/windows/process.rs @@ -196,8 +196,60 @@ pub trait CommandExt: Sealed { /// Append literal text to the command line without any quoting or escaping. /// - /// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow - /// `CommandLineToArgvW` escaping rules. + /// This is useful for passing arguments to applications which doesn't follow + /// the standard C run-time escaping rules, such as `cmd.exe /c`. + /// + /// # Bat files + /// + /// Note the `cmd /c` command line has slightly different escaping rules then bat files + /// themselves. If possible, it may be better to write complex arguments to a temporary + /// .bat file, with appropriate escaping, and simply run that using: + /// + /// ```no_run + /// # use std::process::Command; + /// # let temp_bat_file = ""; + /// # #[allow(unused)] + /// let output = Command::new("cmd").args(["/c", &format!("\"{temp_bat_file}\"")]).output(); + /// ``` + /// + /// # Example + /// + /// Run a bat script using both trusted and untrusted arguments. + /// + /// ```no_run + /// #[cfg(windows)] + /// // `my_script_path` is a path to known bat file. + /// // `user_name` is an untrusted name given by the user. + /// fn run_script( + /// my_script_path: &str, + /// user_name: &str, + /// ) -> Result { + /// use std::io::{Error, ErrorKind}; + /// use std::os::windows::process::CommandExt; + /// use std::process::Command; + /// + /// // Create the command line, making sure to quote the script path. + /// // This assumes the fixed arguments have been tested to work with the script we're using. + /// let mut cmd_args = format!(r#""{my_script_path}" "--features=[a,b,c]""#); + /// + /// // Make sure the user name is safe. In particular we need to be + /// // cautious of ascii symbols that cmd may interpret specially. + /// // Here we only allow alphanumeric characters. + /// if !user_name.chars().all(|c| c.is_alphanumeric()) { + /// return Err(Error::new(ErrorKind::InvalidInput, "invalid user name")); + /// } + /// // now we've checked the user name, let's add that too. + /// cmd_args.push(' '); + /// cmd_args.push_str(&format!("--user {user_name}")); + /// + /// // call cmd.exe and return the output + /// Command::new("cmd.exe") + /// .arg("/c") + /// // surround the entire command in an extra pair of quotes, as required by cmd.exe. + /// .raw_arg(&format!("\"{cmd_args}\"")) + /// .output() + /// } + /// ```` #[stable(feature = "windows_process_extensions_raw_arg", since = "1.62.0")] fn raw_arg>(&mut self, text_to_append_as_is: S) -> &mut process::Command; diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 4a7f5d8e0bee6..b98ed05c394bd 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -88,6 +88,47 @@ //! assert_eq!(b"test", output.stdout.as_slice()); //! ``` //! +//! # Windows argument splitting +//! +//! On Unix systems arguments are passed to a new process as an array of strings +//! but on Windows arguments are passed as a single commandline string and it's +//! up to the child process to parse it into an array. Therefore the parent and +//! child processes must agree on how the commandline string is encoded. +//! +//! Most programs use the standard C run-time `argv`, which in practice results +//! in consistent argument handling. However some programs have their own way of +//! parsing the commandline string. In these cases using [`arg`] or [`args`] may +//! result in the child process seeing a different array of arguments then the +//! parent process intended. +//! +//! Two ways of mitigating this are: +//! +//! * Validate untrusted input so that only a safe subset is allowed. +//! * Use [`raw_arg`] to build a custom commandline. This bypasses the escaping +//! rules used by [`arg`] so should be used with due caution. +//! +//! `cmd.exe` and `.bat` use non-standard argument parsing and are especially +//! vulnerable to malicious input as they may be used to run arbitrary shell +//! commands. Untrusted arguments should be restricted as much as possible. +//! For examples on handling this see [`raw_arg`]. +//! +//! ### Bat file special handling +//! +//! On Windows, `Command` uses the Windows API function [`CreateProcessW`] to +//! spawn new processes. An undocumented feature of this function is that, +//! when given a `.bat` file as the application to run, it will automatically +//! convert that into running `cmd.exe /c` with the bat file as the next argument. +//! +//! For historical reasons Rust currently preserves this behaviour when using +//! [`Command::new`], and escapes the arguments according to `cmd.exe` rules. +//! Due to the complexity of `cmd.exe` argument handling, it might not be +//! possible to safely escape some special chars, and using them will result +//! in an error being returned at process spawn. The set of unescapeable +//! special chars might change between releases. +//! +//! Also note that running `.bat` scripts in this way may be removed in the +//! future and so should not be relied upon. +//! //! [`spawn`]: Command::spawn //! [`output`]: Command::output //! @@ -97,6 +138,12 @@ //! //! [`Write`]: io::Write //! [`Read`]: io::Read +//! +//! [`arg`]: Command::arg +//! [`args`]: Command::args +//! [`raw_arg`]: crate::os::windows::process::CommandExt::raw_arg +//! +//! [`CreateProcessW`]: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw #![stable(feature = "process", since = "1.0.0")] #![deny(unsafe_op_in_unsafe_fn)] @@ -611,6 +658,22 @@ impl Command { /// escaped characters, word splitting, glob patterns, variable substitution, etc. /// have no effect. /// + ///
+ /// + /// On Windows use caution with untrusted inputs. Most applications use the + /// standard convention for decoding arguments passed to them. These are safe to use with `arg`. + /// However some applications, such as `cmd.exe` and `.bat` files, use a non-standard way of decoding arguments + /// and are therefore vulnerable to malicious input. + /// In the case of `cmd.exe` this is especially important because a malicious argument can potentially run arbitrary shell commands. + /// + /// See [Windows argument splitting][windows-args] for more details + /// or [`raw_arg`] for manually implementing non-standard argument encoding. + /// + /// [`raw_arg`]: crate::os::windows::process::CommandExt::raw_arg + /// [windows-args]: crate::process#windows-argument-splitting + /// + ///
+ /// /// # Examples /// /// Basic usage: @@ -641,6 +704,22 @@ impl Command { /// escaped characters, word splitting, glob patterns, variable substitution, etc. /// have no effect. /// + ///
+ /// + /// On Windows use caution with untrusted inputs. Most applications use the + /// standard convention for decoding arguments passed to them. These are safe to use with `args`. + /// However some applications, such as `cmd.exe` and `.bat` files, use a non-standard way of decoding arguments + /// and are therefore vulnerable to malicious input. + /// In the case of `cmd.exe` this is especially important because a malicious argument can potentially run arbitrary shell commands. + /// + /// See [Windows argument splitting][windows-args] for more details + /// or [`raw_arg`] for manually implementing non-standard argument encoding. + /// + /// [`raw_arg`]: crate::os::windows::process::CommandExt::raw_arg + /// [windows-args]: crate::process#windows-argument-splitting + /// + ///
+ /// /// # Examples /// /// Basic usage: From 27775172054161bb120a750158f40cabe68ae9fc Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:54:20 +0100 Subject: [PATCH 37/42] Update ninja on Windows Errors started showing up, and I read somewhere that this might be because of old ninja versions. This ninja version is indeed *ancient*. ``` multiple outputs aren't (yet?) supported by depslog; bring this up on the mailing list if it affects you ``` --- src/ci/scripts/install-ninja.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/scripts/install-ninja.sh b/src/ci/scripts/install-ninja.sh index 5145a03e353de..23cbc2eb6d107 100755 --- a/src/ci/scripts/install-ninja.sh +++ b/src/ci/scripts/install-ninja.sh @@ -8,7 +8,7 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" if isWindows; then mkdir ninja - curl -o ninja.zip "${MIRRORS_BASE}/2017-03-15-ninja-win.zip" + curl -o ninja.zip "${MIRRORS_BASE}/2024-03-28-v1.11.1-ninja-win.zip" 7z x -oninja ninja.zip rm ninja.zip ciCommandSetEnv "RUST_CONFIGURE_ARGS" "${RUST_CONFIGURE_ARGS} --enable-ninja" From 5babeca9080daf17ba84bb0e496fbb0ef98adeae Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 9 Apr 2024 01:11:34 +0200 Subject: [PATCH 38/42] update release notes --- RELEASES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 29fe44a872310..574739b2d2ad6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,10 @@ +Version 1.77.2 (2024-04-09) +=========================== + + + +- [CVE-2024-24576: fix escaping of Windows batch file arguments in `std::process::Command`](https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html) + Version 1.77.1 (2024-03-28) =========================== From 664d1223bb9a0b933bc7f9d4f4382c804e2e0cb2 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 9 Apr 2024 01:11:49 +0200 Subject: [PATCH 39/42] bump version to 1.77.2 --- src/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version b/src/version index b1131583c6752..369f9966f67c1 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -1.77.1 +1.77.2 From e7b09f5bf6a8d71c391713cd55935a9468009d52 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 9 Apr 2024 18:15:43 +0100 Subject: [PATCH 40/42] allow the test bat files in tidy --- src/tools/tidy/src/ui_tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 451276b5ac157..1538a1b8d51ae 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -43,6 +43,9 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[ "tests/ui/shell-argfiles/shell-argfiles-badquotes.args", // passing args via a file "tests/ui/shell-argfiles/shell-argfiles-via-argfile-shell.args", // passing args via a file "tests/ui/shell-argfiles/shell-argfiles-via-argfile.args", // passing args via a file + "tests/ui/std/windows-bat-args1.bat", // tests escaping arguments through batch files + "tests/ui/std/windows-bat-args2.bat", // tests escaping arguments through batch files + "tests/ui/std/windows-bat-args3.bat", // tests escaping arguments through batch files ]; fn check_entries(tests_path: &Path, bad: &mut bool) { From 70acf29a45f9160542248d22c594c83059a42d9a Mon Sep 17 00:00:00 2001 From: K4sum1 Date: Tue, 9 Jul 2024 04:49:24 -0500 Subject: [PATCH 41/42] Commit custom config.toml --- .gitignore | 1 - config.toml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 config.toml diff --git a/.gitignore b/.gitignore index 485968d9c56ff..1e81f0de3b287 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,6 @@ Session.vim !/tests/run-make/thumb-none-qemu/example/.cargo ## Configuration -/config.toml /Makefile config.mk config.stamp diff --git a/config.toml b/config.toml new file mode 100644 index 0000000000000..fefe068e42c5c --- /dev/null +++ b/config.toml @@ -0,0 +1,61 @@ +change-id = 118703 + +[llvm] +# They deleted llvm wtf +download-ci-llvm = false +optimize = true +thin-lto = true +link-shared = false +ninja = true +targets = "X86" +link-jobs = 0 +cflags = "-Qunused-arguments -O2 -msse2 /clang:-O3" +cxxflags = "-Qunused-arguments -O2 -msse2 /clang:-O3" +ldflags = "-Wl,-O3 -msse2" +polly = true +clang = true +clang-cl = "C:/Program Files/LLVM/bin/clang-cl.exe" + +[build] +build-stage = 2 +cargo-native-static = false +# When compiling from source, you usually want all tools. +#extended = true +build = "x86_64-pc-windows-msvc" +target = [ + "i686-pc-windows-msvc", + "x86_64-pc-windows-msvc", +] + +docs = false +tools = [ + "src", +] + +[rust] +channel = "dev" +codegen-backends = ["llvm"] +codegen-units = 1 +codegen-units-std = 1 +debug = false +dist-src = false +download-rustc = false +#jemalloc = true +#lto = "thin" +optimize = 3 +parallel-compiler = true +strip = true +optimize-tests = true +thin-lto-import-instr-limit = 100 +validate-mir-opts = 3 +use-lld = "self-contained" + +[dist] +src-tarball = false +compression-profile = "best" +missing-tools = true + +# for creating a downloadable package: python x.py install, then create an archive this +[install] +prefix = "../dist/rust" +sysconfdir = "." From a824ab0d6e35ed36c9cf82f8c7192d04109ca1d9 Mon Sep 17 00:00:00 2001 From: K4sum1 Date: Sat, 27 Jul 2024 07:16:36 -0500 Subject: [PATCH 42/42] Goofy ahh TryAcquireSRWLock workaround (I forgor to commit) --- library/std/src/sys/pal/windows/c.rs | 13 +++++++++++++ library/std/src/sys/pal/windows/c/windows_sys.rs | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 1a59ac9a9cadf..21000033e47bc 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -29,6 +29,9 @@ pub type WORD = u16; pub type CHAR = c_char; pub type ULONG = c_ulong; pub type ACCESS_MASK = DWORD; +pub type BOOLEAN = i32; +pub const TRUE: BOOLEAN = 1; +pub const FALSE: BOOLEAN = 0; pub type LPCVOID = *const c_void; pub type LPHANDLE = *mut HANDLE; @@ -234,6 +237,16 @@ pub unsafe extern "system" fn ReadFileEx( ) } +pub unsafe fn TryAcquireSRWLockExclusive(srwlock: *mut SRWLOCK) -> BOOLEAN { + AcquireSRWLockExclusive(srwlock); + TRUE // Always return TRUE for blocking lock +} + +pub unsafe fn TryAcquireSRWLockShared(srwlock: *mut SRWLOCK) -> BOOLEAN { + AcquireSRWLockShared(srwlock); + TRUE // Always return TRUE for blocking lock +} + // POSIX compatibility shims. pub unsafe fn recv(socket: SOCKET, buf: *mut c_void, len: c_int, flags: c_int) -> c_int { windows_sys::recv(socket, buf.cast::(), len, flags) diff --git a/library/std/src/sys/pal/windows/c/windows_sys.rs b/library/std/src/sys/pal/windows/c/windows_sys.rs index b38b70c8983e6..ed4c17b98248f 100644 --- a/library/std/src/sys/pal/windows/c/windows_sys.rs +++ b/library/std/src/sys/pal/windows/c/windows_sys.rs @@ -569,14 +569,6 @@ extern "system" { pub fn TlsSetValue(dwtlsindex: u32, lptlsvalue: *const ::core::ffi::c_void) -> BOOL; } #[link(name = "kernel32")] -extern "system" { - pub fn TryAcquireSRWLockExclusive(srwlock: *mut SRWLOCK) -> BOOLEAN; -} -#[link(name = "kernel32")] -extern "system" { - pub fn TryAcquireSRWLockShared(srwlock: *mut SRWLOCK) -> BOOLEAN; -} -#[link(name = "kernel32")] extern "system" { pub fn UpdateProcThreadAttribute( lpattributelist: LPPROC_THREAD_ATTRIBUTE_LIST,