rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.1k stars 12.55k forks source link

cannot relate region: LUB(ReErased, ReEmpty(U22)) #75883

Closed LeCyberDucky closed 3 years ago

LeCyberDucky commented 4 years ago

Hi, it appears that I've stumbled upon an internal compiler error.

Code

I'm sorry that I can't provide a minimal example, but I'm not on a level to understand what is going on (at least for now, heh :P). I'm just here, because the compiler told me to go here. I have, however, pushed a commit of my project in the state that yields the error: https://github.com/LeCyberDucky/bitgeon/tree/Error-handling

The error occurs when running cargo check --bin main or cargo +nightly check --bin main, for that matter.

Meta

rustc --version --verbose:

rustc 1.45.2 (d3fb005a3 2020-07-31)
binary: rustc
commit-hash: d3fb005a39e62501b8b0b356166e515ae24e2e54
commit-date: 2020-07-31
host: x86_64-pc-windows-msvc
release: 1.45.2
LLVM version: 10.0

Also happens on nightly:

rustc 1.47.0-nightly (5180f3da5 2020-08-23)
binary: rustc
commit-hash: 5180f3da5fd72627a8d38558ad1297df38793acd
commit-date: 2020-08-23
host: x86_64-pc-windows-msvc
release: 1.47.0-nightly
LLVM version: 11.0

Error output

error: internal compiler error: src\librustc_infer\infer\lexical_region_resolve\mod.rs:501:17: cannot relate region: LUB(ReErased, ReEmpty(U0))

thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:918:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

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.47.0-nightly (5180f3da5 2020-08-23) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

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

``` thread 'rustc' panicked at 'Box', src\librustc_errors\lib.rs:918:9 stack backtrace: 0: 0x7ffa741d9f69 - ::fmt::hfae6a97726d8b736 1: 0x7ffa74206f7b - core::fmt::write::hce2ddfec834877b8 2: 0x7ffa741cbae4 - ::fmt::h57a15d9f0ff2a3bc 3: 0x7ffa741df5cb - std::panicking::take_hook::h1925373a96008b93 4: 0x7ffa741df209 - std::panicking::take_hook::h1925373a96008b93 5: 0x7ffa4057e2da - rustc_driver::report_ice::h691a614479cbf5f9 6: 0x7ffa741dff60 - std::panicking::rust_panic_with_hook::h7f7de81d557f54d3 7: 0x7ffa44ad9420 - rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter::ui_testing::h342a15b3ea83deed 8: 0x7ffa44ad9299 - rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter::ui_testing::h342a15b3ea83deed 9: 0x7ffa44ad93c1 - rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter::ui_testing::h342a15b3ea83deed 10: 0x7ffa44aa741f - rustc_errors::HandlerInner::err_count::hde95b83d37d5673c 11: 0x7ffa44aa58e2 - rustc_errors::Handler::bug::h8dde62b9b1066bb6 12: 0x7ffa447b16f8 - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2 13: 0x7ffa447a74c0 - rustc_middle::ty::context::tls::ImplicitCtxt::new::hee3ec7f9c2036613 14: 0x7ffa447a73f6 - rustc_middle::ty::context::tls::ImplicitCtxt::new::hee3ec7f9c2036613 15: 0x7ffa447b162c - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2 16: 0x7ffa447b1590 - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2 17: 0x7ffa4441f9d5 - rustc_infer::infer::at::At::eq_impl_headers::h0438c0123706fd52 18: 0x7ffa4441f60b - rustc_infer::infer::at::At::eq_impl_headers::h0438c0123706fd52 19: 0x7ffa4441c618 - rustc_infer::infer::at::At::eq_impl_headers::h0438c0123706fd52 20: 0x7ffa4441ae3e - rustc_infer::infer::at::At::eq_impl_headers::h0438c0123706fd52 21: 0x7ffa444477a5 - rustc_infer::infer::InferCtxt::resolve_regions_and_report_errors::hdc4ef9538c1690b0 22: 0x7ffa42c9faa5 - rustc_typeck::check::regionck::::regionck_fn::h2c0844d774a487aa 23: 0x7ffa42ea395e - ::fmt::hd47536854a836cae 24: 0x7ffa42ca427f - ::fold_ty::h867fe2289cbd19a6 25: 0x7ffa42e25e7e - ::fmt::h9df5f6aadf76f4c6 26: 0x7ffa42da9b76 - ::fmt::h23984b0fc0edb9dc 27: 0x7ffa42df3697 - ::visit_generic_param::hd6c2af7cc4c28074 28: 0x7ffa42e022d2 - ::visit_generic_param::hd6c2af7cc4c28074 29: 0x7ffa42d1133e - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 30: 0x7ffa42e45e8a - ::visit_anon_const::h7a95589413018206 31: 0x7ffa42decfa1 - ::visit_generic_param::hd6c2af7cc4c28074 32: 0x7ffa42da9200 - ::fmt::h23984b0fc0edb9dc 33: 0x7ffa42df444b - ::visit_generic_param::hd6c2af7cc4c28074 34: 0x7ffa42e045dc - ::visit_generic_param::hd6c2af7cc4c28074 35: 0x7ffa42d28c5b - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 36: 0x7ffa42e1cd41 - rustc_typeck::check::method::probe::provide::h9dacf3c90b52281a 37: 0x7ffa42e17486 - rustc_typeck::check::method::probe::provide::h9dacf3c90b52281a 38: 0x7ffa42e16022 - rustc_typeck::check::method::probe::provide::h9dacf3c90b52281a 39: 0x7ffa42eb2697 - ::fmt::hd47536854a836cae 40: 0x7ffa42c79f96 - rustc_typeck::check::method::probe::::probe_for_name::hfd99b115a5e97702 41: 0x7ffa42c87c16 - rustc_typeck::check::method::::lookup_method::h605ea8d44c69baf9 42: 0x7ffa42c65cf0 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 43: 0x7ffa42c65346 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 44: 0x7ffa42cc6137 - rustc_typeck::check::FnCtxt::check_stmt::he9fdfdadf00ae15c 45: 0x7ffa42cc6b16 - rustc_typeck::check::FnCtxt::check_block_no_value::h587532fce6d42b9a 46: 0x7ffa42c658a8 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 47: 0x7ffa42c65346 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 48: 0x7ffa42c4b9df - rustc_typeck::check::_match::::check_match::ha2741c781afdaf34 49: 0x7ffa42c65a2f - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 50: 0x7ffa42c65346 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 51: 0x7ffa42cc6b4d - rustc_typeck::check::FnCtxt::check_block_no_value::h587532fce6d42b9a 52: 0x7ffa42cc647a - rustc_typeck::check::FnCtxt::check_block_no_value::h587532fce6d42b9a 53: 0x7ffa42c6efbf - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 54: 0x7ffa42c65346 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 55: 0x7ffa42cc5f2c - rustc_typeck::check::FnCtxt::check_stmt::he9fdfdadf00ae15c 56: 0x7ffa42cc6b16 - rustc_typeck::check::FnCtxt::check_block_no_value::h587532fce6d42b9a 57: 0x7ffa42c658a8 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 58: 0x7ffa42c65346 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 59: 0x7ffa42c77718 - rustc_typeck::check::expr::::check_expr_with_expectation::h31fe46ad61575e66 60: 0x7ffa42ca5bf0 - ::visit_pat::h91ac2640bc869925 61: 0x7ffa42ea33f1 - ::fmt::hd47536854a836cae 62: 0x7ffa42ca427f - ::fold_ty::h867fe2289cbd19a6 63: 0x7ffa42e25e7e - ::fmt::h9df5f6aadf76f4c6 64: 0x7ffa42da9b76 - ::fmt::h23984b0fc0edb9dc 65: 0x7ffa42df3697 - ::visit_generic_param::hd6c2af7cc4c28074 66: 0x7ffa42e022d2 - ::visit_generic_param::hd6c2af7cc4c28074 67: 0x7ffa42d1133e - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 68: 0x7ffa42e45e8a - ::visit_anon_const::h7a95589413018206 69: 0x7ffa42e25db1 - ::fmt::h9df5f6aadf76f4c6 70: 0x7ffa42da9200 - ::fmt::h23984b0fc0edb9dc 71: 0x7ffa42df444b - ::visit_generic_param::hd6c2af7cc4c28074 72: 0x7ffa42e045dc - ::visit_generic_param::hd6c2af7cc4c28074 73: 0x7ffa42d28c5b - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 74: 0x7ffa42d64791 - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 75: 0x7ffa42e40b1e - ::visit_impl_item::h36434602c51150aa 76: 0x7ffa42e3cabb - ::visit_item::hce7e1143b3799b82 77: 0x7ffa42d6f65d - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 78: 0x7ffa42dab9e6 - ::fmt::h23984b0fc0edb9dc 79: 0x7ffa42df68af - ::visit_generic_param::hd6c2af7cc4c28074 80: 0x7ffa42e03092 - ::visit_generic_param::hd6c2af7cc4c28074 81: 0x7ffa42d17908 - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 82: 0x7ffa42d641c5 - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 83: 0x7ffa42d710c3 - rustc_typeck::check::intrinsic::check_platform_intrinsic_type::h10efa74617b992ec 84: 0x7ffa42e54717 - rustc_typeck::check_crate::hfa34d01a976dedf2 85: 0x7ffa4087b65a - rustc_interface::passes::QueryContext::print_stats::h20b8fe0532b52929 86: 0x7ffa4059c00b - ::deref::hadcd711a94621615 87: 0x7ffa4050ca26 - ::check_mac_def::hb3829129d340a05d 88: 0x7ffa40585222 - ::deref::hadcd711a94621615 89: 0x7ffa40592032 - ::deref::hadcd711a94621615 90: 0x7ffa40540ca3 - ::generic_arg_data::h71f2dc6ba8dcf3ae 91: 0x7ffa4059cd7b - ::deref::hadcd711a94621615 92: 0x7ffa405332cc - ::fmt::h02e1be4607868908 93: 0x7ffa4059f1ab - ::deref::hadcd711a94621615 94: 0x7ffa4058bce0 - ::deref::hadcd711a94621615 95: 0x7ffa40592d89 - ::deref::hadcd711a94621615 96: 0x7ffa4052b7b3 - ::fmt::h6ff509d3525ea80f 97: 0x7ffa741efcca - std::sys::windows::thread::Thread::new::h84550e08827b3a3a 98: 0x7ffab0816fd4 - BaseThreadInitThunk 99: 0x7ffab18fcec1 - RtlUserThreadStart note: the compiler unexpectedly panicked. this is a bug. 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.47.0-nightly (5180f3da5 2020-08-23) running on x86_64-pc-windows-msvc note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [typeck] type-checking `ui::UI::interact` #1 [fn_sig] computing function signature of `ui::UI::interact` #2 [typeck] type-checking `ui::UI::run` #3 [fn_sig] computing function signature of `ui::UI::run` #4 [collect_mod_item_types] collecting item types in module `ui` #5 [analysis] running analysis passes on this crate end of query stack ```

I hope this helps. Please tell me, if there's more you need me to do. 🦀

matthiaskrgr commented 4 years ago

reduced:

pub struct UI {}

impl UI {
    pub fn run() -> Result<_> {
        let mut ui = UI {};
        ui.interact();

        unimplemented!();
    }

    pub fn interact(&mut self) -> Result<_> {
        unimplemented!();
    }
}
tesuji commented 4 years ago

@rustbot modify labels: -E-needs-mcve

spastorino commented 4 years ago

Assigning P-medium as [discussed as part of the Prioritization Working Group procedure](https://rust-lang.zulipchat.com/#narrow/stream/245100-t-compiler.2Fwg-prioritization.2Falerts/topic/I-prioritize.20.2375883.20cannot.20relate.20region.3A.20LUB\(ReErased.2C.20ReE.E2.80.A6) and removing I-prioritize.

matthiaskrgr commented 3 years ago

This ICEs since 1.44 @rustbot modify labels: +regression-from-stable-to-stable

JohnTitor commented 3 years ago

This issue has been fixed by #82494, marking as E-needs-test.