Skip to content

Commit 63734fc

Browse files
committed
Rustup to rustc 1.62.0-nightly (70b3681 2022-05-14)
1 parent e5ff9f1 commit 63734fc

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

patches/0027-sysroot-128bit-atomic-operations.patch

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ index 092b7cf..158cf71 100644
2121
-#[cfg(target_has_atomic_load_store = "128")]
2222
-#[unstable(feature = "integer_atomics", issue = "32976")]
2323
-impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {}
24-
24+
2525
#[cfg(target_has_atomic_load_store = "ptr")]
2626
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
2727
@@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {}
@@ -31,14 +31,14 @@ index 092b7cf..158cf71 100644
3131
-#[cfg(target_has_atomic_load_store = "128")]
3232
-#[unstable(feature = "integer_atomics", issue = "32976")]
3333
-impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {}
34-
34+
3535
#[cfg(target_has_atomic_load_store = "8")]
3636
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
3737
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
3838
index d9de37e..8293fce 100644
3939
--- a/library/core/src/sync/atomic.rs
4040
+++ b/library/core/src/sync/atomic.rs
41-
@@ -2234,44 +2234,6 @@ atomic_int! {
41+
@@ -2234,46 +2234,6 @@ atomic_int! {
4242
"AtomicU64::new(0)",
4343
u64 AtomicU64 ATOMIC_U64_INIT
4444
}
@@ -54,6 +54,7 @@ index d9de37e..8293fce 100644
5454
- unstable(feature = "integer_atomics", issue = "32976"),
5555
- rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
5656
- unstable(feature = "integer_atomics", issue = "32976"),
57+
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicI128"),
5758
- "i128",
5859
- "#![feature(integer_atomics)]\n\n",
5960
- atomic_min, atomic_max,
@@ -73,6 +74,7 @@ index d9de37e..8293fce 100644
7374
- unstable(feature = "integer_atomics", issue = "32976"),
7475
- rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
7576
- unstable(feature = "integer_atomics", issue = "32976"),
77+
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicU128"),
7678
- "u128",
7779
- "#![feature(integer_atomics)]\n\n",
7880
- atomic_umin, atomic_umax,
@@ -98,6 +100,6 @@ index b735957..ea728b6 100644
98100
#[cfg(target_has_atomic = "ptr")]
99101
assert_eq!(align_of::<AtomicUsize>(), size_of::<AtomicUsize>());
100102
#[cfg(target_has_atomic = "ptr")]
101-
--
103+
--
102104
2.26.2.7.g19db9cfb68
103105

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2022-05-07"
2+
channel = "nightly-2022-05-15"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/intrinsics/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -715,19 +715,19 @@ fn codegen_regular_intrinsic_call<'tcx>(
715715

716716
ptr_offset_from | ptr_offset_from_unsigned, (v ptr, v base) {
717717
let ty = substs.type_at(0);
718-
let isize_layout = fx.layout_of(fx.tcx.types.isize);
719718

720719
let pointee_size: u64 = fx.layout_of(ty).size.bytes();
721720
let diff_bytes = fx.bcx.ins().isub(ptr, base);
722721
// FIXME this can be an exact division.
723-
let diff = if intrinsic == sym::ptr_offset_from_unsigned {
722+
let val = if intrinsic == sym::ptr_offset_from_unsigned {
723+
let usize_layout = fx.layout_of(fx.tcx.types.usize);
724724
// Because diff_bytes ULE isize::MAX, this would be fine as signed,
725725
// but unsigned is slightly easier to codegen, so might as well.
726-
fx.bcx.ins().udiv_imm(diff_bytes, pointee_size as i64)
726+
CValue::by_val(fx.bcx.ins().udiv_imm(diff_bytes, pointee_size as i64), usize_layout)
727727
} else {
728-
fx.bcx.ins().sdiv_imm(diff_bytes, pointee_size as i64)
728+
let isize_layout = fx.layout_of(fx.tcx.types.isize);
729+
CValue::by_val(fx.bcx.ins().sdiv_imm(diff_bytes, pointee_size as i64), isize_layout)
729730
};
730-
let val = CValue::by_val(diff, isize_layout);
731731
ret.write_cvalue(fx, val);
732732
};
733733

0 commit comments

Comments
 (0)