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

no errors encountered even though delay_span_bug issued #107691

Closed
winterqt opened this issue Feb 5, 2023 · 5 comments · Fixed by #107688
Closed

no errors encountered even though delay_span_bug issued #107691

winterqt opened this issue Feb 5, 2023 · 5 comments · Fixed by #107688
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@winterqt
Copy link
Contributor

winterqt commented Feb 5, 2023

The notable difference between this issue and others like it (#107684, #107678, #107686) are that this is happening in 1.67.0 (where the others have it in nightly), and in release mode (where at least one of them only happens in debug mode). Posting this as a separate ticket given these reasons, I hope that's okay.

Code

use rkyv::{
    with::{CopyOptimize, RefAsBox},
    Archive, Serialize,
};

#[derive(Archive, Serialize, Debug)]
pub struct Record<'a> {
    #[with(CopyOptimize, RefAsBox)]
    payload: &'a [u8],
}

(Tested with rkyv v0.7.39)

This only happens when building in release mode.

Meta

rustc --version --verbose:

rustc 1.67.0 (fc594f156 2023-01-24) (built from a source tarball)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: aarch64-apple-darwin
release: 1.67.0
LLVM version: 15.0.7

Error output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                Field projection `(*_4).field[0]` specified type `rkyv::boxed::ArchivedBox<[u8]>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Archived`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the macro `::core::ptr::addr_of_mut` which comes from the expansion of the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb4[12]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:36 ~ ice_repro[7457]::_#1::{impl#0}::serialize), const_param_did: None }) (after phase change to runtime-optimized) at bb3[5]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:19
  |
6 | #[derive(Archive, Serialize, Debug)]
  |                   ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
   0:        0x10533716c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5bd648d504842b6c
   1:        0x1053b3348 - core::fmt::write::h8a30860ecea56bd6
   2:        0x10535b880 - std::io::Write::write_fmt::h274353ec696abd45
   3:        0x105336f7c - std::sys_common::backtrace::print::hae9327e0193c2484
   4:        0x10532c234 - std::panicking::default_hook::{{closure}}::h6c2d4b88437caf03
   5:        0x10532bfcc - std::panicking::default_hook::heb240acabf7815b4
   6:        0x1093db804 - rustc_driver[b35e9b6b737ab360]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10532c884 - std::panicking::rust_panic_with_hook::hfdebfa07438c439a
   8:        0x10b30ed38 - std[d9acd6070f73bcf6]::panicking::begin_panic::<rustc_errors[491d78d41d29fe12]::ExplicitBug>::{closure#0}
   9:        0x10b30cbb4 - std[d9acd6070f73bcf6]::sys_common::backtrace::__rust_end_short_backtrace::<std[d9acd6070f73bcf6]::panicking::begin_panic<rustc_errors[491d78d41d29fe12]::ExplicitBug>::{closure#0}, !>
  10:        0x10b6a3180 - std[d9acd6070f73bcf6]::panicking::begin_panic::<rustc_errors[491d78d41d29fe12]::ExplicitBug>
  11:        0x10b2fdc4c - std[d9acd6070f73bcf6]::panic::panic_any::<rustc_errors[491d78d41d29fe12]::ExplicitBug>
  12:        0x10b305d3c - <rustc_errors[491d78d41d29fe12]::HandlerInner>::flush_delayed::<alloc[21e6e732353c4023]::vec::Vec<rustc_errors[491d78d41d29fe12]::diagnostic::Diagnostic>, &str>
  13:        0x10b3027bc - <rustc_errors[491d78d41d29fe12]::HandlerInner as core[ba9993f3380e93da]::ops::drop::Drop>::drop
  14:        0x1093ebd84 - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_session[30467953c583cb0d]::parse::ParseSess>
  15:        0x1093ed1fc - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_session[30467953c583cb0d]::session::Session>
  16:        0x1093c19f4 - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_interface[ebcbd89a6b84ecc5]::interface::Compiler>
  17:        0x1093ad1ac - rustc_span[80f08c829b755ffc]::with_source_map::<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  18:        0x1093a6968 - <scoped_tls[8ddbc68b9cbb90b1]::ScopedKey<rustc_span[80f08c829b755ffc]::SessionGlobals>>::set::<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>
  19:        0x1093f184c - std[d9acd6070f73bcf6]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ebcbd89a6b84ecc5]::util::run_in_thread_pool_with_globals<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>
  20:        0x1093e0600 - <<std[d9acd6070f73bcf6]::thread::Builder>::spawn_unchecked_<rustc_interface[ebcbd89a6b84ecc5]::util::run_in_thread_pool_with_globals<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#1} as core[ba9993f3380e93da]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x105355f94 - std::sys::unix::thread::Thread::new::thread_start::hcc1c30cde6d430b4
  22:        0x182c8206c - __pthread_deallocate

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.67.0 (fc594f156 2023-01-24) (built from a source tarball) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no

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

query stack during panic:
end of query stack
error: could not compile `ice-repro`
Backtrace

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                Field projection `(*_4).field[0]` specified type `rkyv::boxed::ArchivedBox<[u8]>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Archived`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the macro `::core::ptr::addr_of_mut` which comes from the expansion of the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb4[12]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:36 ~ ice_repro[7457]::_#1::{impl#0}::serialize), const_param_did: None }) (after phase change to runtime-optimized) at bb3[5]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:19
  |
6 | #[derive(Archive, Serialize, Debug)]
  |                   ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
   0:        0x10533716c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5bd648d504842b6c
   1:        0x1053b3348 - core::fmt::write::h8a30860ecea56bd6
   2:        0x10535b880 - std::io::Write::write_fmt::h274353ec696abd45
   3:        0x105336f7c - std::sys_common::backtrace::print::hae9327e0193c2484
   4:        0x10532c234 - std::panicking::default_hook::{{closure}}::h6c2d4b88437caf03
   5:        0x10532bfcc - std::panicking::default_hook::heb240acabf7815b4
   6:        0x1093db804 - rustc_driver[b35e9b6b737ab360]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10532c884 - std::panicking::rust_panic_with_hook::hfdebfa07438c439a
   8:        0x10b30ed38 - std[d9acd6070f73bcf6]::panicking::begin_panic::<rustc_errors[491d78d41d29fe12]::ExplicitBug>::{closure#0}
   9:        0x10b30cbb4 - std[d9acd6070f73bcf6]::sys_common::backtrace::__rust_end_short_backtrace::<std[d9acd6070f73bcf6]::panicking::begin_panic<rustc_errors[491d78d41d29fe12]::ExplicitBug>::{closure#0}, !>
  10:        0x10b6a3180 - std[d9acd6070f73bcf6]::panicking::begin_panic::<rustc_errors[491d78d41d29fe12]::ExplicitBug>
  11:        0x10b2fdc4c - std[d9acd6070f73bcf6]::panic::panic_any::<rustc_errors[491d78d41d29fe12]::ExplicitBug>
  12:        0x10b305d3c - <rustc_errors[491d78d41d29fe12]::HandlerInner>::flush_delayed::<alloc[21e6e732353c4023]::vec::Vec<rustc_errors[491d78d41d29fe12]::diagnostic::Diagnostic>, &str>
  13:        0x10b3027bc - <rustc_errors[491d78d41d29fe12]::HandlerInner as core[ba9993f3380e93da]::ops::drop::Drop>::drop
  14:        0x1093ebd84 - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_session[30467953c583cb0d]::parse::ParseSess>
  15:        0x1093ed1fc - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_session[30467953c583cb0d]::session::Session>
  16:        0x1093c19f4 - core[ba9993f3380e93da]::ptr::drop_in_place::<rustc_interface[ebcbd89a6b84ecc5]::interface::Compiler>
  17:        0x1093ad1ac - rustc_span[80f08c829b755ffc]::with_source_map::<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  18:        0x1093a6968 - <scoped_tls[8ddbc68b9cbb90b1]::ScopedKey<rustc_span[80f08c829b755ffc]::SessionGlobals>>::set::<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>
  19:        0x1093f184c - std[d9acd6070f73bcf6]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ebcbd89a6b84ecc5]::util::run_in_thread_pool_with_globals<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>
  20:        0x1093e0600 - <<std[d9acd6070f73bcf6]::thread::Builder>::spawn_unchecked_<rustc_interface[ebcbd89a6b84ecc5]::util::run_in_thread_pool_with_globals<rustc_interface[ebcbd89a6b84ecc5]::interface::run_compiler<core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>, rustc_driver[b35e9b6b737ab360]::run_compiler::{closure#1}>::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ba9993f3380e93da]::result::Result<(), rustc_errors[491d78d41d29fe12]::ErrorGuaranteed>>::{closure#1} as core[ba9993f3380e93da]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x105355f94 - std::sys::unix::thread::Thread::new::thread_start::hcc1c30cde6d430b4
  22:        0x182c8206c - __pthread_deallocate

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.67.0 (fc594f156 2023-01-24) (built from a source tarball) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no

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

query stack during panic:
end of query stack
error: could not compile `ice-repro`

[nix-shell:~/rust/ice-repro]$ RUST_BACKTRACE=1 ~/src/nixpkgs/result/bin/cargo b --release
   Compiling ice-repro v0.1.0 (/Users/winter/rust/ice-repro)
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                Field projection `(*_4).field[0]` specified type `rkyv::boxed::ArchivedBox<[u8]>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Archived`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the macro `::core::ptr::addr_of_mut` which comes from the expansion of the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:27 ~ ice_repro[7457]::_::{impl#0}::resolve), const_param_did: None }) (after phase change to runtime-optimized) at bb4[12]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:10
  |
6 | #[derive(Archive, Serialize, Debug)]
  |          ^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:36 ~ ice_repro[7457]::_#1::{impl#0}::serialize), const_param_did: None }) (after phase change to runtime-optimized) at bb3[5]:
                                Field projection `_3.field[0]` specified type `rkyv::boxed::BoxResolver<()>`, but actual type is `<rkyv::with::With<rkyv::with::With<&[u8], rkyv::with::RefAsBox>, rkyv::with::CopyOptimize> as rkyv::Archive>::Resolver`
 --> src/lib.rs:6:19
  |
6 | #[derive(Archive, Serialize, Debug)]
  |                   ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:233:30
  = note: this error: internal compiler error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::flush_delayed::<alloc::vec::Vec<rustc_errors::diagnostic::Diagnostic>, &str>
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place::<rustc_session::parse::ParseSess>
   5: core::ptr::drop_in_place::<rustc_session::session::Session>
   6: core::ptr::drop_in_place::<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
   8: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_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&template=ice.md

note: rustc 1.67.0 (fc594f156 2023-01-24) (built from a source tarball) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no

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

query stack during panic:
end of query stack
error: could not compile `ice-repro`

@winterqt winterqt 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 5, 2023
@lukas-code
Copy link
Member

I just confirmed this is also fixed by #107688, but it would be nice to have a reduced test case for this one.

@rustbot label E-needs-mcve

@rustbot rustbot added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 5, 2023
@lukas-code
Copy link
Member

Also possibly related: #107440

@winterqt
Copy link
Contributor Author

winterqt commented Feb 5, 2023

Can also confirm that this issue is fixed by #107688, thanks!

@lukas-code
Copy link
Member

lukas-code commented Feb 5, 2023

MCVE

needs to be library and release mode

pub trait Archive {
    type Archived;
    type Resolver;
    fn resolve(resolver: Self::Resolver, out: *mut Self::Archived);
}

pub type Archived<T> = <T as Archive>::Archived;
pub type Resolver<T> = <T as Archive>::Resolver;

pub struct Record<'a> {
    _payload: &'a [u8],
}

pub struct ArchivedRecord<'a>
where
    &'a [u8]: Archive,
{
    _payload: Archived<&'a [u8]>,
}

pub struct RecordResolver<'a>
where
    &'a [u8]: Archive,
{
    _payload: Resolver<&'a [u8]>,
}

impl<'a> Archive for Record<'a>
where
    &'a [u8]: Archive,
{
    type Archived = ArchivedRecord<'a>;
    type Resolver = RecordResolver<'a>;

    fn resolve(_resolver: Self::Resolver, _out: *mut Self::Archived) {}
}

@rustbot label -E-needs-mcve +S-bug-has-mcve

@rustbot rustbot added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Feb 5, 2023
@lukas-code
Copy link
Member

This regressed from 1.66.1 to 1.67.0.

@rustbot label regression-from-stable-to-stable

also cc downstream vectordotdev/vector#16212

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 7, 2023
winterqt added a commit to winterqt/nixpkgs that referenced this issue Feb 8, 2023
@bors bors closed this as completed in b082e80 Feb 8, 2023
winterqt added a commit to NixOS/nixpkgs that referenced this issue Feb 8, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 8, 2023
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) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants