Skip to content

Commit c87004a

Browse files
committed
Auto merge of rust-lang#131078 - tgross35:rollup-66to2u9, r=tgross35
Rollup of 5 pull requests Successful merges: - rust-lang#129638 (Hook up std::net to wasi-libc on wasm32-wasip2 target) - rust-lang#130877 (rustc_target: Add RISC-V atomic-related features) - rust-lang#130914 (Mark some more types as having insignificant dtor) - rust-lang#130961 (Enable `f16` tests on x86 Apple platforms) - rust-lang#130966 (make ptr metadata functions callable from stable const fn) r? `@ghost` `@rustbot` modify labels: rollup
2 parents fb4aebd + a063759 commit c87004a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+604
-84
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+4
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
264264
("riscv32" | "riscv64", "unaligned-scalar-mem") if get_version().0 == 18 => {
265265
Some(LLVMFeature::new("fast-unaligned-access"))
266266
}
267+
// Filter out features that are not supported by the current LLVM version
268+
("riscv32" | "riscv64", "zaamo") if get_version().0 < 19 => None,
269+
("riscv32" | "riscv64", "zabha") if get_version().0 < 19 => None,
270+
("riscv32" | "riscv64", "zalrsc") if get_version().0 < 19 => None,
267271
// Enable the evex512 target feature if an avx512 target feature is enabled.
268272
("x86", s) if s.starts_with("avx512") => {
269273
Some(LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512")))

compiler/rustc_target/src/target_features.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ const MIPS_ALLOWED_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
373373

374374
const RISCV_ALLOWED_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
375375
// tidy-alphabetical-start
376-
("a", Stable, &[]),
376+
("a", Stable, &["zaamo", "zalrsc"]),
377377
("c", Stable, &[]),
378378
("d", Unstable(sym::riscv_target_feature), &["f"]),
379379
("e", Unstable(sym::riscv_target_feature), &[]),
@@ -382,6 +382,9 @@ const RISCV_ALLOWED_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
382382
("relax", Unstable(sym::riscv_target_feature), &[]),
383383
("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]),
384384
("v", Unstable(sym::riscv_target_feature), &[]),
385+
("zaamo", Unstable(sym::riscv_target_feature), &[]),
386+
("zabha", Unstable(sym::riscv_target_feature), &["zaamo"]),
387+
("zalrsc", Unstable(sym::riscv_target_feature), &[]),
385388
("zba", Stable, &[]),
386389
("zbb", Stable, &[]),
387390
("zbc", Stable, &[]),

library/alloc/src/boxed.rs

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ mod thin;
228228
#[lang = "owned_box"]
229229
#[fundamental]
230230
#[stable(feature = "rust1", since = "1.0.0")]
231+
#[rustc_insignificant_dtor]
231232
// The declaration of the `Box` struct must be kept in sync with the
232233
// compiler or ICEs will happen.
233234
pub struct Box<

library/alloc/src/ffi/c_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ impl CString {
696696
// memory-unsafe code from working by accident. Inline
697697
// to prevent LLVM from optimizing it away in debug builds.
698698
#[stable(feature = "cstring_drop", since = "1.13.0")]
699+
#[rustc_insignificant_dtor]
699700
impl Drop for CString {
700701
#[inline]
701702
fn drop(&mut self) {

library/alloc/src/sync.rs

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ macro_rules! acquire {
237237
/// [rc_examples]: crate::rc#examples
238238
#[cfg_attr(not(test), rustc_diagnostic_item = "Arc")]
239239
#[stable(feature = "rust1", since = "1.0.0")]
240+
#[rustc_insignificant_dtor]
240241
pub struct Arc<
241242
T: ?Sized,
242243
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,

library/core/src/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3165,7 +3165,7 @@ pub const fn type_id<T: ?Sized + 'static>() -> u128 {
31653165
/// change the possible layouts of pointers.
31663166
#[rustc_nounwind]
31673167
#[unstable(feature = "core_intrinsics", issue = "none")]
3168-
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
3168+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
31693169
#[rustc_intrinsic]
31703170
#[rustc_intrinsic_must_be_overridden]
31713171
pub const fn aggregate_raw_ptr<P: AggregateRawPtr<D, Metadata = M>, D, M>(_data: D, _meta: M) -> P {
@@ -3190,7 +3190,7 @@ impl<P: ?Sized, T: ptr::Thin> AggregateRawPtr<*mut T> for *mut P {
31903190
/// This is used to implement functions like `ptr::metadata`.
31913191
#[rustc_nounwind]
31923192
#[unstable(feature = "core_intrinsics", issue = "none")]
3193-
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
3193+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
31943194
#[rustc_intrinsic]
31953195
#[rustc_intrinsic_must_be_overridden]
31963196
pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *const P) -> M {

library/core/src/ptr/const_ptr.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<T: ?Sized> *const T {
9292
/// }
9393
/// ```
9494
#[unstable(feature = "set_ptr_value", issue = "75091")]
95-
#[rustc_const_unstable(feature = "set_ptr_value", issue = "75091")]
95+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
9696
#[must_use = "returns a new pointer rather than modifying its argument"]
9797
#[inline]
9898
pub const fn with_metadata_of<U>(self, meta: *const U) -> *const U
@@ -412,7 +412,6 @@ impl<T: ?Sized> *const T {
412412
#[inline(always)]
413413
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
414414
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
415-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
416415
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
417416
pub const unsafe fn byte_offset(self, count: isize) -> Self {
418417
// SAFETY: the caller must uphold the safety contract for `offset`.
@@ -495,7 +494,6 @@ impl<T: ?Sized> *const T {
495494
#[inline(always)]
496495
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
497496
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
498-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
499497
pub const fn wrapping_byte_offset(self, count: isize) -> Self {
500498
self.cast::<u8>().wrapping_offset(count).with_metadata_of(self)
501499
}
@@ -645,7 +643,6 @@ impl<T: ?Sized> *const T {
645643
#[inline(always)]
646644
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
647645
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
648-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
649646
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
650647
pub const unsafe fn byte_offset_from<U: ?Sized>(self, origin: *const U) -> isize {
651648
// SAFETY: the caller must uphold the safety contract for `offset_from`.
@@ -873,7 +870,6 @@ impl<T: ?Sized> *const T {
873870
#[inline(always)]
874871
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
875872
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
876-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
877873
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
878874
pub const unsafe fn byte_add(self, count: usize) -> Self {
879875
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -956,7 +952,6 @@ impl<T: ?Sized> *const T {
956952
#[inline(always)]
957953
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
958954
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
959-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
960955
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
961956
pub const unsafe fn byte_sub(self, count: usize) -> Self {
962957
// SAFETY: the caller must uphold the safety contract for `sub`.
@@ -1039,7 +1034,6 @@ impl<T: ?Sized> *const T {
10391034
#[inline(always)]
10401035
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
10411036
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1042-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
10431037
pub const fn wrapping_byte_add(self, count: usize) -> Self {
10441038
self.cast::<u8>().wrapping_add(count).with_metadata_of(self)
10451039
}
@@ -1120,7 +1114,6 @@ impl<T: ?Sized> *const T {
11201114
#[inline(always)]
11211115
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
11221116
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1123-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
11241117
pub const fn wrapping_byte_sub(self, count: usize) -> Self {
11251118
self.cast::<u8>().wrapping_sub(count).with_metadata_of(self)
11261119
}
@@ -1554,7 +1547,6 @@ impl<T> *const [T] {
15541547
#[inline]
15551548
#[stable(feature = "slice_ptr_len", since = "1.79.0")]
15561549
#[rustc_const_stable(feature = "const_slice_ptr_len", since = "1.79.0")]
1557-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
15581550
pub const fn len(self) -> usize {
15591551
metadata(self)
15601552
}

library/core/src/ptr/metadata.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub trait Thin = Pointee<Metadata = ()>;
9292
///
9393
/// assert_eq!(std::ptr::metadata("foo"), 3_usize);
9494
/// ```
95-
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
95+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
9696
#[inline]
9797
pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
9898
ptr_metadata(ptr)
@@ -106,7 +106,7 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
106106
///
107107
/// [`slice::from_raw_parts`]: crate::slice::from_raw_parts
108108
#[unstable(feature = "ptr_metadata", issue = "81513")]
109-
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
109+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
110110
#[inline]
111111
pub const fn from_raw_parts<T: ?Sized>(
112112
data_pointer: *const impl Thin,
@@ -120,7 +120,7 @@ pub const fn from_raw_parts<T: ?Sized>(
120120
///
121121
/// See the documentation of [`from_raw_parts`] for more details.
122122
#[unstable(feature = "ptr_metadata", issue = "81513")]
123-
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
123+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
124124
#[inline]
125125
pub const fn from_raw_parts_mut<T: ?Sized>(
126126
data_pointer: *mut impl Thin,

library/core/src/ptr/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
599599
#[stable(feature = "rust1", since = "1.0.0")]
600600
#[rustc_promotable]
601601
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
602-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
603602
#[rustc_diagnostic_item = "ptr_null"]
604603
pub const fn null<T: ?Sized + Thin>() -> *const T {
605604
from_raw_parts(without_provenance::<()>(0), ())
@@ -625,7 +624,6 @@ pub const fn null<T: ?Sized + Thin>() -> *const T {
625624
#[stable(feature = "rust1", since = "1.0.0")]
626625
#[rustc_promotable]
627626
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
628-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
629627
#[rustc_diagnostic_item = "ptr_null_mut"]
630628
pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
631629
from_raw_parts_mut(without_provenance_mut::<()>(0), ())
@@ -949,7 +947,6 @@ pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
949947
#[inline]
950948
#[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
951949
#[rustc_const_stable(feature = "const_slice_from_raw_parts", since = "1.64.0")]
952-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
953950
#[rustc_diagnostic_item = "ptr_slice_from_raw_parts"]
954951
pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
955952
from_raw_parts(data, len)

library/core/src/ptr/mut_ptr.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<T: ?Sized> *mut T {
7474
/// }
7575
/// ```
7676
#[unstable(feature = "set_ptr_value", issue = "75091")]
77-
#[rustc_const_unstable(feature = "set_ptr_value", issue = "75091")]
77+
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
7878
#[must_use = "returns a new pointer rather than modifying its argument"]
7979
#[inline]
8080
pub const fn with_metadata_of<U>(self, meta: *const U) -> *mut U
@@ -412,7 +412,6 @@ impl<T: ?Sized> *mut T {
412412
#[inline(always)]
413413
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
414414
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
415-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
416415
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
417416
pub const unsafe fn byte_offset(self, count: isize) -> Self {
418417
// SAFETY: the caller must uphold the safety contract for `offset`.
@@ -492,7 +491,6 @@ impl<T: ?Sized> *mut T {
492491
#[inline(always)]
493492
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
494493
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
495-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
496494
pub const fn wrapping_byte_offset(self, count: isize) -> Self {
497495
self.cast::<u8>().wrapping_offset(count).with_metadata_of(self)
498496
}
@@ -808,7 +806,6 @@ impl<T: ?Sized> *mut T {
808806
#[inline(always)]
809807
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
810808
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
811-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
812809
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
813810
pub const unsafe fn byte_offset_from<U: ?Sized>(self, origin: *const U) -> isize {
814811
// SAFETY: the caller must uphold the safety contract for `offset_from`.
@@ -954,7 +951,6 @@ impl<T: ?Sized> *mut T {
954951
#[inline(always)]
955952
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
956953
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
957-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
958954
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
959955
pub const unsafe fn byte_add(self, count: usize) -> Self {
960956
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -1037,7 +1033,6 @@ impl<T: ?Sized> *mut T {
10371033
#[inline(always)]
10381034
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
10391035
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1040-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
10411036
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
10421037
pub const unsafe fn byte_sub(self, count: usize) -> Self {
10431038
// SAFETY: the caller must uphold the safety contract for `sub`.
@@ -1118,7 +1113,6 @@ impl<T: ?Sized> *mut T {
11181113
#[inline(always)]
11191114
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
11201115
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1121-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
11221116
pub const fn wrapping_byte_add(self, count: usize) -> Self {
11231117
self.cast::<u8>().wrapping_add(count).with_metadata_of(self)
11241118
}
@@ -1197,7 +1191,6 @@ impl<T: ?Sized> *mut T {
11971191
#[inline(always)]
11981192
#[stable(feature = "pointer_byte_offsets", since = "1.75.0")]
11991193
#[rustc_const_stable(feature = "const_pointer_byte_offsets", since = "1.75.0")]
1200-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
12011194
pub const fn wrapping_byte_sub(self, count: usize) -> Self {
12021195
self.cast::<u8>().wrapping_sub(count).with_metadata_of(self)
12031196
}
@@ -1804,7 +1797,6 @@ impl<T> *mut [T] {
18041797
#[inline(always)]
18051798
#[stable(feature = "slice_ptr_len", since = "1.79.0")]
18061799
#[rustc_const_stable(feature = "const_slice_ptr_len", since = "1.79.0")]
1807-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
18081800
pub const fn len(self) -> usize {
18091801
metadata(self)
18101802
}

library/core/src/ptr/non_null.rs

-2
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ impl<T: ?Sized> NonNull<T> {
567567
#[must_use]
568568
#[inline(always)]
569569
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
570-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
571570
#[stable(feature = "non_null_convenience", since = "1.80.0")]
572571
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
573572
pub const unsafe fn byte_add(self, count: usize) -> Self {
@@ -651,7 +650,6 @@ impl<T: ?Sized> NonNull<T> {
651650
#[must_use]
652651
#[inline(always)]
653652
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
654-
#[rustc_allow_const_fn_unstable(set_ptr_value)]
655653
#[stable(feature = "non_null_convenience", since = "1.80.0")]
656654
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
657655
pub const unsafe fn byte_sub(self, count: usize) -> Self {

library/core/src/slice/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ impl<T> [T] {
111111
#[lang = "slice_len_fn"]
112112
#[stable(feature = "rust1", since = "1.0.0")]
113113
#[rustc_const_stable(feature = "const_slice_len", since = "1.39.0")]
114-
#[rustc_allow_const_fn_unstable(ptr_metadata)]
115114
#[inline]
116115
#[must_use]
117116
pub const fn len(&self) -> usize {

library/std/build.rs

-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ fn main() {
102102
("arm64ec", _) => false,
103103
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
104104
("x86_64", "windows") => false,
105-
// Apple has a special ABI for `f16` that we do not yet support
106-
// FIXME(builtins): fixed by <https://github.com/rust-lang/compiler-builtins/pull/675>
107-
("x86" | "x86_64", _) if target_vendor == "apple" => false,
108105
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
109106
("csky", _) => false,
110107
("hexagon", _) => false,

library/std/src/collections/hash/map/tests.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,7 @@ mod test_extract_if {
10181018
}
10191019

10201020
#[test]
1021+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
10211022
fn drop_panic_leak() {
10221023
static PREDS: AtomicUsize = AtomicUsize::new(0);
10231024
static DROPS: AtomicUsize = AtomicUsize::new(0);
@@ -1047,6 +1048,7 @@ mod test_extract_if {
10471048
}
10481049

10491050
#[test]
1051+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
10501052
fn pred_panic_leak() {
10511053
static PREDS: AtomicUsize = AtomicUsize::new(0);
10521054
static DROPS: AtomicUsize = AtomicUsize::new(0);
@@ -1076,6 +1078,7 @@ mod test_extract_if {
10761078

10771079
// Same as above, but attempt to use the iterator again after the panic in the predicate
10781080
#[test]
1081+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
10791082
fn pred_panic_reuse() {
10801083
static PREDS: AtomicUsize = AtomicUsize::new(0);
10811084
static DROPS: AtomicUsize = AtomicUsize::new(0);

library/std/src/collections/hash/set/tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ fn test_extract_if() {
429429
}
430430

431431
#[test]
432+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
432433
fn test_extract_if_drop_panic_leak() {
433434
static PREDS: AtomicU32 = AtomicU32::new(0);
434435
static DROPS: AtomicU32 = AtomicU32::new(0);
@@ -459,6 +460,7 @@ fn test_extract_if_drop_panic_leak() {
459460
}
460461

461462
#[test]
463+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
462464
fn test_extract_if_pred_panic_leak() {
463465
static PREDS: AtomicU32 = AtomicU32::new(0);
464466
static DROPS: AtomicU32 = AtomicU32::new(0);

library/std/src/env/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::*;
22

33
#[test]
4-
#[cfg_attr(any(target_os = "emscripten", target_env = "sgx"), ignore)]
4+
#[cfg_attr(any(target_os = "emscripten", target_os = "wasi", target_env = "sgx"), ignore)]
55
fn test_self_exe_path() {
66
let path = current_exe();
77
assert!(path.is_ok());

library/std/src/fs.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
#![stable(feature = "rust1", since = "1.0.0")]
99
#![deny(unsafe_op_in_unsafe_fn)]
1010

11-
#[cfg(all(test, not(any(target_os = "emscripten", target_env = "sgx", target_os = "xous"))))]
11+
#[cfg(all(
12+
test,
13+
not(any(
14+
target_os = "emscripten",
15+
target_os = "wasi",
16+
target_env = "sgx",
17+
target_os = "xous"
18+
))
19+
))]
1220
mod tests;
1321

1422
use crate::ffi::OsString;

library/std/src/io/buffered/tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ fn test_buffered_reader_stream_position() {
164164
}
165165

166166
#[test]
167+
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
167168
fn test_buffered_reader_stream_position_panic() {
168169
let inner: &[u8] = &[5, 6, 7, 0, 1, 2, 3, 4];
169170
let mut reader = BufReader::with_capacity(4, io::Cursor::new(inner));
@@ -487,7 +488,7 @@ fn dont_panic_in_drop_on_panicked_flush() {
487488
}
488489

489490
#[test]
490-
#[cfg_attr(target_os = "emscripten", ignore)]
491+
#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
491492
fn panic_in_write_doesnt_flush_in_drop() {
492493
static WRITES: AtomicUsize = AtomicUsize::new(0);
493494

library/std/src/io/error/repr_bitpacked.rs

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const TAG_SIMPLE: usize = 0b11;
124124
/// is_unwind_safe::<std::io::Error>();
125125
/// ```
126126
#[repr(transparent)]
127+
#[rustc_insignificant_dtor]
127128
pub(super) struct Repr(NonNull<()>, PhantomData<ErrorData<Box<Custom>>>);
128129

129130
// All the types `Repr` stores internally are Send + Sync, and so is it.

0 commit comments

Comments
 (0)