Skip to content

ICE: cannot convert to a region vid: glacier 75323 with -Zsave-analysis #78180

Closed

Description

Code

code is from fixed/75323.rs of glacier

#![feature(min_const_generics)]

fn test<const N: usize>() {}

fn wow<'a>() -> &'a () {
    test::<
        {
            let _: &'a ();
            3
        },
    >();
    &()
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (31530e5d1 2020-10-20)
binary: rustc
commit-hash: 31530e5d132ebcc3654baf2e5460599681520af0
commit-date: 2020-10-20
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0

Error output

rustc ./75323.rs -Zsave-analysis

error[E0601]: `main` function not found in crate `75323`
  --> ./75323.rs:1:1
   |
1  | / #![feature(min_const_generics)]
2  | |
3  | | fn test<const N: usize>() {}
4  | |
...  |
12 | |     &()
13 | | }
   | |_^ consider adding a `main` function to `./75323.rs`

error[E0658]: a non-static lifetime is not allowed in a `const`
 --> ./75323.rs:8:21
  |
8 |             let _: &'a ();
  |                     ^^
  |
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
  = help: add `#![feature(const_generics)]` to the crate attributes to enable

error: internal compiler error: compiler/rustc_mir/src/borrow_check/universal_regions.rs:768:36: cannot convert `ReEarlyBound(0, 'a)` to a region vid

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.49.0-nightly (31530e5d1 2020-10-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
#0 [mir_borrowck_const_arg] borrow-checking the const argument`wow::{constant#0}`
#1 [mir_drops_elaborated_and_const_checked] elaborating drops for `wow::{constant#0}`
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
Backtrace

error[E0601]: `main` function not found in crate `75323`
  --> ./75323.rs:1:1
   |
1  | / #![feature(min_const_generics)]
2  | |
3  | | fn test<const N: usize>() {}
4  | |
...  |
12 | |     &()
13 | | }
   | |_^ consider adding a `main` function to `./75323.rs`

error[E0658]: a non-static lifetime is not allowed in a `const`
 --> ./75323.rs:8:21
  |
8 |             let _: &'a ();
  |                     ^^
  |
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
  = help: add `#![feature(const_generics)]` to the crate attributes to enable

error: internal compiler error: compiler/rustc_mir/src/borrow_check/universal_regions.rs:768:36: cannot convert `ReEarlyBound(0, 'a)` to a region vid

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
   0:     0x7f852bc9fa00 - std::backtrace_rs::backtrace::libunwind::trace::h622bab51c72c4e69
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x7f852bc9fa00 - std::backtrace_rs::backtrace::trace_unsynchronized::h7e820b882ebd41ee
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f852bc9fa00 - std::sys_common::backtrace::_print_fmt::h64d46258114db92f
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f852bc9fa00 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47111d0c1b5f0da5
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f852bd0e8fc - core::fmt::write::h1857a60b204f1b6a
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/core/src/fmt/mod.rs:1076:17
   5:     0x7f852bc91622 - std::io::Write::write_fmt::h4604516fed3e5731
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/io/mod.rs:1516:15
   6:     0x7f852bca49a5 - std::sys_common::backtrace::_print::h785e7a78d5ef272c
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f852bca49a5 - std::sys_common::backtrace::print::h108047ac5c4555d5
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f852bca49a5 - std::panicking::default_hook::{{closure}}::h1d0c271f0d087ebf
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/panicking.rs:208:50
   9:     0x7f852bca4648 - std::panicking::default_hook::h692753e26f11b7b7
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/panicking.rs:227:9
  10:     0x7f852cea3878 - rustc_driver::report_ice::h027627aaa525f0b3
  11:     0x7f852bca51e6 - std::panicking::rust_panic_with_hook::h74ddc20305301cd9
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/panicking.rs:581:17
  12:     0x7f852fe7b1bd - std::panicking::begin_panic::{{closure}}::hde64e7753bb51667
  13:     0x7f852fe7b0e6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6567ed4099b888c3
  14:     0x7f852fe7b12f - std::panicking::begin_panic::h5911b197bf270d50
  15:     0x7f852feb1b20 - rustc_errors::HandlerInner::bug::hbb6554bd4fbc8852
  16:     0x7f852feb0600 - rustc_errors::Handler::bug::h4feefeec7bb726ca
  17:     0x7f852f921e04 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h22b92ed7b73b8340
  18:     0x7f852f91addb - rustc_middle::ty::context::tls::with_opt::{{closure}}::h32bfd9cf0b0a9393
  19:     0x7f852f91ad82 - rustc_middle::ty::context::tls::with_opt::h762464f893de2d96
  20:     0x7f852f921d29 - rustc_middle::util::bug::opt_span_bug_fmt::h05648c19bbf99518
  21:     0x7f852f921c9e - rustc_middle::util::bug::bug_fmt::h5d4f7ed12a8f1d0d
  22:     0x7f852e4aa218 - rustc_mir::borrow_check::universal_regions::UniversalRegionIndices::to_region_vid::{{closure}}::hf1cfeaddaf45e88c
  23:     0x7f852e4aa1ba - rustc_mir::borrow_check::universal_regions::UniversalRegionIndices::to_region_vid::hccb8f83ac4bad7f0
  24:     0x7f852e26c1b6 - <rustc_mir::borrow_check::type_check::relate_tys::NllTypeRelatingDelegate as rustc_infer::infer::nll_relate::TypeRelatingDelegate>::push_outlives::h2ffdf4671223a672
  25:     0x7f852e6b44fb - <rustc_infer::infer::nll_relate::TypeRelating<D> as rustc_middle::ty::relate::TypeRelation>::regions::h8c31c442627ef154
  26:     0x7f852e58527e - rustc_middle::ty::relate::super_relate_tys::hc5911a2c0f15c074
  27:     0x7f852e188990 - rustc_infer::infer::combine::<impl rustc_infer::infer::InferCtxt>::super_combine_tys::h3d3ad3d62befd183
  28:     0x7f852e6b91e2 - rustc_middle::ty::relate::TypeRelation::relate::h2a4e9143279a033e
  29:     0x7f852e2733d3 - rustc_mir::borrow_check::type_check::TypeChecker::relate_types::hd539c5511c6f43ab
  30:     0x7f852e26cbd5 - rustc_mir::borrow_check::type_check::type_check::hfcac3934a4212663
  31:     0x7f852e55201d - rustc_mir::borrow_check::nll::compute_regions::hfe8f6f3c0c79355b
  32:     0x7f852e6f77de - rustc_mir::borrow_check::do_mir_borrowck::h4acacd61f33a7b7e
  33:     0x7f852e187c36 - rustc_infer::infer::InferCtxtBuilder::enter::hd5556efaa818b431
  34:     0x7f852e6f47f9 - rustc_mir::borrow_check::mir_borrowck::h15a86e919fc8eed4
  35:     0x7f852e6c244d - core::ops::function::FnOnce::call_once::h6b5cd81feaed62a1
  36:     0x7f852e663de1 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck_const_arg>::compute::h1c235dfebf34f3fb
  37:     0x7f852e522ef2 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h447f2f9c670cca31
  38:     0x7f852e1969a1 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h0a727f0c1fa3ea1f
  39:     0x7f852e349b46 - rustc_query_system::query::plumbing::get_query_impl::h5a77fdf0ca4a365e
  40:     0x7f852e3a1497 - rustc_query_system::query::plumbing::ensure_query_impl::h2dc6fc7ec25057b8
  41:     0x7f852e6a7a16 - rustc_mir::transform::mir_drops_elaborated_and_const_checked::h997e03d7d6520c82
  42:     0x7f852e6645b1 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_drops_elaborated_and_const_checked>::compute::h79b4bbbf7058fe44
  43:     0x7f852e527e82 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h64e586cbce9e64b6
  44:     0x7f852e196ce1 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h982b6d1eaf0f3a7c
  45:     0x7f852e3286e6 - rustc_query_system::query::plumbing::get_query_impl::h15494dbf6f61984b
  46:     0x7f852e6a874f - rustc_mir::transform::optimized_mir_of_const_arg::h13cd2556e126ae60
  47:     0x7f852e5d97f1 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir_of_const_arg>::compute::h7b2baf865430142f
  48:     0x7f852e5228e2 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h39482e20e07fdf32
  49:     0x7f852e196be1 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h1f190f4e026249aa
  50:     0x7f852e36a526 - rustc_query_system::query::plumbing::get_query_impl::h8a363cab9886942b
  51:     0x7f852e5f5ef3 - rustc_mir::interpret::eval_context::InterpCx<M>::load_mir::h327c7a14867fd19b
  52:     0x7f852e55699c - rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider::hdbcc3206940fc1d2
  53:     0x7f852e4fb9a4 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_allocation_raw>::compute::h31b1b29c556c7ded
  54:     0x7f852e51cc4c - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h0841db549cb81a61
  55:     0x7f852e1a6153 - rustc_data_structures::stack::ensure_sufficient_stack::h985c8929d767037e
  56:     0x7f852e37e0b4 - rustc_query_system::query::plumbing::get_query_impl::hc00c5c2512c3fe67
  57:     0x7f852e556331 - rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider::h64c6c9052b7193d4
  58:     0x7f852e4fba94 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute::h94bad924b5fbf46e
  59:     0x7f852e51f73f - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h20d567c800054b97
  60:     0x7f852e19d40d - rustc_data_structures::stack::ensure_sufficient_stack::h0876de69cfcf632b
  61:     0x7f852e323e8f - rustc_query_system::query::plumbing::get_query_impl::h0f5ace81a30d684c
  62:     0x7f852e556109 - rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider::h64c6c9052b7193d4
  63:     0x7f852fa48a1a - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute::h94bad924b5fbf46e
  64:     0x7f852fd7b825 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::he90856ba60867bd1
  65:     0x7f852f9345eb - rustc_data_structures::stack::ensure_sufficient_stack::h057904aa47d6d3a3
  66:     0x7f852f738e5d - rustc_query_system::query::plumbing::get_query_impl::h9da5513325f7bad8
  67:     0x7f852fa103af - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id::hb50b9bb506785d22
  68:     0x7f852fa1011f - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve::hca0967fe0f4dba85
  69:     0x7f852f40823b - <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_const::hc4df9c8255f390aa
  70:     0x7f852f2af303 - rustc_middle::ty::fold::TypeFoldable::fold_with::ha1c1a9ef8ae08993
  71:     0x7f852f279ef4 - rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with::h5e381cb60f2c3857
  72:     0x7f852f407d1e - <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty::h0cf8cd9e525c21d2
  73:     0x7f852daf0002 - rustc_data_structures::stack::ensure_sufficient_stack::h83603224f3a2ec07
  74:     0x7f852d9edeb5 - rustc_trait_selection::traits::project::normalize::hbd026b7cfa08733e
  75:     0x7f852db9ed13 - <rustc_infer::infer::InferCtxt as rustc_trait_selection::infer::InferCtxtExt>::partially_normalize_associated_types_in::h6e59bd9035cfbfff
  76:     0x7f852db30632 - rustc_typeck::check::inherited::Inherited::normalize_associated_types_in::hd6f011cab5e375ac
  77:     0x7f852d905cbc - rustc_typeck::check::fn_ctxt::_impl::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::instantiate_value_path::hd12a53536fc1faf5
  78:     0x7f852d8f5497 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::h85571b792e4e29aa
  79:     0x7f852d8f2d80 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation::h3d0ee6ad6d48cede
  80:     0x7f852d8e0a54 - rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_call::had823bacc17ba837
  81:     0x7f852d8f3aad - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::h85571b792e4e29aa
  82:     0x7f852d8f2d80 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation::h3d0ee6ad6d48cede
  83:     0x7f852d90b795 - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt::h8c3b1cf29c1b9146
  84:     0x7f852d90be3b - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected::heaf04a8a0c47c91a
  85:     0x7f852d8f3a85 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::h85571b792e4e29aa
  86:     0x7f852d8f2d80 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation::h3d0ee6ad6d48cede
  87:     0x7f852d8fb86a - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr::h600e7dc6197fad7f
  88:     0x7f852d9f6b28 - rustc_typeck::check::check::check_fn::h3f68f05a04d05804
  89:     0x7f852db816b3 - rustc_infer::infer::InferCtxtBuilder::enter::h6881f9376e4471a9
  90:     0x7f852dc35158 - rustc_typeck::check::typeck::h7936b5f86fffb913
  91:     0x7f852cf7ba5e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck>::compute::h3bcab1479531095c
  92:     0x7f852cf90ae7 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h3d62433f5dd808d3
  93:     0x7f852cfc1dc1 - rustc_data_structures::stack::ensure_sufficient_stack::h68019f69c1a798ed
  94:     0x7f852cf9ace9 - rustc_query_system::query::plumbing::get_query_impl::h3d64482a9838d020
  95:     0x7f852cf8468d - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h5037530d163aff96
  96:     0x7f852cf82a91 - rustc_save_analysis::dump_visitor::DumpVisitor::process_crate::haa90e2b94950fb5b
  97:     0x7f852ce33b72 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hfcebd8e027c2eb95
  98:     0x7f852cef4e51 - std::thread::local::LocalKey<T>::with::hd08a8ed14b7ee110
  99:     0x7f852ce4ad6e - rustc_session::utils::<impl rustc_session::session::Session>::time::he58a1ab2e4ace9c1
 100:     0x7f852ce3418d - rustc_interface::passes::QueryContext::enter::h59c6397c0177fee2
 101:     0x7f852cec5908 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hec6b32330aacb990
 102:     0x7f852cea81b7 - rustc_span::with_source_map::haf40dc27442e4810
 103:     0x7f852cec0d21 - scoped_tls::ScopedKey<T>::set::h4a8a2485893e8de6
 104:     0x7f852cec99c5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8668b1999ab0e792
 105:     0x7f852ce509de - core::ops::function::FnOnce::call_once{{vtable.shim}}::h36ffd177bfc9cab1
 106:     0x7f852bcb41ea - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h588ce842808b3fd0
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/alloc/src/boxed.rs:1042:9
 107:     0x7f852bcb41ea - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h46bc655f05471a92
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/alloc/src/boxed.rs:1042:9
 108:     0x7f852bcb41ea - std::sys::unix::thread::Thread::new::thread_start::hb4b79d379b730058
                               at /rustc/31530e5d132ebcc3654baf2e5460599681520af0/library/std/src/sys/unix/thread.rs:89:17
 109:     0x7f852bbaf3e9 - start_thread
 110:     0x7f852bacc293 - __GI___clone
 111:                0x0 - <unknown>

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.49.0-nightly (31530e5d1 2020-10-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
#0 [mir_borrowck_const_arg] borrow-checking the const argument`wow::{constant#0}`
#1 [mir_drops_elaborated_and_const_checked] elaborating drops for `wow::{constant#0}`
#2 [optimized_mir_of_const_arg] optimizing MIR for the const argument `wow::{constant#0}`
#3 [eval_to_allocation_raw] const-evaluating + checking `wow::{constant#0}`
#4 [eval_to_const_value_raw] simplifying constant for the type system `wow::{constant#0}`
#5 [eval_to_const_value_raw] simplifying constant for the type system `wow::{constant#0}`
#6 [typeck] type-checking `wow`
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions