Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: assertion failed: !self.substitutions.is_empty() #82454

Closed
klensy opened this issue Feb 23, 2021 · 2 comments
Closed

ICE: assertion failed: !self.substitutions.is_empty() #82454

klensy opened this issue Feb 23, 2021 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@klensy
Copy link
Contributor

klensy commented Feb 23, 2021

Code

use std::result::Result;
pub fn foo(v: Option<Vec<u32>>)->Result<Vec<u32>,Err>{
    v.unwrap()
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (a15f484b9 2021-02-22)
binary: rustc
commit-hash: a15f484b918a4533ad633ea903ccce82910af342
commit-date: 2021-02-22
host: x86_64-pc-windows-msvc
release: 1.52.0-nightly
LLVM version: 11.0.1

Error output

error[E0573]: expected type, found variant `Err`
 --> ice.rs:2:50
  |
2 | pub fn foo(v: Option<Vec<u32>>)->Result<Vec<u32>,Err>{
  |                                                  ^^^ not a type
  |
thread 'rustc' panicked at 'assertion failed: !self.substitutions.is_empty()', compiler\rustc_errors\src\lib.rs:189:9
stack backtrace:
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.52.0-nightly (a15f484b9 2021-02-22) running on x86_64-pc-windows-msvc

Backtrace

stack backtrace:
   0:      0x7fee486889e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h160322fcc0f12a19
   1:      0x7fee48946eb - core::fmt::write::ha3ea633b18d2da75
   2:      0x7fee485ba38 - <std::io::IoSlice as core::fmt::Debug>::fmt::h0a7d0dda807c93f1
   3:      0x7fee486ca6d - std::panicking::take_hook::h7c389d310fc84231
   4:      0x7fee486c539 - std::panicking::take_hook::h7c389d310fc84231
   5:      0x7feba280b57 - rustc_driver::report_ice::h1a74db21cb8754b8
   6:      0x7fee486d4d2 - std::panicking::rust_panic_with_hook::h13af0da83034d6f3
   7:      0x7fee486cf93 - rust_begin_unwind
   8:      0x7fee486922f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h160322fcc0f12a19
   9:      0x7fee486cf19 - rust_begin_unwind
  10:      0x7fee4890770 - core::panicking::panic_fmt::h45da916c710b88f7
  11:      0x7fee48906bc - core::panicking::panic::h3a7a516f2be28c18
  12:      0x7febe33121e - <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit_diagnostic::h3d02e1f0f59cd00e
  13:      0x7febe31b98c - rustc_errors::HandlerInner::emit_diagnostic::h49c6c3d27e650aba
  14:      0x7febe31ea40 - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit::ha446fe548eb9045f
  15:      0x7febca3a296 - rustc_resolve::Resolver::traits_in_scope::h19f4a2dd68abd28b
  16:      0x7febc9acf64 - <rustc_resolve::def_collector::DefCollector as rustc_ast::visit::Visitor>::visit_struct_field::hbfddfba92fa8545b
  17:      0x7febca31962 - rustc_resolve::Resolver::resolve_crate::hd6b49611d4838c89
  18:      0x7feba3e0f9e - rustc_interface::passes::BoxedResolver::to_resolver_outputs::h07a0552f8efe1194
  19:      0x7feba47efe9 - rustc_interface::interface::try_print_query_stack::h7f59c59e34a51d59
  20:      0x7feba471536 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h3d2eb92653f206c2
  21:      0x7feba3df547 - <rls_span::compiler::_::<impl serde::de::Deserialize for rls_span::compiler::DiagnosticSpanMacroExpansion>::deserialize::__Visitor as serde::de::Visitor>::expecting::heaaadf72ddcc941f
  22:      0x7feba3f7623 - rustc_interface::queries::Queries::expansion::hfb52f37ff02463b0
  23:      0x7feba298dc2 - <rustc_mir::transform::generator::PinArgVisitor as rustc_middle::mir::visit::MutVisitor>::tcx::h19961d02f3ef44a2
  24:      0x7feba2f7cbc - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::hed7ff0c137659fdb
  25:      0x7feba29a799 - <rustc_mir::transform::generator::PinArgVisitor as rustc_middle::mir::visit::MutVisitor>::tcx::h19961d02f3ef44a2
  26:      0x7feba292824 - chalk_engine::table::AnswerIndex::increment::ha0e3e0cdbbf984d6
  27:      0x7feba2942ae - rustc_query_impl::query_callbacks::mir_promoted::force_from_dep_node::h528046bbd86b3faa
  28:      0x7feba2bb74d - rustc_driver::pretty::print_after_hir_lowering::h2b3710020259b375
  29:      0x7fee487caba - std::sys::windows::thread::Thread::new::hd38a560d738a063d
  30:         0x7702556d - BaseThreadInitThunk
  31:         0x7718372d - RtlUserThreadStart


@klensy klensy added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 23, 2021
@klensy
Copy link
Contributor Author

klensy commented Feb 23, 2021

Slightly minimized:

use std::result::Result;
pub fn foo(v: u32)->Result<u32,Err>{
    v
}

@jonas-schievink jonas-schievink changed the title ICE: expected type, found variant Err ICE: assertion failed: !self.substitutions.is_empty() Feb 23, 2021
@jonas-schievink
Copy link
Contributor

duplicate of #78651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants