Skip to content

stepping into where-clauses during normalization may be productive#155388

Open
lcnr wants to merge 1 commit into
rust-lang:mainfrom
lcnr:norm-where-bounds-may-be-productive
Open

stepping into where-clauses during normalization may be productive#155388
lcnr wants to merge 1 commit into
rust-lang:mainfrom
lcnr:norm-where-bounds-may-be-productive

Conversation

@lcnr

@lcnr lcnr commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

View all comments

fixes rust-lang/trait-system-refactor-initiative#273, see that issue for more info.

Whether stepping into a where-clause is productive depends not on whether we're proving a NormalizesTo or Trait goal, but instead on how both the impl and the cycle rely on it.

In the example in tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive-2.rs this is just a productive use given the way @Nadrieril and I are thinking about it right now.

We're changing such cycles to be ambiguous for now, so this does not commit us to anything.

This previously caused a lot of breakage when normalizing where-clauses, e.g. rust-lang/trait-system-refactor-initiative#176, however with #158643 that is no longer an issue. We will need to figure out what to do here if we want to properly fix ParamEnv normalization in the future

r? @BoxyUwU or @nikomatsakis

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 16, 2026
@rust-log-analyzer

This comment has been minimized.

@lcnr
lcnr force-pushed the norm-where-bounds-may-be-productive branch from 7e15d0a to 7149592 Compare April 17, 2026 07:58
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lcnr
lcnr force-pushed the norm-where-bounds-may-be-productive branch from 7149592 to 45934b8 Compare April 17, 2026 09:33
@BoxyUwU

BoxyUwU commented May 1, 2026

Copy link
Copy Markdown
Member

@rustbot author

pending figuring out how breaking this is

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2026
@rustbot

rustbot commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 1, 2026
@rust-bors

This comment has been minimized.

@Randl

Randl commented May 20, 2026

Copy link
Copy Markdown
Contributor

Not sure if you're already aware but this PR ICEs on the following

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ edition: 2021
//@ compile-flags: --crate-type=lib
//@ build-pass

use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::Context;
use std::task::Poll;

struct Buffer;
type Result<T> = std::result::Result<T, ()>;
type BoxedFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;

trait Read: Unpin + Send {
    fn read(&mut self) -> impl Future<Output = Result<Buffer>>;
}

trait ReadDyn: Unpin + Send + Sync {}
type Reader = Box<dyn ReadDyn>;

trait Access: Send + Sync + Unpin {
    type Reader;
    fn read(&self) -> impl Future<Output = Result<(u32, Self::Reader)>> + Send;
}

trait AccessDyn: Send + Sync + Unpin {
    fn read_dyn(&self) -> BoxedFuture<'_, Result<(u32, Reader)>>;
}

impl Access for dyn AccessDyn {
    type Reader = Reader;
    async fn read(&self) -> Result<(u32, Self::Reader)> {
        self.read_dyn().await
    }
}

impl<T: Access + ?Sized> Access for Arc<T> {
    type Reader = T::Reader;
    fn read(&self) -> impl Future<Output = Result<(u32, Self::Reader)>> + Send {
        async { self.as_ref().read().await }
    }
}

struct ReadContext {
    acc: Arc<dyn AccessDyn>,
}

struct ReadGenerator {
    ctx: Arc<ReadContext>,
}

impl ReadGenerator {
    async fn next_reader(&self) -> Result<Option<Reader>> {
        let (_, r) = self.ctx.acc.read().await?;
        Ok(Some(r))
    }
}

trait Stream {
    type Item;
    fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;
}

enum TwoWays<A, B> {
    One(A),
    Two(B),
}

impl<A: Read, B: Read> Read for TwoWays<A, B> {
    async fn read(&mut self) -> Result<Buffer> {
        match self {
            TwoWays::One(v) => v.read().await,
            TwoWays::Two(v) => v.read().await,
        }
    }
}

struct StreamingReader {
    generator: ReadGenerator,
}

impl Read for StreamingReader {
    async fn read(&mut self) -> Result<Buffer> {
        let _ = self.generator.next_reader().await;
        loop {}
    }
}

struct ChunkedReader;

impl Read for ChunkedReader {
    async fn read(&mut self) -> Result<Buffer> {
        loop {}
    }
}

enum State {
    Idle(Option<TwoWays<StreamingReader, ChunkedReader>>),
    Reading(Pin<Box<dyn Future<Output = (TwoWays<StreamingReader, ChunkedReader>, Result<Buffer>)> + Send>>),
}

struct BufferStream {
    state: State,
}

impl Stream for BufferStream {
    type Item = Result<()>;

    fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
        let this = unsafe { self.get_unchecked_mut() };
        loop {
            match &mut this.state {
                State::Idle(reader) => {
                    let mut reader = reader.take().unwrap();
                    let fut = async {
                        let ret = reader.read().await;
                        (reader, ret)
                    };
                    this.state = State::Reading(Box::pin(fut));
                }
                State::Reading(_) => return Poll::Pending,
            }
        }
    }
}

with

error: internal compiler error: compiler/rustc_mir_transform/src/validate.rs:81:25: broken MIR in Item(DefId(0:86 ~ async_block_box_pin_unsize_broken_mir[e897]::{impl#6}::poll_next)) (after phase change to runtime-optimized) at bb8[0]:
                                Unsize coercion, but `std::pin::Pin<std::boxed::Box<{async block@/Users/evgeniizh/RustroverProjects/rust/tests/ui/traits/next-solver/async-block-box-pin-unsize-broken-mir.rs:131:31: 131:36}>>` isn't coercible to `std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = (TwoWays<StreamingReader, ChunkedReader>, std::result::Result<Buffer, ()>)> + std::marker::Send>>`
  --> /Users/evgeniizh/RustroverProjects/rust/tests/ui/traits/next-solver/async-block-box-pin-unsize-broken-mir.rs:135:49
   |
LL |                     this.state = State::Reading(Box::pin(fut));
   |                                                 ^^^^^^^^^^^^^


thread 'rustc' (4832989) panicked at compiler/rustc_mir_transform/src/validate.rs:81:25:

while current main doesn't.

@Randl

Randl commented May 20, 2026

Copy link
Copy Markdown
Contributor

Hm never mind looks like it passes after rebase on main

@lcnr
lcnr force-pushed the norm-where-bounds-may-be-productive branch from 45934b8 to 20b2ce1 Compare July 16, 2026 07:46
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lcnr
lcnr force-pushed the norm-where-bounds-may-be-productive branch from 20b2ce1 to e4c693d Compare July 16, 2026 09:10
@lcnr lcnr changed the title stepping into NormalizesTo where-clauses may be productive stepping into where-clauses during normalization may be productive Jul 22, 2026
@BoxyUwU

BoxyUwU commented Jul 22, 2026

Copy link
Copy Markdown
Member

@bors delegate+

r=me after rebasing

@rustbot author

@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✌️ @lcnr, you can now approve this pull request!

If @BoxyUwU told you to "r=me" after making some further change, then please make that change and post @bors r=BoxyUwU.

View changes since this delegation.

@lcnr
lcnr force-pushed the norm-where-bounds-may-be-productive branch from e4c693d to 66d0fb8 Compare July 22, 2026 11:02
@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lcnr

lcnr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=BoxyUwU rollup (next-solver only)

@jhpratt

jhpratt commented Jul 24, 2026

Copy link
Copy Markdown
Member

@bors treeclosed=1 spurious CI failures

@rust-bors

rust-bors Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tree closed for PRs with priority less than 1.

@jhpratt

jhpratt commented Jul 24, 2026

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[3668/3898] Building CXX object tools/llvm-objcopy/CMakeFiles/llvm-objcopy.dir/llvm-objcopy-driver.cpp.o
[3669/3898] Linking CXX executable bin/llvm-lto2
[3670/3898] Linking CXX executable bin/llvm-offload-binary
FAILED: bin/llvm-offload-binary 
: && /usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 -gz -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/build/./lib  -Wl,--gc-sections tools/llvm-offload-binary/CMakeFiles/llvm-offload-binary.dir/llvm-offload-binary.cpp.o -o bin/llvm-offload-binary  -Wl,-rpath,"\$ORIGIN/../lib:"  lib/libLLVMBinaryFormat.a  lib/libLLVMObject.a  lib/libLLVMSupport.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoDWARFLowLevel.a  lib/libLLVMTextAPI.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/x86_64-linux-gnu/libz.so  lib/libLLVMDemangle.a && :
/usr/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status
[3671/3898] Linking CXX executable bin/llvm-objcopy
FAILED: bin/llvm-objcopy 
: && /usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 -gz -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/build/./lib  -Wl,--gc-sections tools/llvm-objcopy/CMakeFiles/llvm-objcopy.dir/ObjcopyOptions.cpp.o tools/llvm-objcopy/CMakeFiles/llvm-objcopy.dir/llvm-objcopy.cpp.o tools/llvm-objcopy/CMakeFiles/llvm-objcopy.dir/llvm-objcopy-driver.cpp.o -o bin/llvm-objcopy  -Wl,-rpath,"\$ORIGIN/../lib:"  lib/libLLVMObject.a  lib/libLLVMObjCopy.a  lib/libLLVMOption.a  lib/libLLVMSupport.a  lib/libLLVMTargetParser.a  lib/libLLVMMC.a  lib/libLLVMBinaryFormat.a  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMTextAPI.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoDWARFLowLevel.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/x86_64-linux-gnu/libz.so  lib/libLLVMDemangle.a && :
/usr/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status
[3672/3898] Linking CXX executable bin/llvm-nm
FAILED: bin/llvm-nm 
: && /usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 -gz -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/build/./lib  -Wl,--gc-sections tools/llvm-nm/CMakeFiles/llvm-nm.dir/llvm-nm.cpp.o tools/llvm-nm/CMakeFiles/llvm-nm.dir/llvm-nm-driver.cpp.o -o bin/llvm-nm  -Wl,-rpath,"\$ORIGIN/../lib:"  lib/libLLVMAArch64AsmParser.a  lib/libLLVMAMDGPUAsmParser.a  lib/libLLVMARMAsmParser.a  lib/libLLVMBPFAsmParser.a  lib/libLLVMHexagonAsmParser.a  lib/libLLVMLoongArchAsmParser.a  lib/libLLVMMSP430AsmParser.a  lib/libLLVMMipsAsmParser.a  lib/libLLVMPowerPCAsmParser.a  lib/libLLVMRISCVAsmParser.a  lib/libLLVMSparcAsmParser.a  lib/libLLVMSystemZAsmParser.a  lib/libLLVMWebAssemblyAsmParser.a  lib/libLLVMX86AsmParser.a  lib/libLLVMAVRAsmParser.a  lib/libLLVMM68kAsmParser.a  lib/libLLVMCSKYAsmParser.a  lib/libLLVMXtensaAsmParser.a  lib/libLLVMAArch64Desc.a  lib/libLLVMAMDGPUDesc.a  lib/libLLVMARMDesc.a  lib/libLLVMBPFDesc.a  lib/libLLVMHexagonDesc.a  lib/libLLVMLoongArchDesc.a  lib/libLLVMMSP430Desc.a  lib/libLLVMMipsDesc.a  lib/libLLVMNVPTXDesc.a  lib/libLLVMPowerPCDesc.a  lib/libLLVMRISCVDesc.a  lib/libLLVMSparcDesc.a  lib/libLLVMSystemZDesc.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMX86Desc.a  lib/libLLVMAVRDesc.a  lib/libLLVMM68kDesc.a  lib/libLLVMCSKYDesc.a  lib/libLLVMXtensaDesc.a  lib/libLLVMAArch64Info.a  lib/libLLVMAMDGPUInfo.a  lib/libLLVMARMInfo.a  lib/libLLVMBPFInfo.a  lib/libLLVMHexagonInfo.a  lib/libLLVMLoongArchInfo.a  lib/libLLVMMSP430Info.a  lib/libLLVMMipsInfo.a  lib/libLLVMNVPTXInfo.a  lib/libLLVMPowerPCInfo.a  lib/libLLVMRISCVInfo.a  lib/libLLVMSparcInfo.a  lib/libLLVMSystemZInfo.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMX86Info.a  lib/libLLVMAVRInfo.a  lib/libLLVMM68kInfo.a  lib/libLLVMCSKYInfo.a  lib/libLLVMXtensaInfo.a  lib/libLLVMBinaryFormat.a  lib/libLLVMCore.a  lib/libLLVMDemangle.a  lib/libLLVMObject.a  lib/libLLVMOption.a  lib/libLLVMSupport.a  lib/libLLVMSymbolize.a  lib/libLLVMTargetParser.a  lib/libLLVMTextAPI.a  lib/libLLVMAArch64Utils.a  lib/libLLVMAMDGPUUtils.a  lib/libLLVMARMUtils.a  lib/libLLVMM68kCodeGen.a  lib/libLLVMM68kDesc.a  lib/libLLVMMCDisassembler.a  lib/libLLVMM68kInfo.a  lib/libLLVMAsmPrinter.a  lib/libLLVMGlobalISel.a  lib/libLLVMSelectionDAG.a  lib/libLLVMCodeGen.a  lib/libLLVMCGData.a  lib/libLLVMBitWriter.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMScalarOpts.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMTransformUtils.a  lib/libLLVMTarget.a  lib/libLLVMAnalysis.a  lib/libLLVMFrontendHLSL.a  lib/libLLVMProfileData.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoGSYM.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMObject.a  lib/libLLVMTextAPI.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoDWARFLowLevel.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  lib/libLLVMDemangle.a  -lrt  -ldl  -lm  /usr/lib/x86_64-linux-gnu/libz.so && :
/usr/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status
[3673/3898] Linking CXX executable bin/llvm-ml
FAILED: bin/llvm-ml 
: && /usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 -gz -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/build/./lib  -Wl,--gc-sections tools/llvm-ml/CMakeFiles/llvm-ml.dir/llvm-ml.cpp.o tools/llvm-ml/CMakeFiles/llvm-ml.dir/Disassembler.cpp.o tools/llvm-ml/CMakeFiles/llvm-ml.dir/llvm-ml-driver.cpp.o -o bin/llvm-ml  -Wl,-rpath,"\$ORIGIN/../lib:"  lib/libLLVMAArch64AsmParser.a  lib/libLLVMAMDGPUAsmParser.a  lib/libLLVMARMAsmParser.a  lib/libLLVMBPFAsmParser.a  lib/libLLVMHexagonAsmParser.a  lib/libLLVMLoongArchAsmParser.a  lib/libLLVMMSP430AsmParser.a  lib/libLLVMMipsAsmParser.a  lib/libLLVMPowerPCAsmParser.a  lib/libLLVMRISCVAsmParser.a  lib/libLLVMSparcAsmParser.a  lib/libLLVMSystemZAsmParser.a  lib/libLLVMWebAssemblyAsmParser.a  lib/libLLVMX86AsmParser.a  lib/libLLVMAVRAsmParser.a  lib/libLLVMM68kAsmParser.a  lib/libLLVMCSKYAsmParser.a  lib/libLLVMXtensaAsmParser.a  lib/libLLVMAArch64Desc.a  lib/libLLVMAMDGPUDesc.a  lib/libLLVMARMDesc.a  lib/libLLVMBPFDesc.a  lib/libLLVMHexagonDesc.a  lib/libLLVMLoongArchDesc.a  lib/libLLVMMSP430Desc.a  lib/libLLVMMipsDesc.a  lib/libLLVMNVPTXDesc.a  lib/libLLVMPowerPCDesc.a  lib/libLLVMRISCVDesc.a  lib/libLLVMSparcDesc.a  lib/libLLVMSystemZDesc.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMX86Desc.a  lib/libLLVMAVRDesc.a  lib/libLLVMM68kDesc.a  lib/libLLVMCSKYDesc.a  lib/libLLVMXtensaDesc.a  lib/libLLVMAArch64Disassembler.a  lib/libLLVMAMDGPUDisassembler.a  lib/libLLVMARMDisassembler.a  lib/libLLVMBPFDisassembler.a  lib/libLLVMHexagonDisassembler.a  lib/libLLVMLoongArchDisassembler.a  lib/libLLVMMSP430Disassembler.a  lib/libLLVMMipsDisassembler.a  lib/libLLVMPowerPCDisassembler.a  lib/libLLVMRISCVDisassembler.a  lib/libLLVMSparcDisassembler.a  lib/libLLVMSystemZDisassembler.a  lib/libLLVMWebAssemblyDisassembler.a  lib/libLLVMX86Disassembler.a  lib/libLLVMAVRDisassembler.a  lib/libLLVMM68kDisassembler.a  lib/libLLVMCSKYDisassembler.a  lib/libLLVMXtensaDisassembler.a  lib/libLLVMAArch64Info.a  lib/libLLVMAMDGPUInfo.a  lib/libLLVMARMInfo.a  lib/libLLVMBPFInfo.a  lib/libLLVMHexagonInfo.a  lib/libLLVMLoongArchInfo.a  lib/libLLVMMSP430Info.a  lib/libLLVMMipsInfo.a  lib/libLLVMNVPTXInfo.a  lib/libLLVMPowerPCInfo.a  lib/libLLVMRISCVInfo.a  lib/libLLVMSparcInfo.a  lib/libLLVMSystemZInfo.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMX86Info.a  lib/libLLVMAVRInfo.a  lib/libLLVMM68kInfo.a  lib/libLLVMCSKYInfo.a  lib/libLLVMXtensaInfo.a  lib/libLLVMMC.a  lib/libLLVMMCParser.a  lib/libLLVMOption.a  lib/libLLVMSupport.a  lib/libLLVMTargetParser.a  lib/libLLVMM68kCodeGen.a  lib/libLLVMAsmPrinter.a  lib/libLLVMGlobalISel.a  lib/libLLVMSelectionDAG.a  lib/libLLVMCodeGen.a  lib/libLLVMCGData.a  lib/libLLVMBitWriter.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMScalarOpts.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMTransformUtils.a  lib/libLLVMTarget.a  lib/libLLVMAArch64Desc.a  lib/libLLVMAArch64Info.a  lib/libLLVMAArch64Utils.a  lib/libLLVMAMDGPUDesc.a  lib/libLLVMAMDGPUInfo.a  lib/libLLVMAMDGPUUtils.a  lib/libLLVMAnalysis.a  lib/libLLVMFrontendHLSL.a  lib/libLLVMProfileData.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoGSYM.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMARMDesc.a  lib/libLLVMObject.a  lib/libLLVMMCParser.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMTextAPI.a  lib/libLLVMARMInfo.a  lib/libLLVMARMUtils.a  lib/libLLVMHexagonDesc.a  lib/libLLVMHexagonInfo.a  lib/libLLVMLoongArchDesc.a  lib/libLLVMLoongArchInfo.a  lib/libLLVMRISCVDesc.a  lib/libLLVMRISCVInfo.a  lib/libLLVMSystemZDesc.a  lib/libLLVMSystemZInfo.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMM68kDesc.a  lib/libLLVMM68kInfo.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMXtensaDesc.a  lib/libLLVMXtensaInfo.a  lib/libLLVMMCDisassembler.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoDWARFLowLevel.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/x86_64-linux-gnu/libz.so  lib/libLLVMDemangle.a && :
/usr/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

thread 'main' (4653) panicked at /tmp/distcheck/distcheck-rustc-src/vendor/cmake-0.1.54/src/lib.rs:1119:5:

---
   0: __rustc::rust_begin_unwind
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:679:5
   1: core::panicking::panic_fmt
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/panicking.rs:80:14
   2: cmake::fail
   3: cmake::run
   4: <cmake::Config>::build
   5: <bootstrap::core::build_steps::llvm::Llvm as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/llvm.rs:558:13
   6: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::llvm::Llvm>
             at ./src/bootstrap/src/core/builder/mod.rs:1650:36
   7: <bootstrap::core::build_steps::compile::Assemble as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/compile.rs:2118:69
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::compile::Assemble>
             at ./src/bootstrap/src/core/builder/mod.rs:1650:36
   9: <bootstrap::core::builder::Builder>::compiler
             at ./src/bootstrap/src/core/builder/mod.rs:1205:14
  10: <bootstrap::core::build_steps::test::Ui as bootstrap::core::builder::Step>::make_run
             at ./src/bootstrap/src/core/build_steps/test.rs:1854:49
  11: <bootstrap::core::builder::StepDescription>::maybe_run
             at ./src/bootstrap/src/core/builder/mod.rs:480:13
  12: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at ./src/bootstrap/src/core/builder/cli_paths.rs:142:22
  13: <bootstrap::core::builder::Builder>::run_step_descriptions
             at ./src/bootstrap/src/core/builder/mod.rs:1177:9
  14: <bootstrap::core::builder::Builder>::execute_cli
             at ./src/bootstrap/src/core/builder/mod.rs:1156:14
  15: <bootstrap::Build>::build
             at ./src/bootstrap/src/lib.rs:802:25
  16: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:157:11
  17: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Build completed unsuccessfully in 0:12:26
make: *** [Makefile:49: check] Error 1
Bootstrap failed while executing `test distcheck`
Currently active steps:
test::Distcheck {  } at src/bootstrap/src/core/build_steps/test.rs:3751
Command `make check [workdir=/tmp/distcheck/distcheck-rustc-src]` failed with exit code 2
Created at: src/bootstrap/src/core/build_steps/test.rs:3799:5
Executed at: src/bootstrap/src/core/build_steps/test.rs:3805:10

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:20:03
  local time: Fri Jul 24 10:23:27 UTC 2026
  network time: Fri, 24 Jul 2026 10:23:27 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 24, 2026
…uctive, r=BoxyUwU

stepping into where-clauses during normalization may be productive

fixes rust-lang/trait-system-refactor-initiative#273, see that issue for more info.

Whether stepping into a where-clause is productive depends not on whether we're proving a `NormalizesTo` or `Trait` goal, but instead on how both the impl and the cycle rely on it.

In the example in tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive-2.rs this is just a productive use given the way @Nadrieril and I are thinking about it right now.

We're changing such cycles to be ambiguous for now, so this does not commit us to anything.

This previously caused a lot of breakage when normalizing where-clauses, e.g. rust-lang/trait-system-refactor-initiative#176, however with rust-lang#158643 that is no longer an issue. We will need to figure out what to do here if we want to properly fix `ParamEnv` normalization in the future

r? @BoxyUwU or @nikomatsakis
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 24, 2026
…uctive, r=BoxyUwU

stepping into where-clauses during normalization may be productive

fixes rust-lang/trait-system-refactor-initiative#273, see that issue for more info.

Whether stepping into a where-clause is productive depends not on whether we're proving a `NormalizesTo` or `Trait` goal, but instead on how both the impl and the cycle rely on it.

In the example in tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive-2.rs this is just a productive use given the way @Nadrieril and I are thinking about it right now.

We're changing such cycles to be ambiguous for now, so this does not commit us to anything.

This previously caused a lot of breakage when normalizing where-clauses, e.g. rust-lang/trait-system-refactor-initiative#176, however with rust-lang#158643 that is no longer an issue. We will need to figure out what to do here if we want to properly fix `ParamEnv` normalization in the future

r? @BoxyUwU or @nikomatsakis
rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
Rollup of 17 pull requests

Successful merges:

 - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms)
 - #138618 (Support using const pointers in asm `const` operand)
 - #157962 (Function item should not be used as const arg)
 - #158404 (trait_solver: normalize next-gen region constraints)
 - #158709 (rustdoc: warn on improperly interleaved HTML/MD)
 - #159720 (document #[global_allocator] constraints)
 - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled)
 - #159740 (reuse regular exported_non_generic_symbols logic in Miri)
 - #159780 (check `extern "custom"` function pointers)
 - #159786 (rustdoc-js: ignore editor temp files in test folder discovery)
 - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new)
 - #155388 (stepping into where-clauses during normalization may be productive)
 - #155914 (when bailing on ambiguity, don't force other results to ambig)
 - #159411 ([rustdoc] Correctly handle output options with --show-coverage)
 - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`)
 - #159809 (Avoid `#[target_features]`)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 25, 2026
…uctive, r=BoxyUwU

stepping into where-clauses during normalization may be productive

fixes rust-lang/trait-system-refactor-initiative#273, see that issue for more info.

Whether stepping into a where-clause is productive depends not on whether we're proving a `NormalizesTo` or `Trait` goal, but instead on how both the impl and the cycle rely on it.

In the example in tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive-2.rs this is just a productive use given the way @Nadrieril and I are thinking about it right now.

We're changing such cycles to be ambiguous for now, so this does not commit us to anything.

This previously caused a lot of breakage when normalizing where-clauses, e.g. rust-lang/trait-system-refactor-initiative#176, however with rust-lang#158643 that is no longer an issue. We will need to figure out what to do here if we want to properly fix `ParamEnv` normalization in the future

r? @BoxyUwU or @nikomatsakis
rust-bors Bot pushed a commit that referenced this pull request Jul 25, 2026
Rollup of 16 pull requests

Successful merges:

 - #138618 (Support using const pointers in asm `const` operand)
 - #157962 (Function item should not be used as const arg)
 - #158404 (trait_solver: normalize next-gen region constraints)
 - #158709 (rustdoc: warn on improperly interleaved HTML/MD)
 - #159720 (document #[global_allocator] constraints)
 - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled)
 - #159740 (reuse regular exported_non_generic_symbols logic in Miri)
 - #159780 (check `extern "custom"` function pointers)
 - #159786 (rustdoc-js: ignore editor temp files in test folder discovery)
 - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new)
 - #155388 (stepping into where-clauses during normalization may be productive)
 - #155914 (when bailing on ambiguity, don't force other results to ambig)
 - #159411 ([rustdoc] Correctly handle output options with --show-coverage)
 - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`)
 - #159809 (Avoid `#[target_features]`)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 25, 2026
…uctive, r=BoxyUwU

stepping into where-clauses during normalization may be productive

fixes rust-lang/trait-system-refactor-initiative#273, see that issue for more info.

Whether stepping into a where-clause is productive depends not on whether we're proving a `NormalizesTo` or `Trait` goal, but instead on how both the impl and the cycle rely on it.

In the example in tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive-2.rs this is just a productive use given the way @Nadrieril and I are thinking about it right now.

We're changing such cycles to be ambiguous for now, so this does not commit us to anything.

This previously caused a lot of breakage when normalizing where-clauses, e.g. rust-lang/trait-system-refactor-initiative#176, however with rust-lang#158643 that is no longer an issue. We will need to figure out what to do here if we want to properly fix `ParamEnv` normalization in the future

r? @BoxyUwU or @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

entering normalization where-bounds incorrectly considered non-productive

6 participants