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: cannot relate region: LUB(ReErased, ReEmpty) #56350

Closed
Marwes opened this issue Nov 29, 2018 · 6 comments
Closed

ICE: cannot relate region: LUB(ReErased, ReEmpty) #56350

Marwes opened this issue Nov 29, 2018 · 6 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Marwes
Copy link
Contributor

Marwes commented Nov 29, 2018

Getting this ICE when compiling lalrpop/lalrpop#422 / https://github.com/lalrpop/lalrpop/tree/548df5c9f80df7d86500b29d07adfdc1b72a4631

Run

cargo build -p lalrpop && cargo test -p lalrpop-test
RUST_BACKTRACE=1 cargo test -p lalrpop-test
   Compiling lalrpop-test v0.16.2 (SNIP\lalrpop\lalrpop-test)
error: internal compiler error: src\librustc\infer\lexical_region_resolve\mod.rs:269: cannot relate region: LUB(ReErased, ReEmpty)

thread 'main' panicked at 'Box<Any>', src\librustc_errors\lib.rs:600:9
stack backtrace:
   0: std::sys_common::alloc::realloc_fallback
   1: std::panicking::take_hook
   2: std::panicking::take_hook
   3: rustc::ty::structural_impls::<impl rustc::ty::context::Lift<'tcx> for rustc::ty::instance::InstanceDef<'a>>::lift_to_tcx
   4: std::panicking::rust_panic_with_hook
   5: <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt
   6: rustc_errors::Handler::bug
   7: rustc::ty::context::tls::track_diagnostic
   8: rustc::ty::context::tls::track_diagnostic
   9: rustc::ty::context::tls::track_diagnostic
  10: rustc::ty::context::tls::track_diagnostic
  11: rustc::util::bug::bug_fmt
  12: rustc::util::bug::bug_fmt
  13: <rustc::ty::sty::Binder<rustc::ty::sty::TraitRef<'tcx>> as rustc::infer::at::ToTrace<'tcx>>::to_trace
  14: <rustc::ty::sty::Binder<rustc::ty::sty::TraitRef<'tcx>> as rustc::infer::at::ToTrace<'tcx>>::to_trace
  15: rustc::infer::InferCtxt::resolve_regions_and_report_errors
  16: <rustc_typeck::collect::ItemCtxt<'a, 'tcx> as rustc_typeck::astconv::AstConv<'tcx, 'tcx>>::set_tainted_by_errors
  17: <rustc_typeck::namespace::Namespace as core::fmt::Debug>::fmt
  18: <rustc_typeck::outlives::implicit_infer::IgnoreSelfTy as core::fmt::Debug>::fmt
  19: <rustc_typeck::check::CheckItemTypesVisitor<'a, 'tcx> as rustc::hir::itemlikevisit::ItemLikeVisitor<'tcx>>::visit_item
  20: rustc::ty::context::tls::track_diagnostic
  21: rustc::ty::context::tls::track_diagnostic
  22: rustc::dep_graph::graph::DepGraph::assert_ignored
  23: rustc::ty::context::tls::track_diagnostic
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  27: <rustc_typeck::check::CheckItemTypesVisitor<'a, 'tcx> as rustc::hir::itemlikevisit::ItemLikeVisitor<'tcx>>::visit_item
  28: rustc::ty::context::tls::track_diagnostic
  29: rustc::ty::context::tls::track_diagnostic
  30: rustc::dep_graph::graph::DepGraph::assert_ignored
  31: rustc::ty::context::tls::track_diagnostic
  32: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  34: rustc_typeck::check_crate
  35: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  36: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  37: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  38: rustc_driver::driver::compile_input
  39: rustc_driver::run_compiler
  40: <rustc_driver::profile::trace::Query as core::fmt::Debug>::fmt
  41: rustc_driver::run_compiler
  42: <rustc_driver::profile::trace::Query as core::fmt::Debug>::fmt
  43: <rustc_driver::pretty::IdentifiedAnnotation<'hir> as rustc_driver::pretty::HirPrinterSupport<'hir>>::sess
  44: _rust_maybe_catch_panic
  45: rustc_driver::profile::dump
  46: rustc_driver::main
  47: <unknown>
  48: std::panicking::update_panic_count
  49: _rust_maybe_catch_panic
  50: std::rt::lang_start_internal
  51: <unknown>
  52: <unknown>
  53: BaseThreadInitThunk
  54: RtlUserThreadStart
query stack during panic:
#0 [typeck_tables_of] processing `<associated_types::__parse__Term::__parse_table::__parse__Term::__StateMachine<'input, '__2, P> as lalrpop_util::state_machine::ParserDefinition>::simulate_reduce`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: aborting due to previous error

error: internal compiler error: src\librustc\infer\lexical_region_resolve\mod.rs:269: cannot relate region: LUB(ReErased, ReEmpty)

thread 'main' panicked at 'Box<Any>', src\librustc_errors\lib.rs:600:9

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.32.0-nightly (b68fc18c4 2018-11-27) running on x86_64-pc-windows-msvc

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

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

error: Could not compile `lalrpop-test`.
warning: build failed, waiting for other jobs to finish...
stack backtrace:
   0: std::sys_common::alloc::realloc_fallback
   1: std::panicking::take_hook
   2: std::panicking::take_hook
   3: rustc::ty::structural_impls::<impl rustc::ty::context::Lift<'tcx> for rustc::ty::instance::InstanceDef<'a>>::lift_to_tcx
   4: std::panicking::rust_panic_with_hook
   5: <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt
   6: rustc_errors::Handler::bug
   7: rustc::ty::context::tls::track_diagnostic
   8: rustc::ty::context::tls::track_diagnostic
   9: rustc::ty::context::tls::track_diagnostic
  10: rustc::ty::context::tls::track_diagnostic
  11: rustc::util::bug::bug_fmt
  12: rustc::util::bug::bug_fmt
  13: <rustc::ty::sty::Binder<rustc::ty::sty::TraitRef<'tcx>> as rustc::infer::at::ToTrace<'tcx>>::to_trace
  14: <rustc::ty::sty::Binder<rustc::ty::sty::TraitRef<'tcx>> as rustc::infer::at::ToTrace<'tcx>>::to_trace
  15: rustc::infer::InferCtxt::resolve_regions_and_report_errors
  16: <rustc_typeck::collect::ItemCtxt<'a, 'tcx> as rustc_typeck::astconv::AstConv<'tcx, 'tcx>>::set_tainted_by_errors
  17: <rustc_typeck::namespace::Namespace as core::fmt::Debug>::fmt
  18: <rustc_typeck::outlives::implicit_infer::IgnoreSelfTy as core::fmt::Debug>::fmt
  19: <rustc_typeck::check::CheckItemTypesVisitor<'a, 'tcx> as rustc::hir::itemlikevisit::ItemLikeVisitor<'tcx>>::visit_item
  20: rustc::ty::context::tls::track_diagnostic
  21: rustc::ty::context::tls::track_diagnostic
  22: rustc::dep_graph::graph::DepGraph::assert_ignored
  23: rustc::ty::context::tls::track_diagnostic
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  27: <rustc_typeck::check::CheckItemTypesVisitor<'a, 'tcx> as rustc::hir::itemlikevisit::ItemLikeVisitor<'tcx>>::visit_item
  28: rustc::ty::context::tls::track_diagnostic
  29: rustc::ty::context::tls::track_diagnostic
  30: rustc::dep_graph::graph::DepGraph::assert_ignored
  31: rustc::ty::context::tls::track_diagnostic
  32: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_print_query_stack
  34: rustc_typeck::check_crate
  35: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  36: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  37: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  38: rustc_driver::driver::compile_input
  39: rustc_driver::run_compiler
  40: <rustc_driver::profile::trace::Query as core::fmt::Debug>::fmt
  41: rustc_driver::run_compiler
  42: <rustc_driver::profile::trace::Query as core::fmt::Debug>::fmt
  43: <rustc_driver::pretty::IdentifiedAnnotation<'hir> as rustc_driver::pretty::HirPrinterSupport<'hir>>::sess
  44: _rust_maybe_catch_panic
  45: rustc_driver::profile::dump
  46: rustc_driver::main
  47: <unknown>
  48: std::panicking::update_panic_count
  49: _rust_maybe_catch_panic
  50: std::rt::lang_start_internal
  51: <unknown>
  52: <unknown>
  53: BaseThreadInitThunk
  54: RtlUserThreadStart
query stack during panic:
#0 [typeck_tables_of] processing `<associated_types::__parse__Term::__parse_table::__parse__Term::__StateMachine<'input, '__2, P> as lalrpop_util::state_machine::ParserDefinition>::simulate_reduce`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: aborting due to previous error


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.32.0-nightly (b68fc18c4 2018-11-27) running on x86_64-pc-windows-msvc

note: compiler flags: -C debuginfo=2 -C incremental

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

error: Could not compile `lalrpop-test`.

To learn more, run the command again with --verbose.

Reproduces on the newest nightly

rustc --version --verbose
rustc 1.32.0-nightly (b68fc18c4 2018-11-27)
binary: rustc
commit-hash: b68fc18c45350e1cdcd83cecf0f12e294e55af56
commit-date: 2018-11-27
host: x86_64-pc-windows-msvc
release: 1.32.0-nightly
LLVM version: 8.0

Does not reproduce on a ~1 week old nightly (so I think it is a different ICE than the similiar ICEs found on the issue tracker).

rustc --version --verbose
rustc 1.32.0-nightly (f1e2fa8f0 2018-11-20)
binary: rustc
commit-hash: f1e2fa8f0469aac1ea69dd5b6164e1d198d57934
commit-date: 2018-11-20
host: x86_64-pc-windows-msvc
release: 1.32.0-nightly
LLVM version: 8.0
@estebank estebank added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Nov 29, 2018
@qnighy
Copy link
Contributor

qnighy commented Dec 1, 2018

This might be a second regression introduced by #56045. I saw a similar message preparing #56282, which fill fix another regression #56237.

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 6, 2018
@pnkfelix
Copy link
Member

pnkfelix commented Dec 6, 2018

triage. P-high. I'll assign to my self for initial investigation.

@pnkfelix pnkfelix added the P-high High priority label Dec 6, 2018
@pnkfelix pnkfelix self-assigned this Dec 6, 2018
@qnighy
Copy link
Contributor

qnighy commented Dec 8, 2018

Seems to compile on the latest nightly (rustc 1.32.0-nightly (4a45578bc 2018-12-07)). #56282 may have fixed it.

@alexcrichton alexcrichton added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Dec 8, 2018
@alexcrichton alexcrichton removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Dec 8, 2018
@pnkfelix
Copy link
Member

(even if this is fixed by the latest nightly, I want to keep this issue open until we've backport #56282 to beta -- that, or declined to do such a backport. The T-compiler team will address this on Thursday.)

@Mark-Simulacrum
Copy link
Member

@pnkfelix
Copy link
Member

okay PR #56282 was approved for beta backport, which I believe landed in PR #56930. Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants