diff --git a/example/mini_core.rs b/example/mini_core.rs index d70df9051609..a8435287d9fd 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -14,6 +14,9 @@ unsafe extern "C" fn _Unwind_Resume() { #[lang = "sized"] pub trait Sized {} +#[lang = "destruct"] +pub trait Destruct {} + #[lang = "unsize"] pub trait Unsize {} @@ -59,6 +62,7 @@ unsafe impl Copy for i16 {} unsafe impl Copy for i32 {} unsafe impl Copy for isize {} unsafe impl Copy for f32 {} +unsafe impl Copy for f64 {} unsafe impl Copy for char {} unsafe impl<'a, T: ?Sized> Copy for &'a T {} unsafe impl Copy for *const T {} diff --git a/patches/0024-core-Disable-portable-simd-test.patch b/patches/0024-core-Disable-portable-simd-test.patch index 4ffb24cd9a7a..03900ba101a9 100644 --- a/patches/0024-core-Disable-portable-simd-test.patch +++ b/patches/0024-core-Disable-portable-simd-test.patch @@ -11,7 +11,7 @@ diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index aa1ad93..95fbf55 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs -@@ -398,25 +398,4 @@ pub mod arch { +@@ -398,23 +398,4 @@ pub mod arch { } } @@ -25,12 +25,10 @@ index aa1ad93..95fbf55 100644 -#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)] -#[allow(rustdoc::bare_urls)] -#[unstable(feature = "portable_simd", issue = "86656")] --#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics -mod core_simd; - -#[doc = include_str!("../../portable-simd/crates/core_simd/src/core_simd_docs.md")] -#[unstable(feature = "portable_simd", issue = "86656")] --#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics -pub mod simd { - #[unstable(feature = "portable_simd", issue = "86656")] - pub use crate::core_simd::simd::*; @@ -41,15 +39,14 @@ diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index cd38c3a..ad632dc 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs -@@ -17,7 +17,6 @@ use crate::ptr; +@@ -17,6 +17,5 @@ use crate::ptr; use crate::result::Result; use crate::result::Result::{Err, Ok}; - #[cfg(not(miri))] // Miri does not support all SIMD intrinsics -use crate::simd::{self, Simd}; use crate::slice; #[unstable( -@@ -3475,123 +3474,6 @@ impl [T] { +@@ -3475,121 +3474,6 @@ impl [T] { } } @@ -102,14 +99,13 @@ index cd38c3a..ad632dc 100644 - /// suffix.iter().copied().sum(), - /// ]); - /// let sums = middle.iter().copied().fold(sums, f32x4::add); -- /// sums.horizontal_sum() +- /// sums.reduce_sum() - /// } - /// - /// let numbers: Vec = (1..101).map(|x| x as _).collect(); - /// assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0); - /// ``` - #[unstable(feature = "portable_simd", issue = "86656")] -- #[cfg(not(miri))] // Miri does not support all SIMD intrinsics - pub fn as_simd(&self) -> (&[T], &[Simd], &[T]) - where - Simd: AsRef<[T; LANES]>, @@ -153,7 +149,6 @@ index cd38c3a..ad632dc 100644 - /// be lifted in a way that would make it possible to see panics from this - /// method for something like `LANES == 3`. - #[unstable(feature = "portable_simd", issue = "86656")] -- #[cfg(not(miri))] // Miri does not support all SIMD intrinsics - pub fn as_simd_mut(&mut self) -> (&mut [T], &mut [Simd], &mut [T]) - where - Simd: AsMut<[T; LANES]>, @@ -197,15 +192,14 @@ diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 5dc586d..b6fc48f 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs -@@ -312,7 +312,6 @@ +@@ -312,6 +312,5 @@ #![feature(panic_can_unwind)] #![feature(panic_unwind)] #![feature(platform_intrinsics)] -#![feature(portable_simd)] #![feature(prelude_import)] #![feature(ptr_as_uninit)] - #![feature(ptr_internals)] -@@ -508,25 +508,6 @@ pub mod time; +@@ -508,23 +508,6 @@ pub mod time; #[unstable(feature = "once_cell", issue = "74465")] pub mod lazy; @@ -215,10 +209,8 @@ index 5dc586d..b6fc48f 100644 -#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)] -#[allow(rustdoc::bare_urls)] -#[unstable(feature = "portable_simd", issue = "86656")] --#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics -mod std_float; - --#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics -#[doc = include_str!("../../portable-simd/crates/core_simd/src/core_simd_docs.md")] -#[unstable(feature = "portable_simd", issue = "86656")] -pub mod simd { diff --git a/patches/0028-core-Disable-long-running-tests.patch b/patches/0028-core-Disable-long-running-tests.patch index bf74a74c7c4b..dc1beae6d2e7 100644 --- a/patches/0028-core-Disable-long-running-tests.patch +++ b/patches/0028-core-Disable-long-running-tests.patch @@ -1,30 +1,32 @@ -From 0ffdd8eda8df364391c8ac6e1ce92c73ba9254d4 Mon Sep 17 00:00:00 2001 +From eb703e627e7a84f1cd8d0d87f0f69da1f0acf765 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 3 Dec 2021 12:16:30 +0100 Subject: [PATCH] Disable long running tests --- - library/core/tests/slice.rs | 3 +++ - 1 file changed, 3 insertions(+) + library/core/tests/slice.rs | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs -index 2c8f00a..44847ee 100644 +index 8402833..84592e0 100644 --- a/library/core/tests/slice.rs +++ b/library/core/tests/slice.rs -@@ -2332,7 +2332,8 @@ macro_rules! empty_max_mut { - }; - } +@@ -2462,6 +2462,7 @@ take_tests! { + #[cfg(not(miri))] // unused in Miri + const EMPTY_MAX: &'static [()] = &[(); usize::MAX]; +/* - #[cfg(not(miri))] // Comparing usize::MAX many elements takes forever in Miri (and in rustc without optimizations) - take_tests! { - slice: &[(); usize::MAX], method: take, - (take_in_bounds_max_range_to, (..usize::MAX), Some(EMPTY_MAX), &[(); 0]), -@@ -2345,3 +2347,4 @@ take_tests! { + // can't be a constant due to const mutability rules + #[cfg(not(miri))] // unused in Miri + macro_rules! empty_max_mut { +@@ -2485,6 +2486,7 @@ take_tests! { (take_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()), (take_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()), } +*/ + + #[test] + fn test_slice_from_ptr_range() { -- 2.26.2.7.g19db9cfb68 diff --git a/rust-toolchain b/rust-toolchain index f2d80b78313d..db14ea2bebca 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-02-25" +channel = "nightly-2022-03-26" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] diff --git a/src/builder.rs b/src/builder.rs index 94b1e2ce13a8..b2f46e92eccb 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1252,7 +1252,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { } fn do_not_inline(&mut self, _llret: RValue<'gcc>) { - unimplemented!(); + // FIMXE(bjorn3): implement } fn set_span(&mut self, _span: Span) {} diff --git a/src/lib.rs b/src/lib.rs index 8e197ea31a8e..0647d8c28eea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,6 +64,7 @@ use rustc_errors::{ErrorGuaranteed, Handler}; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::ty::TyCtxt; +use rustc_middle::ty::query::Providers; use rustc_session::config::{Lto, OptLevel, OutputFilenames}; use rustc_session::Session; use rustc_span::Symbol; @@ -101,6 +102,11 @@ impl CodegenBackend for GccCodegenBackend { *self.supports_128bit_integers.lock().expect("lock") = check_context.get_last_error() == Ok(None); } + fn provide(&self, providers: &mut Providers) { + // FIXME compute list of enabled features from cli flags + providers.global_backend_features = |_tcx, ()| vec![]; + } + fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>, metadata: EncodedMetadata, need_metadata_module: bool) -> Box { let target_cpu = target_cpu(tcx.sess); let res = codegen_crate(self.clone(), tcx, target_cpu.to_string(), metadata, need_metadata_module);