Repository navigation
Const generics ICE: no type-dependent def for method #70586
Copy link
Copy link
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Mar 30, 2020 - addedA-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
on Mar 30, 2020 Example made smaller
#![feature(const_generics)] struct T; impl T { fn new_s<const N: u8>() -> S<N> { S } } struct S<const N: u8>; impl<const N: u8> S<N> { fn method(&self) {} } fn main() { T::new_s::<1u8>().method(); }
Errors:
Compiling playground v0.0.1 (/playground) warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> src/main.rs:1:12 | 1 | #![feature(const_generics)] | ^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default error: internal compiler error: src/librustc_passes/dead.rs:111: no type-dependent def for method thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9 stack backtrace: 0: backtrace::backtrace::libunwind::trace at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86 1: backtrace::backtrace::trace_unsynchronized at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66 2: std::sys_common::backtrace::_print_fmt at src/libstd/sys_common/backtrace.rs:78 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt at src/libstd/sys_common/backtrace.rs:59 4: core::fmt::write at src/libcore/fmt/mod.rs:1069 5: std::io::Write::write_fmt at src/libstd/io/mod.rs:1439 6: std::sys_common::backtrace::_print at src/libstd/sys_common/backtrace.rs:62 7: std::sys_common::backtrace::print at src/libstd/sys_common/backtrace.rs:49 8: std::panicking::default_hook::{{closure}} at src/libstd/panicking.rs:198 9: std::panicking::default_hook at src/libstd/panicking.rs:218 10: rustc_driver::report_ice 11: std::panicking::rust_panic_with_hook at src/libstd/panicking.rs:515 12: std::panicking::begin_panic 13: rustc_errors::HandlerInner::bug 14: rustc_errors::Handler::bug 15: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}} 16: rustc_middle::ty::context::tls::with_opt::{{closure}} 17: rustc_middle::ty::context::tls::with_opt 18: rustc_middle::util::bug::opt_span_bug_fmt 19: rustc_middle::util::bug::bug_fmt 20: <rustc_passes::dead::MarkSymbolVisitor as rustc_hir::intravisit::Visitor>::visit_expr 21: rustc_hir::intravisit::walk_expr 22: rustc_hir::intravisit::walk_fn 23: rustc_hir::intravisit::Visitor::visit_fn 24: rustc_hir::intravisit::walk_item 25: rustc_passes::dead::check_crate 26: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once 27: rustc_session::utils::<impl rustc_session::session::Session>::time 28: rustc_interface::passes::analysis 29: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute 30: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl 31: rustc_query_system::query::plumbing::get_query 32: rustc_middle::ty::context::tls::enter_global 33: rustc_interface::interface::run_compiler_in_existing_thread_pool 34: scoped_tls::ScopedKey<T>::set 35: rustc_ast::attr::with_globals note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.44.0-nightly (211365947 2020-03-30) running on x86_64-unknown-linux-gnu note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [analysis] running analysis passes on this crate end of query stack error: aborting due to previous error error: could not compile `playground`. To learn more, run the command again with --verbose.Edit: The current error message “no type-dependent def for method” happens (on the smaller example) since nightly-2020-03-25. This is the same nightly as in #70507. Downloading the relevant CI builds in bisect-rustc is impossibly slow (i.e. not working) for me at the moment, but I’d be surprised if it isn’t 342c5f3 for this one as well.
Reacted by DutchGhost and qwerty19106- addedglacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
on Apr 3, 2020 - addedA-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)
on Apr 8, 2020 - added a commit that references this issue
on Jul 16, 2020 - added 2 commits that reference this issue
on Jul 16, 2020
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Code
Meta
rustc --version --verbose:Error output
Backtrace