Closed
Description
Code
struct Foo<'a>;
impl<'a> Foo<'a> {
const NUM: usize = 3;
fn bar() -> [u32; Self::NUM] {}
}
Meta
rustc --version --verbose
:
rustc 1.48.0-nightly (8b4085359 2020-09-23)
binary: rustc
commit-hash: 8b4085359ae798dedb05c95ad42520557bd25320
commit-date: 2020-09-23
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0
Error output
Compiling foo v0.1.0 (/home/hiroki/foo)
error[E0392]: parameter `'a` is never used
--> src/lib.rs:1:12
|
1 | struct Foo<'a>;
| ^^ unused parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
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.48.0-nightly (8b4085359 2020-09-23) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0392`.
error: could not compile `foo`
To learn more, run the command again with --verbose.
Backtrace
Compiling foo v0.1.0 (/home/hiroki/foo)
Running `rustc --crate-name foo --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=0ce56a08f240d2d4 -C extra-filename=-0ce56a08f240d2d4 --out-dir /home/hiroki/foo/target/debug/deps -C incremental=/home/hiroki/foo/target/debug/incremental -L dependency=/home/hiroki/foo/target/debug/deps`
error[E0392]: parameter `'a` is never used
--> src/lib.rs:1:12
|
1 | struct Foo<'a>;
| ^^ unused parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
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: 0x7f9d23cccaf0 - std::backtrace_rs::backtrace::libunwind::trace::he85dfb3ae4206056
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x7f9d23cccaf0 - std::backtrace_rs::backtrace::trace_unsynchronized::h1ad28094d7b00c21
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x7f9d23cccaf0 - std::sys_common::backtrace::_print_fmt::h901b54610713cd21
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/sys_common/backtrace.rs:79
3: 0x7f9d23cccaf0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb0ad78ee1571f7e0
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/sys_common/backtrace.rs:58
4: 0x7f9d23d3afec - core::fmt::write::h1857a60b204f1b6a
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/core/src/fmt/mod.rs:1080
5: 0x7f9d23cbee17 - std::io::Write::write_fmt::hf7b7d7b243f84a36
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/io/mod.rs:1517
6: 0x7f9d23cd1840 - std::sys_common::backtrace::_print::hd093978a5287b8ff
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/sys_common/backtrace.rs:61
7: 0x7f9d23cd1840 - std::sys_common::backtrace::print::h20f46787581d56d7
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/sys_common/backtrace.rs:48
8: 0x7f9d23cd1840 - std::panicking::default_hook::{{closure}}::h486cbb4b82ffc357
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/panicking.rs:208
9: 0x7f9d23cd14f8 - std::panicking::default_hook::h4190c9e3edd4d591
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/panicking.rs:227
10: 0x7f9d24554908 - rustc_driver::report_ice::h66863b1038883129
11: 0x7f9d23cd2076 - std::panicking::rust_panic_with_hook::h72e78719cdda225c
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/panicking.rs:581
12: 0x7f9d2753838d - std::panicking::begin_panic::{{closure}}::h07c37e0eb1cdd0bd
13: 0x7f9d27538316 - std::sys_common::backtrace::__rust_end_short_backtrace::h0e913c6e63ac7532
14: 0x7f9d2753df0f - std::panicking::begin_panic::hb4984aaf49f869f2
15: 0x7f9d27573950 - rustc_errors::HandlerInner::bug::hba4e38a3874f5dd8
16: 0x7f9d27572500 - rustc_errors::Handler::bug::h9b8941b572d00bc2
17: 0x7f9d26f36864 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h726bee46769907eb
18: 0x7f9d26f3644b - rustc_middle::ty::context::tls::with_opt::{{closure}}::h1a85ed2d0d31b02f
19: 0x7f9d26f363f2 - rustc_middle::ty::context::tls::with_opt::h8821177eb8973c83
20: 0x7f9d26f36789 - rustc_middle::util::bug::opt_span_bug_fmt::h19d91184bbe6343d
21: 0x7f9d26f366fe - rustc_middle::util::bug::bug_fmt::h30d1f7c7862a7e8a
22: 0x7f9d25af9ed8 - rustc_mir::borrow_check::universal_regions::UniversalRegionIndices::to_region_vid::{{closure}}::h264cb9fff034dadb
23: 0x7f9d25af9e7c - rustc_mir::borrow_check::universal_regions::UniversalRegionIndices::to_region_vid::h2695c31df5230784
24: 0x7f9d25cd66b5 - rustc_mir::borrow_check::type_check::constraint_conversion::ConstraintConversion::convert_all::hf28c6463e42db6d1
25: 0x7f9d258fbcc1 - rustc_mir::borrow_check::type_check::type_check::hd0d5244d7a2dac29
26: 0x7f9d25b5cc8c - rustc_mir::borrow_check::nll::compute_regions::h800df86e709a9746
27: 0x7f9d25d5731f - rustc_mir::borrow_check::do_mir_borrowck::h13f6504c014d55f5
28: 0x7f9d2583f231 - rustc_infer::infer::InferCtxtBuilder::enter::h019781e6821f1162
29: 0x7f9d25d5662f - rustc_mir::borrow_check::mir_borrowck::h1ee15291ff1d44eb
30: 0x7f9d25d0a6bc - core::ops::function::FnOnce::call_once::he9d9c025f8e1d130
31: 0x7f9d25b9a02e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute::h5623768d3ebf8307
32: 0x7f9d25ad78b8 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h96697ef5344b8146
33: 0x7f9d25b3c08a - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hbd2092943729ee03
34: 0x7f9d25bcdf21 - rustc_data_structures::stack::ensure_sufficient_stack::h772757538e10c854
35: 0x7f9d25a0e432 - rustc_query_system::query::plumbing::get_query_impl::h8fe4cec2915444b6
36: 0x7f9d25a4ac0d - rustc_query_system::query::plumbing::ensure_query_impl::hb16c52f61c856c7c
37: 0x7f9d25c12b9f - rustc_mir::transform::mir_drops_elaborated_and_const_checked::h79653f5203de0867
38: 0x7f9d25b9afc1 - 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::h0944bc7aaa63c10a
39: 0x7f9d25ad8f95 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hbcaf0ae17dfc10c5
40: 0x7f9d25b3fd53 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hf50f260b0ba759c6
41: 0x7f9d25bce317 - rustc_data_structures::stack::ensure_sufficient_stack::h7bca4d9ff9920e6d
42: 0x7f9d25a07b92 - rustc_query_system::query::plumbing::get_query_impl::h844fe17e4ee8f070
43: 0x7f9d25c13a0d - rustc_mir::transform::inner_optimized_mir::h190f193258a32398
44: 0x7f9d25c137ed - rustc_mir::transform::optimized_mir::he5de4a173c47ac2a
45: 0x7f9d25c15382 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir>::compute::hbeea51dece66d5f2
46: 0x7f9d25ada2a1 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::he8ad63728ada1d76
47: 0x7f9d25b371cf - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h78280b90da65d361
48: 0x7f9d25bcc1f1 - rustc_data_structures::stack::ensure_sufficient_stack::h5cca60f75f59772c
49: 0x7f9d25a37631 - rustc_query_system::query::plumbing::get_query_impl::hd8945424169a1f47
50: 0x7f9d25c2baa1 - rustc_mir::interpret::eval_context::InterpCx<M>::load_mir::hddc6cf9831eb3ec6
51: 0x7f9d25bfe9d5 - rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider::hb599002ff44d5fd5
52: 0x7f9d25b9a6dd - 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::h7a3e03219ccfe0b3
53: 0x7f9d25ad6c83 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h88fcd76179fc25d4
54: 0x7f9d25b31d8d - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h367388559b1fafb6
55: 0x7f9d25bd299c - rustc_data_structures::stack::ensure_sufficient_stack::hc947ea1118dfe791
56: 0x7f9d25a2de5b - rustc_query_system::query::plumbing::get_query_impl::hceb18b958ed9f582
57: 0x7f9d25bfe2e3 - rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider::h439de4a96fd42489
58: 0x7f9d25b9a8bd - 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::hfad11198a80705f2
59: 0x7f9d25ad93e3 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hc9415d9b7af10d27
60: 0x7f9d25b3b469 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hbc03aa69121413aa
61: 0x7f9d25bcf63f - rustc_data_structures::stack::ensure_sufficient_stack::h93e604d31a351038
62: 0x7f9d25a3509e - rustc_query_system::query::plumbing::get_query_impl::hd477ffe16cd2bc78
63: 0x7f9d25bfe07b - rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider::h439de4a96fd42489
64: 0x7f9d26fe6ac3 - 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::hfad11198a80705f2
65: 0x7f9d2720e683 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h5b1e5d448f61945e
66: 0x7f9d26d972b3 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h68b7c5571f20a51d
67: 0x7f9d26ee6c4d - rustc_data_structures::stack::ensure_sufficient_stack::hef46dd0925c9340a
68: 0x7f9d273181a5 - rustc_query_system::query::plumbing::get_query_impl::h6a9b7c2fadf27283
69: 0x7f9d26fad26e - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id::h654d244c1a7c4c97
70: 0x7f9d26facf85 - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve::h2aa91e25b3370478
71: 0x7f9d26af977a - <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_const::h1e5e0faae1076985
72: 0x7f9d26923083 - rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with::h4427f0305e4743ee
73: 0x7f9d26af91de - <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty::hd30aaca226bd3600
74: 0x7f9d25230e49 - rustc_middle::ty::structural_impls::fold_list::h13d00537413e296c
75: 0x7f9d252e4db8 - rustc_trait_selection::traits::project::AssocTypeNormalizer::fold::hf1669ff513d85134
76: 0x7f9d252e5487 - rustc_trait_selection::traits::project::normalize::ha7c60e24181b7fa9
77: 0x7f9d25289eae - <rustc_infer::infer::InferCtxt as rustc_trait_selection::infer::InferCtxtExt>::partially_normalize_associated_types_in::h408a2940e0f838de
78: 0x7f9d25223d6a - rustc_typeck::check::inherited::Inherited::normalize_associated_types_in::hce15a29547bfe3e1
79: 0x7f9d25272006 - rustc_infer::infer::InferCtxtBuilder::enter::h6ea1c140fee6d75a
80: 0x7f9d25187332 - rustc_typeck::check::wfcheck::check_associated_item::h9bfa90193e551734
81: 0x7f9d2510a837 - rustc_typeck::check::check::check_impl_item_well_formed::hf031b66a483a0eb8
82: 0x7f9d2514ba6e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_impl_item_well_formed>::compute::h247b324b5a819c0d
83: 0x7f9d25120621 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h04f3d5cf8097c1e0
84: 0x7f9d251c7e67 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h06d4926f7163c95b
85: 0x7f9d2515a894 - rustc_data_structures::stack::ensure_sufficient_stack::hd4e453d460f8a244
86: 0x7f9d2506497a - rustc_query_system::query::plumbing::get_query_impl::h6408e2dea98e19b4
87: 0x7f9d250ac01e - rustc_query_system::query::plumbing::ensure_query_impl::hbd0b06a9ee4d83ba
88: 0x7f9d252e3c01 - rustc_data_structures::sync::par_for_each_in::h09136af7af911b6c
89: 0x7f9d252f413b - rustc_hir::hir::Crate::par_visit_all_item_likes::hb1b764d8ea6c6e06
90: 0x7f9d25228384 - rustc_typeck::check_crate::hbf16ce9a264b8b68
91: 0x7f9d247ab35e - rustc_interface::passes::analysis::h42e942aca0cd1cfa
92: 0x7f9d245d1712 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h7d201b17e1ba81cf
93: 0x7f9d24511a38 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h35a39a4a5e26c934
94: 0x7f9d24595247 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h6e4ebb730328a4bf
95: 0x7f9d245a63e0 - rustc_data_structures::stack::ensure_sufficient_stack::h9ad3e100ba0a4d94
96: 0x7f9d24538024 - rustc_query_system::query::plumbing::get_query_impl::h5d8aaa7bd4aa7f12
97: 0x7f9d245d21bf - rustc_interface::passes::QueryContext::enter::h5c05328ad75ba40a
98: 0x7f9d245a2db8 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h44ccc7f4be18d9da
99: 0x7f9d24577dd7 - rustc_span::with_source_map::h66c2ce8d1d2ea75f
100: 0x7f9d245a48c8 - rustc_interface::interface::create_compiler_and_run::h5ad1e75287107627
101: 0x7f9d24589f6a - scoped_tls::ScopedKey<T>::set::h1aecacfeceb994eb
102: 0x7f9d245a71d3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h47a1699ec4dd0fba
103: 0x7f9d2452cbee - core::ops::function::FnOnce::call_once{{vtable.shim}}::h66264f9324db4311
104: 0x7f9d23ce180a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h1080dfe0ef616bdf
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/alloc/src/boxed.rs:1042
105: 0x7f9d23ce180a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hd2747e1f2d5cec32
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/alloc/src/boxed.rs:1042
106: 0x7f9d23ce180a - std::sys::unix::thread::Thread::new::thread_start::hd0f336b4ef6808a7
at /rustc/8b4085359ae798dedb05c95ad42520557bd25320/library/std/src/sys/unix/thread.rs:87
107: 0x7f9d23c0af9e - start_thread
108: 0x7f9d23b3965f - __clone
109: 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.48.0-nightly (8b4085359 2020-09-23) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [mir_borrowck] borrow-checking `Foo::<'a>::bar::{{constant}}#0`
#1 [mir_drops_elaborated_and_const_checked] elaborating drops for `Foo::<'a>::bar::{{constant}}#0`
#2 [optimized_mir] optimizing MIR for `Foo::<'a>::bar::{{constant}}#0`
#3 [eval_to_allocation_raw] const-evaluating + checking `Foo::<'a>::bar::{{constant}}#0`
#4 [eval_to_const_value_raw] simplifying constant for the type system `Foo::<'a>::bar::{{constant}}#0`
#5 [eval_to_const_value_raw] simplifying constant for the type system `Foo::<'a>::bar::{{constant}}#0`
#6 [check_impl_item_well_formed] checking that `Foo::<'a>::bar` is well-formed
#7 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0392`.
error: could not compile `foo`
Caused by:
process didn't exit successfully: `rustc --crate-name foo --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=0ce56a08f240d2d4 -C extra-filename=-0ce56a08f240d2d4 --out-dir /home/hiroki/foo/target/debug/deps -C incremental=/home/hiroki/foo/target/debug/incremental -L dependency=/home/hiroki/foo/target/debug/deps` (exit code: 101)