Skip to content

ICE: downgrade_to_delayed_bug: cannot downgrade Warning(None) to DelayedBug: not an error #120081

Closed as not planned
@thomasyonug

Description

@thomasyonug

I tried this code:

  ```
fn much_larger_type(default: Default) -> MuchLargerType<Default> {
    // implementation elided
}

fn box_new<T>(t: T) -> Box<T> {
    // implementation elided
}

fn tuple_with_one_element<T>(t: T) -> (Box<T>, usize) {
    // implementation elided
}

fn closure_that_prints_stuff<T>(t: T) -> () {
    let p = t.0.0;
    println!("{} {:?}", t.1, p);
}

fn main() {}
```

I expected to see this happen: compilation success

Instead, this happened: ICE

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (595bc6f00 2024-01-05)
binary: rustc
commit-hash: 595bc6f00369475047538fdae1ff8cea692ac385
commit-date: 2024-01-05
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6
Backtrace

thread 'rustc' panicked at compiler/rustc_hir_analysis/src/astconv/lint.rs:152:22:
downgrade_to_delayed_bug: cannot downgrade Warning(None) to DelayedBug: not an error
stack backtrace:
   0:     0x7f804f3db806 - std::backtrace_rs::backtrace::libunwind::trace::hccd39fe91d56daec
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f804f3db806 - std::backtrace_rs::backtrace::trace_unsynchronized::hb9c211c184511b77
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f804f3db806 - std::sys_common::backtrace::_print_fmt::ha68911449431f29f
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f804f3db806 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h34c6aa4d9ef2549f
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f804f42df00 - core::fmt::rt::Argument::fmt::h97f0cd02ba3737ef
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/fmt/rt.rs:142:9
   5:     0x7f804f42df00 - core::fmt::write::heb4624e14e98aea7
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f804f3cf15f - std::io::Write::write_fmt::h25504a918ea5c052
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/io/mod.rs:1810:15
   7:     0x7f804f3db5e4 - std::sys_common::backtrace::_print::h16efe88e7fa25a23
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f804f3db5e4 - std::sys_common::backtrace::print::h4f2dda7c938219d4
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f804f3de377 - std::panicking::default_hook::{{closure}}::hdfd96bdc522bbb15
  10:     0x7f804f3de0d9 - std::panicking::default_hook::hf1cac0ca04453e02
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:292:9
  11:     0x7f80521b514c - std[4bc72880d5231e4c]::panicking::update_hook::<alloc[8519608b14536aba]::boxed::Box<rustc_driver_impl[13f857263de4d0ff]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f804f3deac6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h237f4118e41609d8
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/alloc/src/boxed.rs:2030:9
  13:     0x7f804f3deac6 - std::panicking::rust_panic_with_hook::hd39b254275236486
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:783:13
  14:     0x7f804f3de812 - std::panicking::begin_panic_handler::{{closure}}::h5bbe5cb47793ee20
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:657:13
  15:     0x7f804f3dbd06 - std::sys_common::backtrace::__rust_end_short_backtrace::h464decb1e79e1351
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f804f3de570 - rust_begin_unwind
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:645:5
  17:     0x7f804f42a605 - core::panicking::panic_fmt::h679166b76d3d88f6
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:72:14
  18:     0x7f8051818128 - <rustc_errors[97e5471a9bbf658f]::diagnostic::Diagnostic>::downgrade_to_delayed_bug
  19:     0x7f80522d73d0 - <dyn rustc_hir_analysis[fed3235f881802f1]::astconv::AstConv>::maybe_lint_impl_trait
  20:     0x7f805229157c - <<dyn rustc_hir_analysis[fed3235f881802f1]::astconv::AstConv>::maybe_lint_bare_trait::{closure#1} as core[25a4dcbb3cee7009]::ops::function::FnOnce<(&mut rustc_errors[97e5471a9bbf658f]::diagnostic_builder::DiagnosticBuilder<()>,)>>::call_once::{shim:vtable#0}
  21:     0x7f80522ac672 - <alloc[8519608b14536aba]::boxed::Box<dyn for<'a, 'b> core[25a4dcbb3cee7009]::ops::function::FnOnce<(&'a mut rustc_errors[97e5471a9bbf658f]::diagnostic_builder::DiagnosticBuilder<'b, ()>,), Output = ()>> as core[25a4dcbb3cee7009]::ops::function::FnOnce<(&mut rustc_errors[97e5471a9bbf658f]::diagnostic_builder::DiagnosticBuilder<()>,)>>::call_once
  22:     0x7f80542f3624 - rustc_middle[a971313bcac29b13]::lint::struct_lint_level::struct_lint_level_impl::<&str>
  23:     0x7f80536338e6 - <dyn rustc_hir_analysis[fed3235f881802f1]::astconv::AstConv>::ast_ty_to_ty_inner
  24:     0x7f8053630a3e - <dyn rustc_hir_analysis[fed3235f881802f1]::astconv::AstConv>::ty_of_fn
  25:     0x7f805362fb6e - rustc_hir_analysis[fed3235f881802f1]::collect::infer_return_ty_for_fn_sig
  26:     0x7f805362edfc - rustc_hir_analysis[fed3235f881802f1]::collect::fn_sig
  27:     0x7f8053628105 - rustc_query_impl[d834e4f78e079c87]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d834e4f78e079c87]::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 24usize]>>
  28:     0x7f80536280d5 - <rustc_query_impl[d834e4f78e079c87]::query_impl::fn_sig::dynamic_query::{closure#2} as core[25a4dcbb3cee7009]::ops::function::FnOnce<(rustc_middle[a971313bcac29b13]::ty::context::TyCtxt, rustc_span[3a08aed223fea3cd]::def_id::DefId)>>::call_once
  29:     0x7f8053627713 - rustc_query_system[e673152937f37d93]::query::plumbing::try_execute_query::<rustc_query_impl[d834e4f78e079c87]::DynamicConfig<rustc_query_system[e673152937f37d93]::query::caches::DefaultCache<rustc_span[3a08aed223fea3cd]::def_id::DefId, rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[d834e4f78e079c87]::plumbing::QueryCtxt, false>
  30:     0x7f8053627135 - rustc_query_impl[d834e4f78e079c87]::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7f8053904b84 - <rustc_hir_analysis[fed3235f881802f1]::collect::CollectItemTypesVisitor as rustc_hir[84af96d42540fa18]::intravisit::Visitor>::visit_item
  32:     0x7f8053902bbd - rustc_hir_analysis[fed3235f881802f1]::collect::collect_mod_item_types
  33:     0x7f8053902b51 - rustc_query_impl[d834e4f78e079c87]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d834e4f78e079c87]::query_impl::collect_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 0usize]>>
  34:     0x7f8053e372cf - rustc_query_system[e673152937f37d93]::query::plumbing::try_execute_query::<rustc_query_impl[d834e4f78e079c87]::DynamicConfig<rustc_query_system[e673152937f37d93]::query::caches::DefaultCache<rustc_span[3a08aed223fea3cd]::def_id::LocalModDefId, rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d834e4f78e079c87]::plumbing::QueryCtxt, false>
  35:     0x7f8053e36e03 - rustc_query_impl[d834e4f78e079c87]::query_impl::collect_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f80536932e1 - rustc_hir_analysis[fed3235f881802f1]::check_crate
  37:     0x7f8054080319 - rustc_interface[51292d701ac247ab]::passes::analysis
  38:     0x7f805407ff5f - rustc_query_impl[d834e4f78e079c87]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d834e4f78e079c87]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7f80543f4164 - rustc_query_system[e673152937f37d93]::query::plumbing::try_execute_query::<rustc_query_impl[d834e4f78e079c87]::DynamicConfig<rustc_query_system[e673152937f37d93]::query::caches::SingleCache<rustc_middle[a971313bcac29b13]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[d834e4f78e079c87]::plumbing::QueryCtxt, false>
  40:     0x7f80543f3f55 - rustc_query_impl[d834e4f78e079c87]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7f80541a1e75 - rustc_interface[51292d701ac247ab]::interface::run_compiler::<core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>, rustc_driver_impl[13f857263de4d0ff]::run_compiler::{closure#0}>::{closure#0}
  42:     0x7f80544244c6 - std[4bc72880d5231e4c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[51292d701ac247ab]::util::run_in_thread_with_globals<rustc_interface[51292d701ac247ab]::util::run_in_thread_pool_with_globals<rustc_interface[51292d701ac247ab]::interface::run_compiler<core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>, rustc_driver_impl[13f857263de4d0ff]::run_compiler::{closure#0}>::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>
  43:     0x7f80544242f3 - <<std[4bc72880d5231e4c]::thread::Builder>::spawn_unchecked_<rustc_interface[51292d701ac247ab]::util::run_in_thread_with_globals<rustc_interface[51292d701ac247ab]::util::run_in_thread_pool_with_globals<rustc_interface[51292d701ac247ab]::interface::run_compiler<core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>, rustc_driver_impl[13f857263de4d0ff]::run_compiler::{closure#0}>::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[25a4dcbb3cee7009]::result::Result<(), rustc_span[3a08aed223fea3cd]::ErrorGuaranteed>>::{closure#1} as core[25a4dcbb3cee7009]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  44:     0x7f804f3e89f5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2001850c7d8d32d3
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/alloc/src/boxed.rs:2016:9
  45:     0x7f804f3e89f5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7c86f6f83b95073a
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/alloc/src/boxed.rs:2016:9
  46:     0x7f804f3e89f5 - std::sys::unix::thread::Thread::new::thread_start::hb8a567c3fcdea6b4
                               at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/sys/unix/thread.rs:108:17
  47:     0x7f804f2d3609 - start_thread
                               at /build/glibc-wuryBv/glibc-2.31/nptl/pthread_create.c:477:8
  48:     0x7f804f1f6353 - clone
                               at /build/glibc-wuryBv/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  49:                0x0 - <unknown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions