Closed
Description
#![feature(arbitrary_self_types)]
#![feature(existential_type)]
use std::ops::Deref;
trait Route {
type Extension: Route;
fn extend(self: impl Deref<Target = Self>) -> Self::Extension;
}
impl<C> Route for C {
existential type Extension: Route;
fn extend(self: impl Deref<Target = Self>) -> Self::Extension {
self
}
}
Compiling playground v0.0.1 (/playground)
error: internal compiler error: src/librustc/ty/subst.rs:480: Type parameter `impl Deref<Target = Self>/#1` (impl Deref<Target = Self>/1) out of range when substituting (root type=Some(impl Deref<Target = Self>)) substs=[C]
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:526:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:70
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:200
3: std::panicking::default_hook
at src/libstd/panicking.rs:215
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:482
6: std::panicking::begin_panic
7: rustc_errors::Handler::span_bug
8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
9: rustc::ty::context::tls::with_opt::{{closure}}
10: rustc::ty::context::tls::with_context_opt
11: rustc::ty::context::tls::with_opt
12: rustc::util::bug::opt_span_bug_fmt
13: rustc::util::bug::span_bug_fmt
14: <rustc::ty::subst::SubstFolder<'a, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
15: rustc::infer::InferCtxt::commit_if_ok
16: <rustc::traits::query::type_op::custom::CustomTypeOp<F, G> as rustc::traits::query::type_op::TypeOp<'gcx, 'tcx>>::fully_perform
17: rustc_mir::borrow_check::nll::type_check::TypeChecker::eq_opaque_type_and_type
18: rustc_mir::borrow_check::nll::type_check::type_check
19: rustc_mir::borrow_check::nll::compute_regions
20: rustc_mir::borrow_check::do_mir_borrowck
21: rustc::ty::context::GlobalCtxt::enter_local
22: rustc_mir::borrow_check::mir_borrowck
23: rustc::ty::query::__query_compute::mir_borrowck
24: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_borrowck<'tcx>>::compute
25: rustc::dep_graph::graph::DepGraph::with_task_impl
26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
27: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners
28: rustc::util::common::time
29: <std::thread::local::LocalKey<T>>::with
30: rustc::ty::context::TyCtxt::create_and_enter
31: rustc_driver::driver::compile_input
32: rustc_driver::run_compiler_with_pool
33: <scoped_tls::ScopedKey<T>>::set
34: rustc_driver::run_compiler
35: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
#0 [mir_borrowck] processing `<C as Route>::extend`
end of query stack
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Area: Non-lexical lifetimes (NLL)Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Type systemCategory: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(arbitrary_self_types)]``#[feature(type_alias_impl_trait)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Working towards the "valid code works" goalMedium priorityRelevant 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