Closed
Description
Code
#![feature(return_position_impl_trait_in_trait)]
trait Foo {
fn bar<'other: 'a>() -> impl Sized + 'a {}
}
Meta
rustc --version --verbose
:
rustc 1.73.0-nightly (0e8e857b1 2023-07-16)
binary: rustc
commit-hash: 0e8e857b11f60a785aea24a84f280f6dad7a4d42
commit-date: 2023-07-16
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5
Error output
error[E0261]: use of undeclared lifetime name `'a`
--> treereduce.out:4:20
|
4 | fn bar<'other: 'a>() -> impl Sized + 'a {}
| ^^ undeclared lifetime
|
help: consider introducing lifetime `'a` here
|
4 | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
| +++
help: consider introducing lifetime `'a` here
|
3 | trait Foo<'a> {
| ++++
error[E0261]: use of undeclared lifetime name `'a`
--> treereduce.out:4:42
|
4 | fn bar<'other: 'a>() -> impl Sized + 'a {}
| ^^ undeclared lifetime
|
help: consider introducing lifetime `'a` here
|
4 | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
| +++
help: consider introducing lifetime `'a` here
|
3 | trait Foo<'a> {
| ++++
error[E0601]: `main` function not found in crate `treereduce`
--> treereduce.out:5:2
|
5 | }
| ^ consider adding a `main` function to `treereduce.out`
Backtrace
error: internal compiler error: compiler/rustc_middle/src/ty/mod.rs:2342:13: item_name: no name for DefPath { data: [DisambiguatedDefPathData { data: TypeNs("Foo"), disambiguator: 0 }, DisambiguatedDefPathData { data: ImplTraitAssocTy, disambiguator: 0 }], krate: crate0 }
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
0: 0x7fab0e3641e1 - std::backtrace_rs::backtrace::libunwind::trace::h5f856d2c12cc6674
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7fab0e3641e1 - std::backtrace_rs::backtrace::trace_unsynchronized::h8449257397d4b934
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7fab0e3641e1 - std::sys_common::backtrace::_print_fmt::hc0c3bab7873ac244
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/sys_common/backtrace.rs:65:5
3: 0x7fab0e3641e1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3787c35683fa4233
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7fab0e3ca19c - core::fmt::rt::Argument::fmt::hae0c3aa49888479e
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/core/src/fmt/rt.rs:138:9
5: 0x7fab0e3ca19c - core::fmt::write::h0f833d45d904ecbb
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/core/src/fmt/mod.rs:1094:21
6: 0x7fab0e356b8e - std::io::Write::write_fmt::h6fd13360259fea22
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/io/mod.rs:1714:15
7: 0x7fab0e363ff5 - std::sys_common::backtrace::_print::h715af68f97f33bd8
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7fab0e363ff5 - std::sys_common::backtrace::print::h292b9e4a1d37eead
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7fab0e366da3 - std::panicking::default_hook::{{closure}}::hab7084ecbd5f7152
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/panicking.rs:269:22
10: 0x7fab0e366b34 - std::panicking::default_hook::hfbb8ba894af6577e
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/panicking.rs:288:9
11: 0x7fab1162a43b - rustc_driver_impl[5bf76b44b01c010b]::install_ice_hook::{closure#0}
12: 0x7fab0e3675ce - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hc6428110305b5cbe
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/alloc/src/boxed.rs:2021:9
13: 0x7fab0e3675ce - std::panicking::rust_panic_with_hook::h8a8f983a7c12e89b
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/panicking.rs:709:13
14: 0x7fab11bb0221 - std[c0adc0b90f4efda2]::panicking::begin_panic::<rustc_errors[741302e11db422c1]::ExplicitBug>::{closure#0}
15: 0x7fab11bac6e6 - std[c0adc0b90f4efda2]::sys_common::backtrace::__rust_end_short_backtrace::<std[c0adc0b90f4efda2]::panicking::begin_panic<rustc_errors[741302e11db422c1]::ExplicitBug>::{closure#0}, !>
16: 0x7fab11c30966 - std[c0adc0b90f4efda2]::panicking::begin_panic::<rustc_errors[741302e11db422c1]::ExplicitBug>
17: 0x7fab11c2eba4 - <rustc_errors[741302e11db422c1]::HandlerInner>::bug::<alloc[39bc782e9623f60c]::string::String>
18: 0x7fab11c2e9b8 - <rustc_errors[741302e11db422c1]::Handler>::bug::<alloc[39bc782e9623f60c]::string::String>
19: 0x7fab11b56b1c - rustc_middle[835d091ebc4d05d9]::util::bug::opt_span_bug_fmt::<rustc_span[a69db53e102135]::span_encoding::Span>::{closure#0}
20: 0x7fab11b51eea - rustc_middle[835d091ebc4d05d9]::ty::context::tls::with_opt::<rustc_middle[835d091ebc4d05d9]::util::bug::opt_span_bug_fmt<rustc_span[a69db53e102135]::span_encoding::Span>::{closure#0}, !>::{closure#0}
21: 0x7fab11b51eb8 - rustc_middle[835d091ebc4d05d9]::ty::context::tls::with_context_opt::<rustc_middle[835d091ebc4d05d9]::ty::context::tls::with_opt<rustc_middle[835d091ebc4d05d9]::util::bug::opt_span_bug_fmt<rustc_span[a69db53e102135]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
22: 0x7fab103c9f80 - rustc_middle[835d091ebc4d05d9]::util::bug::bug_fmt
23: 0x7fab0fc50396 - <rustc_middle[835d091ebc4d05d9]::ty::context::TyCtxt>::item_name
24: 0x7fab1195813c - <rustc_infer[d627e1df91fd7fd6]::infer::error_reporting::TypeErrCtxt>::report_concrete_failure
25: 0x7fab119607ea - <rustc_infer[d627e1df91fd7fd6]::infer::error_reporting::TypeErrCtxt>::report_region_errors
26: 0x7fab1022ac92 - <rustc_trait_selection[4828e09977927b86]::traits::engine::ObligationCtxt>::resolve_regions_and_report_errors
27: 0x7fab1075d1b6 - rustc_hir_analysis[dc7bd52400bbf8cf]::check::compare_impl_item::check_type_bounds
28: 0x7fab1074d259 - rustc_hir_analysis[dc7bd52400bbf8cf]::check::check::check_mod_item_types
29: 0x7fab1034f8bc - rustc_query_impl[2a0ca4be8ec05b8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[835d091ebc4d05d9]::query::erase::Erased<[u8; 0usize]>>
30: 0x7fab1034f89e - <rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[ef917bd033b821fa]::ops::function::FnOnce<(rustc_middle[835d091ebc4d05d9]::ty::context::TyCtxt, rustc_span[a69db53e102135]::def_id::LocalDefId)>>::call_once
31: 0x7fab0ff842ff - rustc_query_system[95ed59712a59403e]::query::plumbing::try_execute_query::<rustc_query_impl[2a0ca4be8ec05b8b]::DynamicConfig<rustc_query_system[95ed59712a59403e]::query::caches::VecCache<rustc_span[a69db53e102135]::def_id::LocalDefId, rustc_middle[835d091ebc4d05d9]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2a0ca4be8ec05b8b]::plumbing::QueryCtxt, false>
32: 0x7fab10f82442 - rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
33: 0x7fab10a4a727 - <rustc_middle[835d091ebc4d05d9]::hir::map::Map>::for_each_module::<rustc_hir_analysis[dc7bd52400bbf8cf]::check_crate::{closure#6}::{closure#0}>
34: 0x7fab10a49d7d - <rustc_session[2927e3ab783c954a]::session::Session>::time::<(), rustc_hir_analysis[dc7bd52400bbf8cf]::check_crate::{closure#6}>
35: 0x7fab10a49ad3 - rustc_hir_analysis[dc7bd52400bbf8cf]::check_crate
36: 0x7fab10a4926a - rustc_interface[950bb6185283f172]::passes::analysis
37: 0x7fab10aabf2a - rustc_query_impl[2a0ca4be8ec05b8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[835d091ebc4d05d9]::query::erase::Erased<[u8; 1usize]>>
38: 0x7fab10aabf19 - <rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::analysis::dynamic_query::{closure#2} as core[ef917bd033b821fa]::ops::function::FnOnce<(rustc_middle[835d091ebc4d05d9]::ty::context::TyCtxt, ())>>::call_once
39: 0x7fab10c76f48 - rustc_query_system[95ed59712a59403e]::query::plumbing::try_execute_query::<rustc_query_impl[2a0ca4be8ec05b8b]::DynamicConfig<rustc_query_system[95ed59712a59403e]::query::caches::SingleCache<rustc_middle[835d091ebc4d05d9]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[2a0ca4be8ec05b8b]::plumbing::QueryCtxt, false>
40: 0x7fab10c76d27 - rustc_query_impl[2a0ca4be8ec05b8b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
41: 0x7fab108fbe85 - <rustc_middle[835d091ebc4d05d9]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>
42: 0x7fab108fb4b2 - <rustc_interface[950bb6185283f172]::interface::Compiler>::enter::<rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}::{closure#2}, core[ef917bd033b821fa]::result::Result<core[ef917bd033b821fa]::option::Option<rustc_interface[950bb6185283f172]::queries::Linker>, rustc_span[a69db53e102135]::ErrorGuaranteed>>
43: 0x7fab108f4825 - rustc_span[a69db53e102135]::set_source_map::<core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>, rustc_interface[950bb6185283f172]::interface::run_compiler<core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>, rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
44: 0x7fab108f4296 - <scoped_tls[af683b2dcd27050]::ScopedKey<rustc_span[a69db53e102135]::SessionGlobals>>::set::<rustc_interface[950bb6185283f172]::interface::run_compiler<core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>, rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}>::{closure#0}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>
45: 0x7fab108f385c - std[c0adc0b90f4efda2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[950bb6185283f172]::util::run_in_thread_pool_with_globals<rustc_interface[950bb6185283f172]::interface::run_compiler<core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>, rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}>::{closure#0}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>
46: 0x7fab108f361e - <<std[c0adc0b90f4efda2]::thread::Builder>::spawn_unchecked_<rustc_interface[950bb6185283f172]::util::run_in_thread_pool_with_globals<rustc_interface[950bb6185283f172]::interface::run_compiler<core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>, rustc_driver_impl[5bf76b44b01c010b]::run_compiler::{closure#1}>::{closure#0}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ef917bd033b821fa]::result::Result<(), rustc_span[a69db53e102135]::ErrorGuaranteed>>::{closure#1} as core[ef917bd033b821fa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
47: 0x7fab0e371c55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hee3992ac1361b768
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/alloc/src/boxed.rs:2007:9
48: 0x7fab0e371c55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h98eb33f4039b4e2e
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/alloc/src/boxed.rs:2007:9
49: 0x7fab0e371c55 - std::sys::unix::thread::Thread::new::thread_start::h4a5bbbf722280c2f
at /rustc/0e8e857b11f60a785aea24a84f280f6dad7a4d42/library/std/src/sys/unix/thread.rs:108:17
50: 0x7fab0e10444b - <unknown>
51: 0x7fab0e187e40 - <unknown>
52: 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.73.0-nightly (0e8e857b1 2023-07-16) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [check_mod_item_types] checking item types in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0261, E0601.
For more information about an error, try `rustc --explain E0261`
Metadata
Metadata
Assignees
Labels
Area: Lifetimes / regionsCategory: This is a bug.`#![feature(return_position_impl_trait_in_trait)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Type
Projects
Status
Done