Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE on lifetime in trait type parameter #60477

Closed
Disasm opened this issue May 2, 2019 · 1 comment
Closed

ICE on lifetime in trait type parameter #60477

Disasm opened this issue May 2, 2019 · 1 comment

Comments

@Disasm
Copy link
Contributor

Disasm commented May 2, 2019

pub trait Foo<T> {
    type Iter<'a>: Iterator<Item=&'a T>;
}
error: internal compiler error: src/librustc/ty/subst.rs:426: Region parameter out of range when substituting in region 'a (root type=Some(&'a T)) (index=2)

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:558:9

Meta

$ rustc --version --verbose
rustc 1.34.1 (fc50f328b 2019-04-24)
binary: rustc
commit-hash: fc50f328b0353b285421b8ff5d4100966387a997
commit-date: 2019-04-24
host: x86_64-unknown-linux-gnu
release: 1.34.1
LLVM version: 8.0
Backtrace:
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:558:9
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_region
  15: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  16: <rustc::ty::subst::SubstFolder<'a, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  17: rustc::ty::subst::Subst::subst
  18: <core::iter::adapters::Map<I, F> as core::iter::traits::iterator::Iterator>::fold
  19: rustc::ty::GenericPredicates::instantiate_into
  20: rustc::traits::project::opt_normalize_projection_type
  21: rustc::traits::project::normalize_projection_type
  22: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  23: <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  24: rustc::ty::fold::TypeFoldable::fold_with
  25: rustc::ty::fold::TypeFoldable::fold_with
  26: rustc::ty::fold::TypeFoldable::fold_with
  27: rustc::traits::project::normalize
  28: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  29: <core::iter::adapters::flatten::FlatMap<I, U, F> as core::iter::traits::iterator::Iterator>::next
  30: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  31: rustc::ty::wf::predicate_obligations
  32: <core::iter::adapters::flatten::FlatMap<I, U, F> as core::iter::traits::iterator::Iterator>::next
  33: rustc_typeck::check::wfcheck::check_where_clauses
  34: rustc::ty::context::GlobalCtxt::enter_local
  35: rustc_typeck::check::wfcheck::check_trait
  36: rustc_typeck::check::wfcheck::check_item_well_formed
  37: rustc::ty::query::__query_compute::check_item_well_formed
  38: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_item_well_formed<'tcx>>::compute
  39: rustc::dep_graph::graph::DepGraph::with_task_impl
  40: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  41: rustc::hir::Crate::visit_all_item_likes
  42: rustc::util::common::time
  43: rustc_typeck::check_crate
  44: <std::thread::local::LocalKey<T>>::with
  45: rustc::ty::context::TyCtxt::create_and_enter
  46: rustc_driver::driver::compile_input
  47: rustc_driver::run_compiler_with_pool
  48: <scoped_tls::ScopedKey<T>>::set
  49: rustc_driver::run_compiler
  50: syntax::with_globals
  51: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  52: <F as alloc::boxed::FnBox<A>>::call_box
  53: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/fc50f328b0353b285421b8ff5d4100966387a997/src/liballoc/boxed.rs:759
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  54: start_thread
  55: clone
query stack during panic:
#0 [check_item_well_formed] processing `Foo`
end of query stack
@jonas-schievink
Copy link
Contributor

Duplicate of #60147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants