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: no type-dependent def for method #109853

Closed
matthiaskrgr opened this issue Apr 2, 2023 · 2 comments · Fixed by #109909
Closed

ICE: no type-dependent def for method #109853

matthiaskrgr opened this issue Apr 2, 2023 · 2 comments · Fixed by #109909
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

use clippy::time::Instant;

fn main() {
    let prev_instant = Instant::now();

    let duration = prev_instant.elapsed();
}

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (5e1d3299a 2023-03-31)
binary: rustc
commit-hash: 5e1d3299a290026b85787bc9c7e72bcc53ac283f
commit-date: 2023-03-31
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0

Error output

rustc --edition=2021 file.rs

 --> treereduce.out:6:9
  |
6 |     let duration = prev_instant.elapsed();
  |         ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_duration`
  |
  = note: `#[warn(unused_variables)]` on by default
Backtrace

error: internal compiler error: compiler/rustc_passes/src/dead.rs:121:13: no type-dependent def for method

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7f58a2365f8a - std::backtrace_rs::backtrace::libunwind::trace::h2f1b14d2b9e4c6b4
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f58a2365f8a - std::backtrace_rs::backtrace::trace_unsynchronized::haf404d9184796f09
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f58a2365f8a - std::sys_common::backtrace::_print_fmt::h440840d8524e88f8
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f58a2365f8a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0d5b0c2d97b8992f
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f58a23ca05f - core::fmt::write::h63211a72e96d0d74
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f58a2358bc5 - std::io::Write::write_fmt::h83a6589baaeb8174
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/io/mod.rs:1698:15
   6:     0x7f58a2365d55 - std::sys_common::backtrace::_print::h188e467357108441
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f58a2365d55 - std::sys_common::backtrace::print::ha9da41b42961a865
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f58a23689fe - std::panicking::default_hook::{{closure}}::h3fe2eceaaddaab65
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/panicking.rs:269:22
   9:     0x7f58a23687a5 - std::panicking::default_hook::h0c19eee30e1bb21a
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/panicking.rs:288:9
  10:     0x7f58a566b4d5 - <rustc_driver_impl[be27ae895c9c1abf]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[633911572d8bda32]::ops::function::FnOnce<(&core[633911572d8bda32]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f58a23691f4 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hc01893d2c4f83c85
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/alloc/src/boxed.rs:1990:9
  12:     0x7f58a23691f4 - std::panicking::rust_panic_with_hook::hce3464c8b95f72d6
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/panicking.rs:694:13
  13:     0x7f58a5bb6851 - std[5eb8f1edb78db018]::panicking::begin_panic::<rustc_errors[3079177fcf76bb45]::ExplicitBug>::{closure#0}
  14:     0x7f58a5bb1b06 - std[5eb8f1edb78db018]::sys_common::backtrace::__rust_end_short_backtrace::<std[5eb8f1edb78db018]::panicking::begin_panic<rustc_errors[3079177fcf76bb45]::ExplicitBug>::{closure#0}, !>
  15:     0x7f58a5b7c416 - std[5eb8f1edb78db018]::panicking::begin_panic::<rustc_errors[3079177fcf76bb45]::ExplicitBug>
  16:     0x7f58a5bd1d86 - <rustc_errors[3079177fcf76bb45]::HandlerInner>::bug::<&alloc[c199d475057be5e9]::string::String>
  17:     0x7f58a5bd1a50 - <rustc_errors[3079177fcf76bb45]::Handler>::bug::<&alloc[c199d475057be5e9]::string::String>
  18:     0x7f58a5bccbdb - rustc_middle[2e01d9c02d9244ae]::util::bug::opt_span_bug_fmt::<rustc_span[9d027ba2263b9410]::span_encoding::Span>::{closure#0}
  19:     0x7f58a5bcc76a - rustc_middle[2e01d9c02d9244ae]::ty::context::tls::with_opt::<rustc_middle[2e01d9c02d9244ae]::util::bug::opt_span_bug_fmt<rustc_span[9d027ba2263b9410]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f58a5bcc736 - rustc_middle[2e01d9c02d9244ae]::ty::context::tls::with_context_opt::<rustc_middle[2e01d9c02d9244ae]::ty::context::tls::with_opt<rustc_middle[2e01d9c02d9244ae]::util::bug::opt_span_bug_fmt<rustc_span[9d027ba2263b9410]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f58a5bccb26 - rustc_middle[2e01d9c02d9244ae]::util::bug::opt_span_bug_fmt::<rustc_span[9d027ba2263b9410]::span_encoding::Span>
  22:     0x7f58a38c6db3 - rustc_middle[2e01d9c02d9244ae]::util::bug::bug_fmt
  23:     0x7f58a3d82f5f - <rustc_passes[771bc6febb390831]::dead::MarkSymbolVisitor as rustc_hir[d510e89e73515c9b]::intravisit::Visitor>::visit_expr
  24:     0x7f58a3d824bd - <rustc_passes[771bc6febb390831]::dead::MarkSymbolVisitor as rustc_hir[d510e89e73515c9b]::intravisit::Visitor>::visit_expr
  25:     0x7f58a3c9728b - rustc_hir[d510e89e73515c9b]::intravisit::walk_item::<rustc_passes[771bc6febb390831]::dead::MarkSymbolVisitor>
  26:     0x7f58a3c91e90 - rustc_passes[771bc6febb390831]::dead::live_symbols_and_ignored_derived_traits
  27:     0x7f58a4d921fb - <std[5eb8f1edb78db018]::thread::local::LocalKey<core[633911572d8bda32]::cell::Cell<*const ()>>>::with::<rustc_middle[2e01d9c02d9244ae]::ty::context::tls::enter_context<rustc_query_system[bcefc4dc53f73d2]::query::plumbing::execute_job_non_incr<rustc_query_impl[a11cf9e729a76afa]::queries::live_symbols_and_ignored_derived_traits, rustc_query_impl[a11cf9e729a76afa]::plumbing::QueryCtxt>::{closure#0}, &(rustc_data_structures[6ef3f1b9ef542b16]::unord::UnordSet<rustc_span[9d027ba2263b9410]::def_id::LocalDefId>, rustc_data_structures[6ef3f1b9ef542b16]::unord::UnordMap<rustc_span[9d027ba2263b9410]::def_id::LocalDefId, alloc[c199d475057be5e9]::vec::Vec<(rustc_span[9d027ba2263b9410]::def_id::DefId, rustc_span[9d027ba2263b9410]::def_id::DefId)>>)>::{closure#0}, &(rustc_data_structures[6ef3f1b9ef542b16]::unord::UnordSet<rustc_span[9d027ba2263b9410]::def_id::LocalDefId>, rustc_data_structures[6ef3f1b9ef542b16]::unord::UnordMap<rustc_span[9d027ba2263b9410]::def_id::LocalDefId, alloc[c199d475057be5e9]::vec::Vec<(rustc_span[9d027ba2263b9410]::def_id::DefId, rustc_span[9d027ba2263b9410]::def_id::DefId)>>)>
  28:     0x7f58a4d91b9a - rustc_query_system[bcefc4dc53f73d2]::query::plumbing::try_execute_query::<rustc_query_impl[a11cf9e729a76afa]::queries::live_symbols_and_ignored_derived_traits, rustc_query_impl[a11cf9e729a76afa]::plumbing::QueryCtxt>
  29:     0x7f58a4d91880 - <rustc_query_impl[a11cf9e729a76afa]::Queries as rustc_middle[2e01d9c02d9244ae]::ty::query::QueryEngine>::live_symbols_and_ignored_derived_traits
  30:     0x7f58a47f5265 - rustc_passes[771bc6febb390831]::dead::check_mod_deathness
  31:     0x7f58a4c50441 - rustc_query_system[bcefc4dc53f73d2]::query::plumbing::try_execute_query::<rustc_query_impl[a11cf9e729a76afa]::queries::check_mod_deathness, rustc_query_impl[a11cf9e729a76afa]::plumbing::QueryCtxt>
  32:     0x7f58a4c50069 - <rustc_query_impl[a11cf9e729a76afa]::Queries as rustc_middle[2e01d9c02d9244ae]::ty::query::QueryEngine>::check_mod_deathness
  33:     0x7f58a4c27447 - rustc_data_structures[6ef3f1b9ef542b16]::sync::par_for_each_in::<&[rustc_hir[d510e89e73515c9b]::hir_id::OwnerId], <rustc_middle[2e01d9c02d9244ae]::hir::map::Map>::par_for_each_module<rustc_interface[fa1cd19e003fbde7]::passes::analysis::{closure#6}::{closure#1}::{closure#1}::{closure#0}>::{closure#0}>
  34:     0x7f58a4c27378 - <core[633911572d8bda32]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[fa1cd19e003fbde7]::passes::analysis::{closure#6}::{closure#1}::{closure#1}> as core[633911572d8bda32]::ops::function::FnOnce<()>>::call_once
  35:     0x7f58a4c74150 - <core[633911572d8bda32]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[fa1cd19e003fbde7]::passes::analysis::{closure#6}::{closure#1}> as core[633911572d8bda32]::ops::function::FnOnce<()>>::call_once
  36:     0x7f58a4a90e5e - <rustc_session[2115a9ee57a65798]::session::Session>::time::<(), rustc_interface[fa1cd19e003fbde7]::passes::analysis::{closure#6}>
  37:     0x7f58a4a8f2d9 - rustc_interface[fa1cd19e003fbde7]::passes::analysis
  38:     0x7f58a4e14bf2 - rustc_query_system[bcefc4dc53f73d2]::query::plumbing::try_execute_query::<rustc_query_impl[a11cf9e729a76afa]::queries::analysis, rustc_query_impl[a11cf9e729a76afa]::plumbing::QueryCtxt>
  39:     0x7f58a4e148f0 - <rustc_query_impl[a11cf9e729a76afa]::Queries as rustc_middle[2e01d9c02d9244ae]::ty::query::QueryEngine>::analysis
  40:     0x7f58a489654e - <rustc_interface[fa1cd19e003fbde7]::queries::QueryResult<&rustc_middle[2e01d9c02d9244ae]::ty::context::GlobalCtxt>>::enter::<core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>, rustc_driver_impl[be27ae895c9c1abf]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  41:     0x7f58a489502e - <rustc_interface[fa1cd19e003fbde7]::interface::Compiler>::enter::<rustc_driver_impl[be27ae895c9c1abf]::run_compiler::{closure#1}::{closure#2}, core[633911572d8bda32]::result::Result<core[633911572d8bda32]::option::Option<rustc_interface[fa1cd19e003fbde7]::queries::Linker>, rustc_span[9d027ba2263b9410]::ErrorGuaranteed>>
  42:     0x7f58a48931e1 - rustc_span[9d027ba2263b9410]::set_source_map::<core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>, rustc_interface[fa1cd19e003fbde7]::interface::run_compiler<core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>, rustc_driver_impl[be27ae895c9c1abf]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  43:     0x7f58a489278f - std[5eb8f1edb78db018]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fa1cd19e003fbde7]::util::run_in_thread_pool_with_globals<rustc_interface[fa1cd19e003fbde7]::interface::run_compiler<core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>, rustc_driver_impl[be27ae895c9c1abf]::run_compiler::{closure#1}>::{closure#0}, core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>>
  44:     0x7f58a489216e - <<std[5eb8f1edb78db018]::thread::Builder>::spawn_unchecked_<rustc_interface[fa1cd19e003fbde7]::util::run_in_thread_pool_with_globals<rustc_interface[fa1cd19e003fbde7]::interface::run_compiler<core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>, rustc_driver_impl[be27ae895c9c1abf]::run_compiler::{closure#1}>::{closure#0}, core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[633911572d8bda32]::result::Result<(), rustc_span[9d027ba2263b9410]::ErrorGuaranteed>>::{closure#1} as core[633911572d8bda32]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  45:     0x7f58a23732d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf8dc8be554bcb253
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/alloc/src/boxed.rs:1976:9
  46:     0x7f58a23732d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7ce91a4bb123291d
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/alloc/src/boxed.rs:1976:9
  47:     0x7f58a23732d5 - std::sys::unix::thread::Thread::new::thread_start::h821bdfe2a1422348
                               at /rustc/5e1d3299a290026b85787bc9c7e72bcc53ac283f/library/std/src/sys/unix/thread.rs:108:17
  48:     0x7f58a210dbb5 - <unknown>
  49:     0x7f58a218fd90 - <unknown>
  50:                0x0 - <unknown>

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.70.0-nightly (5e1d3299a 2023-03-31) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [live_symbols_and_ignored_derived_traits] finding live symbols in crate
#1 [check_mod_deathness] checking deathness of variables in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 1 warning emitted

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Apr 2, 2023
@matthiaskrgr
Copy link
Member Author

See also #109147 which has similar mvce

@matthiaskrgr
Copy link
Member Author

searched toolchains nightly-2022-04-08 through nightly-2023-04-01


Regression in nightly-2022-04-17


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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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.

2 participants