Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_next_trait_solver/src/solve/effect_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ where
_ecx: &mut EvalCtxt<'_, D>,
_goal: Goal<I, Self>,
) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {
todo!("Iterator is not yet const")
Err(NoSolutionOrRerunNonErased::NoSolution(NoSolution))
}

fn consider_builtin_fused_iterator_candidate(
Expand Down
9 changes: 5 additions & 4 deletions library/alloc/src/boxed/thin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -112,7 +113,7 @@ impl<Dyn: ?Sized> ThinBox<Dyn> {
where
T: Unsize<Dyn>,
{
if size_of::<T>() == 0 {
if T::IS_ZST {
let ptr = WithOpaqueHeader::new_unsize_zst::<Dyn, T>(value);
ThinBox { ptr, _marker: PhantomData }
} else {
Expand Down Expand Up @@ -281,7 +282,7 @@ impl<H> WithHeader<H> {
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::<T>() == 0 && size_of::<H>() == 0);
debug_assert!(value_offset == 0 && T::IS_ZST && H::IS_ZST);
layout.dangling_ptr()
} else {
let ptr = alloc::alloc(layout);
Expand Down Expand Up @@ -311,7 +312,7 @@ impl<H> WithHeader<H> {
Dyn: Pointee<Metadata = H> + ?Sized,
T: Unsize<Dyn>,
{
assert!(size_of::<T>() == 0);
assert!(T::IS_ZST);

const fn max(a: usize, b: usize) -> usize {
if a > b { a } else { b }
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/iter/adapters/map_windows.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -47,7 +47,7 @@ impl<I: Iterator, F, const N: usize> MapWindows<I, F, N> {
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::<I::Item>() == 0 {
if I::Item::IS_ZST {
assert!(
N.checked_mul(2).is_some(),
"array size of `Iterator::map_windows` is too large"
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>() -> T {
const_assert!(
size_of::<T>() == 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::<T>()
Expand Down
10 changes: 6 additions & 4 deletions src/ci/docker/scripts/x86_64-gnu-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading