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

internal compiler error: compiler/rustc_borrowck/src/universal_regions.rs:888:36: cannot convert '{erased} to a region vid #137159

Closed
chorman0773 opened this issue Feb 17, 2025 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chorman0773
Copy link
Contributor

Code

https://github.com/LiliumOS/ld-so-impl

I have a hunch about what the cause is but I'm going to post this ahead of that test

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (5bc623145 2025-02-16)
binary: rustc
commit-hash: 5bc62314547c7639484481f62f218156697cfef0
commit-date: 2025-02-16
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 19.1.7

Error output

error: internal compiler error: compiler/rustc_borrowck/src/universal_regions.rs:888:36: cannot convert `'{erased}` to a region vid


thread 'rustc' panicked at compiler/rustc_borrowck/src/universal_regions.rs:888:36:
Box<dyn Any>
Backtrace

   0:     0x7f29147dea00 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h81a025b838a799af
   1:     0x7f291502e3fc - core::fmt::write::hd3823ab55c7d999c
   2:     0x7f29162c6891 - std::io::Write::write_fmt::h5e6af3943896250f
   3:     0x7f29147de862 - std::sys::backtrace::BacktraceLock::print::hf5bb184f356adeed
   4:     0x7f29147e0ce2 - std::panicking::default_hook::{{closure}}::h2fb43070f4f38070
   5:     0x7f29147e0b6a - std::panicking::default_hook::hc3e68110c7118279
   6:     0x7f291393f5d9 - std[ca4a46111f2ac979]::panicking::update_hook::<alloc[23c9a7aa388813b8]::boxed::Box<rustc_driver_impl[9a3794d01d686e58]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f29147e1863 - std::panicking::rust_panic_with_hook::ha716adeeb3fcca6d
   8:     0x7f291397a541 - std[ca4a46111f2ac979]::panicking::begin_panic::<rustc_errors[408e59f76d65792a]::ExplicitBug>::{closure#0}
   9:     0x7f291396f4b6 - std[ca4a46111f2ac979]::sys::backtrace::__rust_end_short_backtrace::<std[ca4a46111f2ac979]::panicking::begin_panic<rustc_errors[408e59f76d65792a]::ExplicitBug>::{closure#0}, !>
  10:     0x7f291396f4a3 - std[ca4a46111f2ac979]::panicking::begin_panic::<rustc_errors[408e59f76d65792a]::ExplicitBug>
  11:     0x7f2913984511 - <rustc_errors[408e59f76d65792a]::diagnostic::BugAbort as rustc_errors[408e59f76d65792a]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7f2913f58353 - rustc_middle[ffbde0fb0a97a70]::util::bug::opt_span_bug_fmt::<rustc_span[4ccf6a12323e11a7]::span_encoding::Span>::{closure#0}
  13:     0x7f2913f4118a - rustc_middle[ffbde0fb0a97a70]::ty::context::tls::with_opt::<rustc_middle[ffbde0fb0a97a70]::util::bug::opt_span_bug_fmt<rustc_span[4ccf6a12323e11a7]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7f2913f4101b - rustc_middle[ffbde0fb0a97a70]::ty::context::tls::with_context_opt::<rustc_middle[ffbde0fb0a97a70]::ty::context::tls::with_opt<rustc_middle[ffbde0fb0a97a70]::util::bug::opt_span_bug_fmt<rustc_span[4ccf6a12323e11a7]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7f29126f8f70 - rustc_middle[ffbde0fb0a97a70]::util::bug::bug_fmt
  16:     0x7f29164e7c8f - <rustc_borrowck[bb7cc0771ba28ea2]::universal_regions::UniversalRegionIndices>::to_region_vid.cold
  17:     0x7f291505a381 - <rustc_middle[ffbde0fb0a97a70]::ty::Ty as rustc_type_ir[44a8b8b46de4628a]::fold::TypeSuperFoldable<rustc_middle[ffbde0fb0a97a70]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_type_ir[44a8b8b46de4628a]::fold::RegionFolder<rustc_middle[ffbde0fb0a97a70]::ty::context::TyCtxt>>
  18:     0x7f2916077f09 - rustc_borrowck[bb7cc0771ba28ea2]::do_mir_borrowck
  19:     0x7f29160758ed - rustc_query_impl[1c28f5bf7cdb6e44]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c28f5bf7cdb6e44]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ffbde0fb0a97a70]::query::erase::Erased<[u8; 8usize]>>
  20:     0x7f29154347c7 - rustc_query_system[adcf6d99c8674cd]::query::plumbing::try_execute_query::<rustc_query_impl[1c28f5bf7cdb6e44]::DynamicConfig<rustc_data_structures[8645f6f92c55d6af]::vec_cache::VecCache<rustc_span[4ccf6a12323e11a7]::def_id::LocalDefId, rustc_middle[ffbde0fb0a97a70]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[adcf6d99c8674cd]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[1c28f5bf7cdb6e44]::plumbing::QueryCtxt, true>
  21:     0x7f2915451cf5 - rustc_query_impl[1c28f5bf7cdb6e44]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  22:     0x7f291542b0dc - rustc_interface[86fb661cc3809d83]::passes::run_required_analyses
  23:     0x7f2915ab111e - rustc_interface[86fb661cc3809d83]::passes::analysis
  24:     0x7f2915ab10ef - rustc_query_impl[1c28f5bf7cdb6e44]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c28f5bf7cdb6e44]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ffbde0fb0a97a70]::query::erase::Erased<[u8; 0usize]>>
  25:     0x7f29160c6c53 - rustc_query_system[adcf6d99c8674cd]::query::plumbing::try_execute_query::<rustc_query_impl[1c28f5bf7cdb6e44]::DynamicConfig<rustc_query_system[adcf6d99c8674cd]::query::caches::SingleCache<rustc_middle[ffbde0fb0a97a70]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[1c28f5bf7cdb6e44]::plumbing::QueryCtxt, true>
  26:     0x7f29160c65d5 - rustc_query_impl[1c28f5bf7cdb6e44]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  27:     0x7f2915f57a29 - rustc_interface[86fb661cc3809d83]::passes::create_and_enter_global_ctxt::<core[2bd42581db974919]::option::Option<rustc_interface[86fb661cc3809d83]::queries::Linker>, rustc_driver_impl[9a3794d01d686e58]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  28:     0x7f2915f36329 - rustc_interface[86fb661cc3809d83]::interface::run_compiler::<(), rustc_driver_impl[9a3794d01d686e58]::run_compiler::{closure#0}>::{closure#1}
  29:     0x7f2915e8df84 - std[ca4a46111f2ac979]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[86fb661cc3809d83]::util::run_in_thread_with_globals<rustc_interface[86fb661cc3809d83]::util::run_in_thread_pool_with_globals<rustc_interface[86fb661cc3809d83]::interface::run_compiler<(), rustc_driver_impl[9a3794d01d686e58]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  30:     0x7f2915e8dc59 - <<std[ca4a46111f2ac979]::thread::Builder>::spawn_unchecked_<rustc_interface[86fb661cc3809d83]::util::run_in_thread_with_globals<rustc_interface[86fb661cc3809d83]::util::run_in_thread_pool_with_globals<rustc_interface[86fb661cc3809d83]::interface::run_compiler<(), rustc_driver_impl[9a3794d01d686e58]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[2bd42581db974919]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7f2915e8d3eb - std::sys::pal::unix::thread::Thread::new::thread_start::h305cd0ee63d4587a
  32:     0x7f290fea1e2e - start_thread
                               at ./nptl/pthread_create.c:447:8
  33:     0x7f290ff33a4c - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  34:                0x0 - <unknown>

@chorman0773 chorman0773 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 17, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 17, 2025
@chorman0773
Copy link
Contributor Author

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d8d035ee49cb6a4a902d1222e58379c8

pub unsafe fn foo<'a>() -> &'a (){todo!()}

::core::arch::global_asm!{
    "/*{}*/",
    sym foo
}

Minimized.

Incidentally, making 'a anything other than an unbound lifetime does not cause an ICE.

@compiler-errors
Copy link
Member

This is a duplicate of #96304. Making 'a late-bound will "hide" the error bc of differences in how early- and late-bound lifetimes are handled borrowck.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

4 participants