Skip to content

ICE in compiler/rustc_monomorphize/src/collector.rs when combining #[marker] and min_specialization #96235

Open
@the8472

Description

@the8472

Code

This specialization:

https://github.com/the8472/rust/blob/b1e92bfba5406b63839ced943261d89d287f97dc/library/core/src/iter/loop_desugar.rs#L99-L115

Together with these marker + specialization traits

https://github.com/the8472/rust/blob/b1e92bfba5406b63839ced943261d89d287f97dc/library/core/src/iter/adapters/zip.rs#L271-L293

ICEs the 1st compiler stage while building the 2nd compiler when running ./x.py build src/tools/cargo

Meta

building a custom rustc, failing commit: https://github.com/the8472/rust/tree/b1e92bfba5406b63839ced943261d89d287f97dc

Error output

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorGuaranteed(())', compiler/rustc_monomorphize/src/collector.rs:927:84

[...]

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.62.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-cpu=native -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z tls-model=initial-exec -Z unstable-options -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: encountered ambiguity selecting `Binder(<std::iter::loop_desugar::ForLoopDesugar<std::iter::Zip<std::vec::IntoIter<rustc_middle::ty::Predicate>, std::vec::IntoIter<rustc_span::Span>>> as std::iter::loop_desugar::DesugarCleanup<(rustc_middle::ty::Predicate, rustc_span::Span)>>, [])` during codegen, presuming due to overflow or prior type error
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:50:47

Backtrace

gist since it's too large for an issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-marker_trait_attr`#![feature(marker_trait_attr)]`F-specialization`#![feature(specialization)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions