Skip to content

Commit eff24c0

Browse files
committed
Auto merge of rust-lang#112066 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] 1.71.0 branch * Swap out CURRENT_RUSTC_VERSION markers * Bump CI channel * Backport rust-lang#112026 r? `@Mark-Simulacrum`
2 parents cca7ee5 + f4e9379 commit eff24c0

File tree

17 files changed

+65
-42
lines changed

17 files changed

+65
-42
lines changed

compiler/rustc_feature/src/accepted.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ declare_features! (
131131
/// Allows `crate` in paths.
132132
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
133133
/// Allows using `#[debugger_visualizer]` attribute.
134-
(accepted, debugger_visualizer, "CURRENT_RUSTC_VERSION", Some(95939), None),
134+
(accepted, debugger_visualizer, "1.71.0", Some(95939), None),
135135
/// Allows rustc to inject a default alloc_error_handler
136136
(accepted, default_alloc_error_handler, "1.68.0", Some(66741), None),
137137
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
@@ -281,7 +281,7 @@ declare_features! (
281281
/// Allows use of the postfix `?` operator in expressions.
282282
(accepted, question_mark, "1.13.0", Some(31436), None),
283283
/// Allows the use of raw-dylibs (RFC 2627).
284-
(accepted, raw_dylib, "CURRENT_RUSTC_VERSION", Some(58713), None),
284+
(accepted, raw_dylib, "1.71.0", Some(58713), None),
285285
/// Allows keywords to be escaped for use as identifiers.
286286
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
287287
/// Allows relaxing the coherence rules such that

compiler/rustc_feature/src/active.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ declare_features! (
165165
/// Allows the `multiple_supertrait_upcastable` lint.
166166
(active, multiple_supertrait_upcastable, "1.69.0", None, None),
167167
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
168-
(incomplete, negative_bounds, "CURRENT_RUSTC_VERSION", None, None),
168+
(incomplete, negative_bounds, "1.71.0", None, None),
169169
/// Allows using `#[omit_gdb_pretty_printer_section]`.
170170
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
171171
/// Allows using `#[prelude_import]` on glob `use` items.
@@ -314,15 +314,15 @@ declare_features! (
314314
/// Allows async functions to be declared, implemented, and used in traits.
315315
(active, async_fn_in_trait, "1.66.0", Some(91611), None),
316316
/// Allows builtin # foo() syntax
317-
(active, builtin_syntax, "CURRENT_RUSTC_VERSION", Some(110680), None),
317+
(active, builtin_syntax, "1.71.0", Some(110680), None),
318318
/// Allows `c"foo"` literals.
319-
(active, c_str_literals, "CURRENT_RUSTC_VERSION", Some(105723), None),
319+
(active, c_str_literals, "1.71.0", Some(105723), None),
320320
/// Treat `extern "C"` function as nounwind.
321321
(active, c_unwind, "1.52.0", Some(74990), None),
322322
/// Allows using C-variadics.
323323
(active, c_variadic, "1.34.0", Some(44930), None),
324324
/// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
325-
(active, cfg_overflow_checks, "CURRENT_RUSTC_VERSION", Some(111466), None),
325+
(active, cfg_overflow_checks, "1.71.0", Some(111466), None),
326326
/// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used.
327327
(active, cfg_sanitize, "1.41.0", Some(39699), None),
328328
/// Allows `cfg(target_abi = "...")`.
@@ -338,7 +338,7 @@ declare_features! (
338338
/// Allow conditional compilation depending on rust version
339339
(active, cfg_version, "1.45.0", Some(64796), None),
340340
/// Allows to use the `#[cfi_encoding = ""]` attribute.
341-
(active, cfi_encoding, "CURRENT_RUSTC_VERSION", Some(89653), None),
341+
(active, cfi_encoding, "1.71.0", Some(89653), None),
342342
/// Allows `for<...>` on closures and generators.
343343
(active, closure_lifetime_binder, "1.64.0", Some(97362), None),
344344
/// Allows `#[track_caller]` on closures and generators.

compiler/rustc_mir_transform/src/check_alignment.rs

+8
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ struct PointerFinder<'tcx, 'a> {
7575
}
7676

7777
impl<'tcx, 'a> Visitor<'tcx> for PointerFinder<'tcx, 'a> {
78+
fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
79+
if let Rvalue::AddressOf(..) = rvalue {
80+
// Ignore dereferences inside of an AddressOf
81+
return;
82+
}
83+
self.super_rvalue(rvalue, location);
84+
}
85+
7886
fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: Location) {
7987
if let PlaceContext::NonUse(_) = context {
8088
return;

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ impl ToString for String {
26242624
}
26252625

26262626
#[cfg(not(no_global_oom_handling))]
2627-
#[stable(feature = "fmt_arguments_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2627+
#[stable(feature = "fmt_arguments_to_string_specialization", since = "1.71.0")]
26282628
impl ToString for fmt::Arguments<'_> {
26292629
#[inline]
26302630
fn to_string(&self) -> String {

library/core/src/ffi/c_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ impl CStr {
531531
/// # }
532532
/// ```
533533
#[inline]
534-
#[stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
535-
#[rustc_const_stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
534+
#[stable(feature = "cstr_is_empty", since = "1.71.0")]
535+
#[rustc_const_stable(feature = "cstr_is_empty", since = "1.71.0")]
536536
pub const fn is_empty(&self) -> bool {
537537
// SAFETY: We know there is at least one byte; for empty strings it
538538
// is the NUL terminator.

library/core/src/hash/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub trait BuildHasher {
695695
/// bh.hash_one(&OrderAmbivalentPair(2, 10))
696696
/// );
697697
/// ```
698-
#[stable(feature = "build_hasher_simple_hash_one", since = "CURRENT_RUSTC_VERSION")]
698+
#[stable(feature = "build_hasher_simple_hash_one", since = "1.71.0")]
699699
fn hash_one<T: Hash>(&self, x: T) -> u64
700700
where
701701
Self: Sized,

library/core/src/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ extern "rust-intrinsic" {
22602260
/// This intrinsic can *only* be called where the pointer is a local without
22612261
/// projections (`read_via_copy(ptr)`, not `read_via_copy(*ptr)`) so that it
22622262
/// trivially obeys runtime-MIR rules about derefs in operands.
2263-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
2263+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
22642264
#[rustc_nounwind]
22652265
pub fn read_via_copy<T>(ptr: *const T) -> T;
22662266

library/core/src/num/nonzero.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ macro_rules! nonzero_signed_operations {
769769
/// ```
770770
#[must_use]
771771
#[inline]
772-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
773-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
772+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
773+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
774774
pub const fn is_positive(self) -> bool {
775775
self.get().is_positive()
776776
}
@@ -794,8 +794,8 @@ macro_rules! nonzero_signed_operations {
794794
/// ```
795795
#[must_use]
796796
#[inline]
797-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
798-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
797+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
798+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
799799
pub const fn is_negative(self) -> bool {
800800
self.get().is_negative()
801801
}
@@ -819,8 +819,8 @@ macro_rules! nonzero_signed_operations {
819819
/// # }
820820
/// ```
821821
#[inline]
822-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
823-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
822+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
823+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
824824
pub const fn checked_neg(self) -> Option<$Ty> {
825825
if let Some(result) = self.get().checked_neg() {
826826
// SAFETY: negation of nonzero cannot yield zero values.
@@ -851,8 +851,8 @@ macro_rules! nonzero_signed_operations {
851851
/// # }
852852
/// ```
853853
#[inline]
854-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
855-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
854+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
855+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
856856
pub const fn overflowing_neg(self) -> ($Ty, bool) {
857857
let (result, overflow) = self.get().overflowing_neg();
858858
// SAFETY: negation of nonzero cannot yield zero values.
@@ -884,8 +884,8 @@ macro_rules! nonzero_signed_operations {
884884
/// # }
885885
/// ```
886886
#[inline]
887-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
888-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
887+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
888+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
889889
pub const fn saturating_neg(self) -> $Ty {
890890
if let Some(result) = self.checked_neg() {
891891
return result;
@@ -916,16 +916,16 @@ macro_rules! nonzero_signed_operations {
916916
/// # }
917917
/// ```
918918
#[inline]
919-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
920-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
919+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
920+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
921921
pub const fn wrapping_neg(self) -> $Ty {
922922
let result = self.get().wrapping_neg();
923923
// SAFETY: negation of nonzero cannot yield zero values.
924924
unsafe { $Ty::new_unchecked(result) }
925925
}
926926
}
927927

928-
#[stable(feature = "signed_nonzero_neg", since = "CURRENT_RUSTC_VERSION")]
928+
#[stable(feature = "signed_nonzero_neg", since = "1.71.0")]
929929
impl Neg for $Ty {
930930
type Output = $Ty;
931931

@@ -937,7 +937,7 @@ macro_rules! nonzero_signed_operations {
937937
}
938938

939939
forward_ref_unop! { impl Neg, neg for $Ty,
940-
#[stable(feature = "signed_nonzero_neg", since = "CURRENT_RUSTC_VERSION")] }
940+
#[stable(feature = "signed_nonzero_neg", since = "1.71.0")] }
941941
)+
942942
}
943943
}

library/core/src/ptr/const_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ impl<T: ?Sized> *const T {
11951195
///
11961196
/// [`ptr::read`]: crate::ptr::read()
11971197
#[stable(feature = "pointer_methods", since = "1.26.0")]
1198-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1198+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
11991199
#[inline]
12001200
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12011201
pub const unsafe fn read(self) -> T
@@ -1236,7 +1236,7 @@ impl<T: ?Sized> *const T {
12361236
///
12371237
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
12381238
#[stable(feature = "pointer_methods", since = "1.26.0")]
1239-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1239+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
12401240
#[inline]
12411241
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12421242
pub const unsafe fn read_unaligned(self) -> T

library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
11391139
/// [valid]: self#safety
11401140
#[inline]
11411141
#[stable(feature = "rust1", since = "1.0.0")]
1142-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1142+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
11431143
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
11441144
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
11451145
pub const unsafe fn read<T>(src: *const T) -> T {
@@ -1256,7 +1256,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
12561256
/// ```
12571257
#[inline]
12581258
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
1259-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1259+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
12601260
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
12611261
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12621262
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {

library/core/src/ptr/mut_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ impl<T: ?Sized> *mut T {
13051305
///
13061306
/// [`ptr::read`]: crate::ptr::read()
13071307
#[stable(feature = "pointer_methods", since = "1.26.0")]
1308-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1308+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
13091309
#[inline(always)]
13101310
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
13111311
pub const unsafe fn read(self) -> T
@@ -1346,7 +1346,7 @@ impl<T: ?Sized> *mut T {
13461346
///
13471347
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
13481348
#[stable(feature = "pointer_methods", since = "1.26.0")]
1349-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1349+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
13501350
#[inline(always)]
13511351
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
13521352
pub const unsafe fn read_unaligned(self) -> T

library/core/src/slice/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ impl<T> [T] {
18541854
/// }
18551855
/// ```
18561856
#[stable(feature = "rust1", since = "1.0.0")]
1857-
#[rustc_const_stable(feature = "const_slice_split_at_not_mut", since = "CURRENT_RUSTC_VERSION")]
1857+
#[rustc_const_stable(feature = "const_slice_split_at_not_mut", since = "1.71.0")]
18581858
#[rustc_allow_const_fn_unstable(slice_split_at_unchecked)]
18591859
#[inline]
18601860
#[track_caller]

library/core/src/tuple.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ macro_rules! tuple_impls {
100100
}
101101
}
102102

103-
#[stable(feature = "array_tuple_conv", since = "CURRENT_RUSTC_VERSION")]
103+
#[stable(feature = "array_tuple_conv", since = "1.71.0")]
104104
impl<T> From<[T; ${count(T)}]> for ($(${ignore(T)} T,)+) {
105105
#[inline]
106106
#[allow(non_snake_case)]
@@ -110,7 +110,7 @@ macro_rules! tuple_impls {
110110
}
111111
}
112112

113-
#[stable(feature = "array_tuple_conv", since = "CURRENT_RUSTC_VERSION")]
113+
#[stable(feature = "array_tuple_conv", since = "1.71.0")]
114114
impl<T> From<($(${ignore(T)} T,)+)> for [T; ${count(T)}] {
115115
#[inline]
116116
#[allow(non_snake_case)]

library/std/src/os/windows/io/handle.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl<T: AsHandle> AsHandle for &mut T {
437437
}
438438
}
439439

440-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
440+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
441441
/// This impl allows implementing traits that require `AsHandle` on Arc.
442442
/// ```
443443
/// # #[cfg(windows)] mod group_cfg {
@@ -457,15 +457,15 @@ impl<T: AsHandle> AsHandle for crate::sync::Arc<T> {
457457
}
458458
}
459459

460-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
460+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
461461
impl<T: AsHandle> AsHandle for crate::rc::Rc<T> {
462462
#[inline]
463463
fn as_handle(&self) -> BorrowedHandle<'_> {
464464
(**self).as_handle()
465465
}
466466
}
467467

468-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
468+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
469469
impl<T: AsHandle> AsHandle for Box<T> {
470470
#[inline]
471471
fn as_handle(&self) -> BorrowedHandle<'_> {

library/std/src/os/windows/io/socket.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl<T: AsSocket> AsSocket for &mut T {
254254
}
255255
}
256256

257-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
257+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
258258
/// This impl allows implementing traits that require `AsSocket` on Arc.
259259
/// ```
260260
/// # #[cfg(windows)] mod group_cfg {
@@ -274,15 +274,15 @@ impl<T: AsSocket> AsSocket for crate::sync::Arc<T> {
274274
}
275275
}
276276

277-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
277+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
278278
impl<T: AsSocket> AsSocket for crate::rc::Rc<T> {
279279
#[inline]
280280
fn as_socket(&self) -> BorrowedSocket<'_> {
281281
(**self).as_socket()
282282
}
283283
}
284284

285-
#[stable(feature = "as_windows_ptrs", since = "CURRENT_RUSTC_VERSION")]
285+
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
286286
impl<T: AsSocket> AsSocket for Box<T> {
287287
#[inline]
288288
fn as_socket(&self) -> BorrowedSocket<'_> {

src/ci/channel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly
1+
beta

tests/ui/mir/addrof_alignment.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// run-pass
2+
// ignore-wasm32-bare: No panic messages
3+
// compile-flags: -C debug-assertions
4+
5+
struct Misalignment {
6+
a: u32,
7+
}
8+
9+
fn main() {
10+
let items: [Misalignment; 2] = [Misalignment { a: 0 }, Misalignment { a: 1 }];
11+
unsafe {
12+
let ptr: *const Misalignment = items.as_ptr().cast::<u8>().add(1).cast::<Misalignment>();
13+
let _ptr = core::ptr::addr_of!((*ptr).a);
14+
}
15+
}

0 commit comments

Comments
 (0)