-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Compilation of rkyv
(lib) is failing after upgrade to rust 1.71
#113781
Comments
duplicate of #112332 |
@lukas-code is there any work around , currently its completely broken |
The bug seems to be fixed in rkyv 0.7, so if you can upgrade that would probably be the best solution. Otherwise, if you're stuck with rkyv 0.6, you can hack around this by disabling the buggy optimization pass by setting these environment variables:
(Note that this enables unstable options on the stable compiler and isn't really supported.) |
Thanks a lot @lukas-code , for now it has worked |
@cjgillot by when we can expect this patch to be included in rust 1.71 |
@lukas-code This workaround does not work , when any optimisation level is set . |
…-errors Substitute types before checking inlining compatibility. Addresses rust-lang#112332 and rust-lang#113781 I don't have a minimal test, but I this seems to remove the ICE locally. This whole pre-inlining validation mirrors the "real" MIR validation pass to verify that inlined MIR will still pass validation. The debuginfo loop is added because MIR validation check projections in debuginfo. Likewise, MIR validation only checks `is_subtype`, so there is no reason for a stronger check. The types were not being substituted in `check_equal`, so we were not bailing out of inlining if the substituted MIR callee body would not pass validation.
Substitute types before checking inlining compatibility. Addresses rust-lang/rust#112332 and rust-lang/rust#113781 I don't have a minimal test, but I this seems to remove the ICE locally. This whole pre-inlining validation mirrors the "real" MIR validation pass to verify that inlined MIR will still pass validation. The debuginfo loop is added because MIR validation check projections in debuginfo. Likewise, MIR validation only checks `is_subtype`, so there is no reason for a stronger check. The types were not being substituted in `check_equal`, so we were not bailing out of inlining if the substituted MIR callee body would not pass validation.
error: internal compiler error: no errors encountered even though
delay_span_bug
issuederror: internal compiler error: broken MIR in Item(DefId(0:1705 ~ rkyv[d260]::std_impl::{impl#47}::deserialize)) (after phase change to runtime-optimized) at bb0[22]:
Field projection
PlaceRef { local: _1, projection: [Deref, Field(0, RelPtr<[<T as Archive>::Archived]>)] }.1
specified typeu32
, but actual type is<[<T as Archive>::Archived] as ArchivePointee>::ArchivedMetadata
--> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.6.7/src/core_impl/mod.rs:489:9
<code>
Meta
rustc --version --verbose
:Error output
error: internal compiler error: no errors encountered even though
delay_span_bug
issuederror: internal compiler error: broken MIR in Item(DefId(0:1705 ~ rkyv[14fb]::std_impl::{impl#47}::deserialize)) (after phase change to runtime-optimized) at bb0[27]:
Field projection
(*_19).1
specified typeu32
, but actual type is<[<T as Archive>::Archived] as ArchivePointee>::ArchivedMetadata
--> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.6.7/src/lib.rs:765:77
|
765 | ptr_meta::from_raw_parts(self.raw_ptr.as_ptr(), T::pointer_metadata(&self.metadata))
| ^^^^^^^^^^^^^^
|
= note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:354:30
0: <rustc_errors::HandlerInner>::emit_diagnostic
1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
2: <rustc_const_eval::transform::validate::TypeChecker>::fail::alloc::string::String
3: <rustc_const_eval::transform::validate::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_place
4: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
5: rustc_mir_transform::optimized_mir
6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
7: <rustc_query_impl::query_impl::optimized_mir::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
9: rustc_query_impl::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
10: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
11: rustc_metadata::rmeta::encoder::encode_metadata_impl
12: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
13: rustc_metadata::rmeta::encoder::encode_metadata
14: rustc_metadata::fs::encode_and_write_metadata
15: rustc_interface::passes::start_codegen
16: <rustc_middle::ty::context::GlobalCtxt>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box, rustc_span::ErrorGuaranteed>>
17: <rustc_interface::queries::Queries>::ongoing_codegen
18: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
19: std::sys_common::backtrace::_rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
20: <std::thread::Builder::spawn_unchecked<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
23: std::sys::unix::thread::Thread::new::thread_start
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
24: start_thread
25: __clone
error: internal compiler error: broken MIR in Item(DefId(0:1705 ~ rkyv[14fb]::std_impl::{impl#47}::deserialize)) (after phase change to runtime-optimized) at bb3[29]:
Field projection
(*_37).1
specified typeu32
, but actual type is<[<T as Archive>::Archived] as ArchivePointee>::ArchivedMetadata
--> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.6.7/src/lib.rs:765:77
|
765 | ptr_meta::from_raw_parts(self.raw_ptr.as_ptr(), T::pointer_metadata(&self.metadata))
| ^^^^^^^^^^^^^^
|
= note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:354:30
0: <rustc_errors::HandlerInner>::emit_diagnostic
1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
2: <rustc_const_eval::transform::validate::TypeChecker>::fail::alloc::string::String
3: <rustc_const_eval::transform::validate::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_place
4: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
5: rustc_mir_transform::optimized_mir
6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
7: <rustc_query_impl::query_impl::optimized_mir::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
9: rustc_query_impl::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
10: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
11: rustc_metadata::rmeta::encoder::encode_metadata_impl
12: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
13: rustc_metadata::rmeta::encoder::encode_metadata
14: rustc_metadata::fs::encode_and_write_metadata
15: rustc_interface::passes::start_codegen
16: <rustc_middle::ty::context::GlobalCtxt>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box, rustc_span::ErrorGuaranteed>>
17: <rustc_interface::queries::Queries>::ongoing_codegen
18: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
19: std::sys_common::backtrace::_rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
20: <std::thread::Builder::spawn_unchecked<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
23: std::sys::unix::thread::Thread::new::thread_start
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
24: start_thread
25: __clone
Backtrace
The text was updated successfully, but these errors were encountered: