Skip to content

ICE: Normalizing ImplHeader, compiler/rustc_trait_selection/src/traits/project.rs #87558

Closed

Description

Code

struct ErrorKind;
struct Error(ErrorKind);
impl Fn(&isize) for Error {
    fn from() {}
}

Meta

rustc --version --verbose:

rustc 1.56.0-nightly (2faabf579 2021-07-27)
binary: rustc
commit-hash: 2faabf579323f5252329264cc53ba9ff803429a3
commit-date: 2021-07-27
host: x86_64-unknown-linux-gnu
release: 1.56.0-nightly
LLVM version: 12.0.1

Error output

error[E0407]: method `from` is not a member of trait `Fn`
 --> mutant.rs:4:5
  |
4 |     fn from() {}
  |     ^^^^^^^^^^^^ not a member of trait `Fn`

error[E0601]: `main` function not found in crate `mutant`
 --> mutant.rs:1:1
  |
1 | / struct ErrorKind;
2 | | struct Error(ErrorKind);
3 | | impl Fn(&isize) for Error {
4 | |     fn from() {}
5 | | }
  | |_^ consider adding a `main` function to `mutant.rs`

error[E0229]: associated type bindings are not allowed here
 --> mutant.rs:3:6
  |
3 | impl Fn(&isize) for Error {
  |      ^^^^^^^^^^ associated type not allowed here

thread 'rustc' panicked at 'Normalizing ImplHeader { impl_def_id: DefId(0:8 ~ mutant[57b0]::{impl#0}), self_ty: Error, trait_ref: Some(<Error as std::ops::Fn<(&isize,)>>), predicates: [] } without wrapping in a `Binder`', compiler/rustc_trait_selection/src/traits/project.rs:332:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.56.0-nightly (2faabf579 2021-07-27) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `std::ops::Fn`
#1 [coherent_trait] coherence checking all impls of trait `std::ops::Fn`
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0229, E0407, E0601.
For more information about an error, try `rustc --explain E0229`.
Backtrace

error[E0407]: method `from` is not a member of trait `Fn`
 --> mutant.rs:4:5
  |
4 |     fn from() {}
  |     ^^^^^^^^^^^^ not a member of trait `Fn`

error[E0601]: `main` function not found in crate `mutant`
 --> mutant.rs:1:1
  |
1 | / struct ErrorKind;
2 | | struct Error(ErrorKind);
3 | | impl Fn(&isize) for Error {
4 | |     fn from() {}
5 | | }
  | |_^ consider adding a `main` function to `mutant.rs`

error[E0229]: associated type bindings are not allowed here
 --> mutant.rs:3:6
  |
3 | impl Fn(&isize) for Error {
  |      ^^^^^^^^^^ associated type not allowed here

thread 'rustc' panicked at 'Normalizing ImplHeader { impl_def_id: DefId(0:8 ~ mutant[57b0]::{impl#0}), self_ty: Error, trait_ref: Some(<Error as std::ops::Fn<(&isize,)>>), predicates: [] } without wrapping in a `Binder`', compiler/rustc_trait_selection/src/traits/project.rs:332:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:457:5
   2: rustc_trait_selection::traits::project::AssocTypeNormalizer::fold
   3: rustc_trait_selection::traits::project::normalize
   4: rustc_trait_selection::traits::coherence::with_fresh_ty_vars
   5: rustc_trait_selection::traits::coherence::overlap_within_probe
   6: rustc_infer::infer::InferCtxtBuilder::enter
   7: rustc_trait_selection::traits::coherence::overlapping_impls
   8: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
   9: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
  10: rustc_trait_selection::traits::specialize::specialization_graph_provider
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::specialization_graph_of
  13: rustc_typeck::coherence::coherent_trait
  14: rustc_query_system::query::plumbing::get_query_impl
  15: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::coherent_trait
  16: rustc_session::session::Session::track_errors
  17: rustc_typeck::check_crate
  18: rustc_interface::passes::analysis
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  21: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  22: rustc_span::with_source_map
  23: rustc_interface::interface::create_compiler_and_run
  24: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.56.0-nightly (2faabf579 2021-07-27) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `std::ops::Fn`
#1 [coherent_trait] coherence checking all impls of trait `std::ops::Fn`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0229, E0407, E0601.
For more information about an error, try `rustc --explain E0229`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions