Skip to content

ICE with min_specialization feature on implementing trait for non-existent struct #74483

New issue

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

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

Already on GitHub? # to your account

Closed
eggyal opened this issue Jul 18, 2020 · 1 comment · Fixed by #74516
Closed

ICE with min_specialization feature on implementing trait for non-existent struct #74483

eggyal opened this issue Jul 18, 2020 · 1 comment · Fixed by #74516
Assignees
Labels
A-specialization Area: Trait impl specialization 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

@eggyal
Copy link
Contributor

eggyal commented Jul 18, 2020

Code

#![feature(min_specialization)]

trait Trait {}
impl Trait for NonExistent {}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (39d5a61f2 2020-07-17)
binary: rustc
commit-hash: 39d5a61f2e4e237123837f5162cc275c2fd7e625
commit-date: 2020-07-17
host: x86_64-apple-darwin
release: 1.47.0-nightly
LLVM version: 10.0

Error output

thread 'rustc' panicked at 'Failed to get parent for DefId(0:4 ~ mbuf_ice[317d]::{{impl}}[0])', src/librustc_middle/traits/specialization_graph.rs:46:52
Backtrace

   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: std::panicking::begin_panic_fmt
   9: rustc_middle::traits::specialization_graph::Graph::parent::{{closure}}
  10: rustc_middle::traits::specialization_graph::Graph::parent
  11: <rustc_middle::traits::specialization_graph::Ancestors as core::iter::traits::iterator::Iterator>::next
  12: rustc_typeck::impl_wf_check::min_specialization::check_min_specialization
  13: <rustc_typeck::impl_wf_check::ImplWfCheck as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item
  14: rustc_middle::hir::map::Map::visit_item_likes_in_module
  15: rustc_typeck::impl_wf_check::check_mod_impl_wf
  16: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_impl_wf>::compute
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::get_query_impl
  20: rustc_query_system::query::plumbing::ensure_query_impl
  21: rustc_typeck::impl_wf_check::impl_wf_check
  22: rustc_typeck::check_crate
  23: rustc_interface::passes::analysis
  24: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  26: rustc_query_system::query::plumbing::get_query_impl
  27: rustc_middle::ty::context::tls::enter_global
  28: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  29: rustc_span::with_source_map
  30: rustc_interface::interface::create_compiler_and_run
  31: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@eggyal eggyal 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 Jul 18, 2020
@jonas-schievink jonas-schievink added A-specialization Area: Trait impl specialization requires-nightly This issue requires a nightly compiler in some way. labels Jul 18, 2020
@JohnTitor JohnTitor removed the requires-nightly This issue requires a nightly compiler in some way. label Jul 19, 2020
@JohnTitor
Copy link
Member

I guess it's related to #71127.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-specialization Area: Trait impl specialization 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

Successfully merging a pull request may close this issue.

4 participants