diff --git a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs index 0a260f97e5164..d6ddd9fec7c08 100644 --- a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs @@ -374,7 +374,7 @@ where _ecx: &mut EvalCtxt<'_, D>, _goal: Goal, ) -> Result, NoSolutionOrRerunNonErased> { - todo!("Iterator is not yet const") + Err(NoSolutionOrRerunNonErased::NoSolution(NoSolution)) } fn consider_builtin_fused_iterator_candidate( diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs index 2a34537f58e31..22c3d89e3ccdb 100644 --- a/library/alloc/src/boxed/thin.rs +++ b/library/alloc/src/boxed/thin.rs @@ -10,7 +10,8 @@ use core::marker::PhantomData; #[cfg(not(no_global_oom_handling))] use core::marker::Unsize; #[cfg(not(no_global_oom_handling))] -use core::mem::{self, SizedTypeProperties}; +use core::mem; +use core::mem::SizedTypeProperties; use core::ops::{Deref, DerefMut}; use core::ptr::{self, NonNull, Pointee}; @@ -112,7 +113,7 @@ impl ThinBox { where T: Unsize, { - if size_of::() == 0 { + if T::IS_ZST { let ptr = WithOpaqueHeader::new_unsize_zst::(value); ThinBox { ptr, _marker: PhantomData } } else { @@ -281,7 +282,7 @@ impl WithHeader { let ptr = if layout.size() == 0 { // Some paranoia checking, mostly so that the ThinBox tests are // more able to catch issues. - debug_assert!(value_offset == 0 && size_of::() == 0 && size_of::() == 0); + debug_assert!(value_offset == 0 && T::IS_ZST && H::IS_ZST); layout.dangling_ptr() } else { let ptr = alloc::alloc(layout); @@ -311,7 +312,7 @@ impl WithHeader { Dyn: Pointee + ?Sized, T: Unsize, { - assert!(size_of::() == 0); + assert!(T::IS_ZST); const fn max(a: usize, b: usize) -> usize { if a > b { a } else { b } diff --git a/library/core/src/iter/adapters/map_windows.rs b/library/core/src/iter/adapters/map_windows.rs index 097a0745c61c7..5d96de5cbcb6b 100644 --- a/library/core/src/iter/adapters/map_windows.rs +++ b/library/core/src/iter/adapters/map_windows.rs @@ -1,5 +1,5 @@ use crate::iter::FusedIterator; -use crate::mem::MaybeUninit; +use crate::mem::{MaybeUninit, SizedTypeProperties}; use crate::{fmt, ptr}; /// An iterator over the mapped windows of another iterator. @@ -47,7 +47,7 @@ impl MapWindows { assert!(N != 0, "array in `Iterator::map_windows` must contain more than 0 elements"); // Only ZST arrays' length can be so large. - if size_of::() == 0 { + if I::Item::IS_ZST { assert!( N.checked_mul(2).is_some(), "array size of `Iterator::map_windows` is too large" diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 190dadca6476b..62c612e7ba2a6 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1620,7 +1620,7 @@ pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { #[rustc_const_unstable(feature = "mem_conjure_zst", issue = "95383")] pub const unsafe fn conjure_zst() -> T { const_assert!( - size_of::() == 0, + T::IS_ZST, "mem::conjure_zst invoked on a non-zero-sized type", "mem::conjure_zst invoked on type {name}, which is not zero-sized", name: &str = crate::any::type_name::() diff --git a/src/ci/docker/scripts/x86_64-gnu-llvm.sh b/src/ci/docker/scripts/x86_64-gnu-llvm.sh index 5fa17d954c3bc..79177b96a4afc 100755 --- a/src/ci/docker/scripts/x86_64-gnu-llvm.sh +++ b/src/ci/docker/scripts/x86_64-gnu-llvm.sh @@ -13,8 +13,10 @@ set -ex # despite having different output on 32-bit vs 64-bit targets. ../x --stage 2 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu -# Run the UI test suite again, but in `--pass=check` mode -# -# This is intended to make sure that both `--pass=check` continues to -# work. +# Run the UI test suite in `--pass=check` mode, to ensure it continues to work. ../x.ps1 --stage 2 test tests/ui --pass=check --host='' --target=i686-unknown-linux-gnu + +# Rebuild the stdlib using the new trait solver, to ensure it doesn't regress +# until stabilization. +RUSTFLAGS_NOT_BOOTSTRAP="-Znext-solver=globally" ../x --stage 1 build library \ + --host='' --target=i686-unknown-linux-gnu diff --git a/src/doc/reference b/src/doc/reference index 581920f9109f1..ad35aca481751 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 581920f9109f141b88b860b3e1e8359e3896a150 +Subproject commit ad35aca481751a06afeb23820a672b0f3b11a476