Skip to content

Commit e69d216

Browse files
committed
Sync from rust 43a2e9d
2 parents 92e5c1a + a2797e5 commit e69d216

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

example/mini_core.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -624,25 +624,25 @@ pub mod intrinsics {
624624
#[rustc_intrinsic]
625625
pub fn size_of<T>() -> usize;
626626
#[rustc_intrinsic]
627-
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize;
627+
pub unsafe fn size_of_val<T: ?::Sized>(val: *const T) -> usize;
628628
#[rustc_intrinsic]
629629
pub fn min_align_of<T>() -> usize;
630630
#[rustc_intrinsic]
631-
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize;
631+
pub unsafe fn min_align_of_val<T: ?::Sized>(val: *const T) -> usize;
632632
#[rustc_intrinsic]
633-
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize);
633+
pub unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize);
634634
#[rustc_intrinsic]
635-
pub unsafe fn transmute<T, U>(_e: T) -> U;
635+
pub unsafe fn transmute<T, U>(e: T) -> U;
636636
#[rustc_intrinsic]
637-
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
637+
pub unsafe fn ctlz_nonzero<T>(x: T) -> u32;
638638
#[rustc_intrinsic]
639639
pub fn needs_drop<T: ?::Sized>() -> bool;
640640
#[rustc_intrinsic]
641-
pub fn bitreverse<T>(_x: T) -> T;
641+
pub fn bitreverse<T>(x: T) -> T;
642642
#[rustc_intrinsic]
643-
pub fn bswap<T>(_x: T) -> T;
643+
pub fn bswap<T>(x: T) -> T;
644644
#[rustc_intrinsic]
645-
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize);
645+
pub unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
646646
#[rustc_intrinsic]
647647
pub unsafe fn unreachable() -> !;
648648
}

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

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From ad7ffe71baba46865f2e65266ab025920dfdc20b Mon Sep 17 00:00:00 2001
1+
From 5d7c709608b01301d4628d2159265936d4440b67 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
33
Date: Thu, 18 Feb 2021 18:45:28 +0100
44
Subject: [PATCH] Disable 128bit atomic operations
@@ -7,11 +7,10 @@ Cranelift doesn't support them yet
77
---
88
library/core/src/panic/unwind_safe.rs | 6 -----
99
library/core/src/sync/atomic.rs | 38 ---------------------------
10-
library/core/tests/atomic.rs | 4 ---
11-
4 files changed, 4 insertions(+), 50 deletions(-)
10+
2 files changed, 44 deletions(-)
1211

1312
diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs
14-
index 092b7cf..158cf71 100644
13+
index a60f0799c0e..af056fbf41f 100644
1514
--- a/library/core/src/panic/unwind_safe.rs
1615
+++ b/library/core/src/panic/unwind_safe.rs
1716
@@ -216,9 +216,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {}
@@ -21,7 +20,7 @@ index 092b7cf..158cf71 100644
2120
-#[cfg(target_has_atomic_load_store = "128")]
2221
-#[unstable(feature = "integer_atomics", issue = "99069")]
2322
-impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {}
24-
23+
2524
#[cfg(target_has_atomic_load_store = "ptr")]
2625
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
2726
@@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {}
@@ -31,14 +30,14 @@ index 092b7cf..158cf71 100644
3130
-#[cfg(target_has_atomic_load_store = "128")]
3231
-#[unstable(feature = "integer_atomics", issue = "99069")]
3332
-impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {}
34-
33+
3534
#[cfg(target_has_atomic_load_store = "8")]
3635
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
3736
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
38-
index d9de37e..8293fce 100644
37+
index bf2b6d59f88..d5ccce03bbf 100644
3938
--- a/library/core/src/sync/atomic.rs
4039
+++ b/library/core/src/sync/atomic.rs
41-
@@ -2996,44 +2996,6 @@ atomic_int! {
40+
@@ -3585,44 +3585,6 @@ pub const fn as_ptr(&self) -> *mut $int_type {
4241
8,
4342
u64 AtomicU64
4443
}
@@ -54,7 +53,7 @@ index d9de37e..8293fce 100644
5453
- unstable(feature = "integer_atomics", issue = "99069"),
5554
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
5655
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
57-
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicI128"),
56+
- rustc_diagnostic_item = "AtomicI128",
5857
- "i128",
5958
- "#![feature(integer_atomics)]\n\n",
6059
- atomic_min, atomic_max,
@@ -73,7 +72,7 @@ index d9de37e..8293fce 100644
7372
- unstable(feature = "integer_atomics", issue = "99069"),
7473
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
7574
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
76-
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicU128"),
75+
- rustc_diagnostic_item = "AtomicU128",
7776
- "u128",
7877
- "#![feature(integer_atomics)]\n\n",
7978
- atomic_umin, atomic_umax,
@@ -83,7 +82,6 @@ index d9de37e..8293fce 100644
8382

8483
#[cfg(target_has_atomic_load_store = "ptr")]
8584
macro_rules! atomic_int_ptr_sized {
86-
( $($target_pointer_width:literal $align:literal)* ) => { $(
87-
--
88-
2.26.2.7.g19db9cfb68
85+
--
86+
2.48.1
8987

src/intrinsics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10311031

10321032
let layout = src.layout();
10331033
match layout.ty.kind() {
1034-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1034+
ty::Int(_) => {}
10351035
_ => {
10361036
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10371037
return Ok(());
@@ -1052,7 +1052,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10521052

10531053
let layout = src.layout();
10541054
match layout.ty.kind() {
1055-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1055+
ty::Uint(_) => {}
10561056
_ => {
10571057
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10581058
return Ok(());
@@ -1073,7 +1073,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10731073

10741074
let layout = src.layout();
10751075
match layout.ty.kind() {
1076-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1076+
ty::Int(_) => {}
10771077
_ => {
10781078
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10791079
return Ok(());
@@ -1094,7 +1094,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10941094

10951095
let layout = src.layout();
10961096
match layout.ty.kind() {
1097-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1097+
ty::Uint(_) => {}
10981098
_ => {
10991099
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
11001100
return Ok(());

0 commit comments

Comments
 (0)