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

NLL impl_trait_in_bindings ICE #57200

Closed
DutchGhost opened this issue Dec 29, 2018 · 1 comment · Fixed by #69842
Closed

NLL impl_trait_in_bindings ICE #57200

DutchGhost opened this issue Dec 29, 2018 · 1 comment · Fixed by #69842
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@DutchGhost
Copy link
Contributor

DutchGhost commented Dec 29, 2018

#![feature(impl_trait_in_bindings)]
fn bug<'a, 'b, T>()
where
    'a: 'b,
{
    let f: impl Fn(&'a T) -> &'b T = |x| x;
}


fn main() {}
Backtrace:
thread 'rustc' panicked at 'assertion failed: self.universal_regions.is_universal_region(shorter)', src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs:335: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_mir::borrow_check::nll::type_check::free_region_relations::UniversalRegionRelations<'tcx> as rustc::infer::outlives::free_region_map::FreeRegionRelations<'tcx>>::sub_free_regions
   8: rustc::infer::InferCtxt::commit_if_ok
   9: <rustc::traits::query::type_op::custom::CustomTypeOp<F, G> as rustc::traits::query::type_op::TypeOp<'gcx, 'tcx>>::fully_perform
  10: rustc_mir::borrow_check::nll::type_check::TypeChecker::eq_opaque_type_and_type
  11: rustc_mir::borrow_check::nll::type_check::TypeChecker::check_stmt
  12: rustc_mir::borrow_check::nll::type_check::TypeChecker::typeck_mir
  13: rustc_mir::borrow_check::nll::type_check::type_check
  14: rustc_mir::borrow_check::do_mir_borrowck
  15: rustc::ty::context::GlobalCtxt::enter_local
  16: rustc_mir::borrow_check::mir_borrowck
  17: rustc::ty::query::__query_compute::mir_borrowck
  18: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_borrowck<'tcx>>::compute
  19: rustc::dep_graph::graph::DepGraph::with_task_impl
  20: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  21: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  22: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  23: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners
  24: rustc::util::common::time
  25: <std::thread::local::LocalKey<T>>::with
  26: rustc::ty::context::TyCtxt::create_and_enter
  27: rustc_driver::driver::compile_input
  28: rustc_driver::run_compiler_with_pool
  29: <scoped_tls::ScopedKey<T>>::set
  30: rustc_driver::run_compiler
  31: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
#0 [mir_borrowck] processing `bug`
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-nightly (60e825389 2018-12-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C codegen-units=1 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=fed15c3173e52cba9875b50dace18c00

2015's Edition compiles fine (without NLL), 2018 ICE's

@matthewjasper matthewjasper added A-NLL Area: Non-lexical lifetimes (NLL) A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. labels Dec 29, 2018
@Centril Centril added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 29, 2018
@matthewjasper matthewjasper self-assigned this Jan 23, 2019
@nikomatsakis nikomatsakis removed the A-NLL Area: Non-lexical lifetimes (NLL) label Jan 23, 2019
@matthewjasper matthewjasper removed their assignment May 31, 2019
@Centril Centril added F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` requires-nightly This issue requires a nightly compiler in some way. labels Jul 28, 2019
@jonas-schievink jonas-schievink added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Aug 6, 2019
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 15, 2019
@Alexendoo
Copy link
Member

Fixed by #67681

@Alexendoo Alexendoo added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Feb 16, 2020
Centril added a commit to Centril/rust that referenced this issue Mar 9, 2020
@bors bors closed this as completed in 7e903f8 Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants