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 related to normalizing erasing regions when using rkyv derive macro #97661

Closed
awygle opened this issue Jun 2, 2022 · 2 comments
Closed
Assignees
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

@awygle
Copy link

awygle commented Jun 2, 2022

I am sorry this is not further minimized into the rkyv source, I'm not especially familiar with that codebase. The particularly weird thing here is that if I build this as a binary rather than a library I do not get the ICE. I got this ICE in stable and the most recent nightly.

Also, it is more than likely that this code is wrong (as in, will not function for my desired effect), but it still shouldn't ICE, obviously.

Code

use rkyv::Archive;

#[derive(Archive)]
pub struct UnsequencedInput<'a> {
    payload: &'a [u8]
}

Meta

rustc --version --verbose:

rustc 1.63.0-nightly (12cd71f4d 2022-06-01)
binary: rustc
commit-hash: 12cd71f4d3ea6df9c2093781d55134cd9651d754
commit-date: 2022-06-01
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.4

Error output

error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:179:90: Failed to norma[46/1972]
8] as rkyv::Archive>::Resolver, maybe try to call `try_normalize_erasing_regions` instead                                 
                                                                                                                          
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/12cd71f4d3ea6df9c2093781d55134cd9651d754/compiler/rustc_errors/src/lib.r
s:1335:9                                                                                                                  
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug::<&alloc::string::String>
   3: <rustc_errors::Handler>::bug::<&alloc::string::String>
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span
>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFold
er>::fold_ty
   8: <alloc::vec::Vec<(rustc_middle::mir::Place, core::option::Option<rustc_mir_dataflow::move_paths::MovePathIndex>)> as
 alloc::vec::spec_from_iter::SpecFromIter<(rustc_middle::mir::Place, core::option::Option<rustc_mir_dataflow::move_paths::
MovePathIndex>), core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_m
iddle::ty::FieldDef>>, <rustc_mir_dataflow::elaborate_drops::DropCtxt<rustc_mir_transform::elaborate_drops::Elaborator>>::
move_paths_for_fields::{closure#0}>>>::from_iter
   9: <rustc_mir_dataflow::elaborate_drops::DropCtxt<rustc_mir_transform::elaborate_drops::Elaborator>>::elaborate_drop
  10: <rustc_mir_transform::elaborate_drops::ElaborateDrops as rustc_middle::mir::MirPass>::run_pass
  11: rustc_mir_transform::pass_manager::run_passes
  12: rustc_mir_transform::mir_drops_elaborated_and_const_checked
  13: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::
query::caches::DefaultCache<rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>, &rustc_data_structures::s
teal::Steal<rustc_middle::mir::Body>>>
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_drops_elaborated_and_const_checked
  15: rustc_mir_transform::optimized_mir
  16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::
query::caches::DefaultCache<rustc_span::def_id::DefId, &rustc_middle::mir::Body>>
  17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  18: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  19: rustc_metadata::rmeta::encoder::encode_metadata_impl
  20: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rm
eta::encoder::encode_metadata::{closure#1}, rustc_metadata::rmeta::encoder::EncodedMetadata, ()>
  21: rustc_metadata::rmeta::encoder::encode_metadata
  22: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::
{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_errors::ErrorGuaranteed>>
  23: <rustc_interface::queries::Queries>::ongoing_codegen
  24: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::
Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  25: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::c
reate_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::
{closure#1}>
  26: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Re
sult<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), r
ustc_errors::ErrorGuaranteed>> 
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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&t
emplate=ice.md

note: rustc 1.63.0-nightly (12cd71f4d 2022-06-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `_::<impl at unsequenced_producer/src/lib.rs:3:10: 3:17>
::resolve`
#1 [optimized_mir] optimizing MIR for `_::<impl at unsequenced_producer/src/lib.rs:3:10: 3:17>::resolve`
end of query stack

@awygle awygle 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 Jun 2, 2022
@compiler-errors
Copy link
Member

I believe this is #94651

@compiler-errors
Copy link
Member

Closing this as a duplicate of #94651.

@compiler-errors compiler-errors closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
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

2 participants