Skip to content

Start using pattern types in libcore #136006

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 24, 2025

cc #135996

blocked on rust-analyzer getting support for computing the right layout for pattern types

cc @Veykril no rush here, as long as we can't replace NonNull, there's no point in doing this change just yet

@rustbot

This comment was marked as outdated.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 24, 2025
@oli-obk oli-obk added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2025
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well r=me when/if it does get unblocked.

@rust-log-analyzer

This comment has been minimized.

#[repr(transparent)]
$(#[$m])*
#[cfg(not(bootstrap))]
$vis struct $name(pattern_type!($int is $low..=$high));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure: at least for the NonZeroBlahInner ones, it'd be nicer if these could just be type $name = pattern_type!($int is $low..=$high);, without the extra wrapper. Is that feasible, or are the trait implementations too far off?

(Relatedly, I'd love to be able to just derive traits on these again, particularly to not have to manually StructuralPartialEq.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea... I wanna get there, but directly using pattern types is not a great experience at present

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@Veykril
Copy link
Member

Veykril commented Jan 27, 2025

Re rust-analyzer blocker, as it turns out to implement pattern types (to a degree that would unblock this) it comes down to the same architecture changes required as for rust-lang/rust-analyzer#7434 (which I am currently looking into), so that will take a bit.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from a53ab8e to 78978b1 Compare June 3, 2025 14:29
@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Jun 3, 2025
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

☔ The latest upstream changes (presumably #141984) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch 2 times, most recently from 273e347 to 60ff307 Compare June 5, 2025 11:17
@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 60ff307 to 3b1a4e0 Compare June 6, 2025 08:25
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 3b1a4e0 to a0b3c54 Compare June 6, 2025 13:55
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 6, 2025

Will fix the ICE in #142124

@bors
Copy link
Collaborator

bors commented Jun 7, 2025

☔ The latest upstream changes (presumably #142133) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

Comment on lines +270 to +268
ty::PatternKind::NotNull => {
self.tcx.types.unit.print(self)?;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pattern types temporarily reusing tuple encoding risk breakage due to symbol conflicts. For example, the following fails to compile with -Csymbol-mangling-version=v0:

#![feature(pattern_types)]
#![feature(pattern_type_macro)]
use std::hint::black_box;
use std::mem::size_of;
use std::pat::pattern_type;

fn main() {
    black_box(size_of::<pattern_type!(usize is 0..=1)> as fn() -> usize);
    black_box(size_of::<(usize, [(); 0], [(); 1])> as fn() -> usize);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yea, I guess I need to change rustc-demangle first, then update our internal dependency on it, then update what we emit

@bors
Copy link
Collaborator

bors commented Jun 16, 2025

☔ The latest upstream changes (presumably #142556) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from b329461 to e2e8462 Compare July 7, 2025 09:46
@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] time test:true 1.525
[RUSTC-TIMING] test test:true 16.354
[RUSTC-TIMING] windows test:true 0.142
[RUSTC-TIMING] path test:true 21.176
error: internal compiler error: /checkout/compiler/rustc_codegen_ssa/src/base.rs:304:14: coerce_unsized_into: invalid coercion pattern_type!(*const alloc::sync::ArcInner<usize> is !null) -> pattern_type!(*const alloc::sync::ArcInner<dyn [Binder { value: Trait(std::any::Any), bound_vars: [] }, Binder { value: AutoTrait(DefId(2:3667 ~ core[5246]::marker::Sync)), bound_vars: [] }, Binder { value: AutoTrait(DefId(2:38230 ~ core[5246]::marker::Send)), bound_vars: [] }] + '{erased}> is !null)


thread 'rustc' panicked at /checkout/compiler/rustc_codegen_ssa/src/base.rs:304:14:
Box<dyn Any>
stack backtrace:
   0:     0x7efeb82f25f2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3f25e7a042e0f78f
   1:     0x7efeb8340f63 - core::fmt::write::h9228492c07172c71
   2:     0x7efeb82e6cf3 - std::io::Write::write_fmt::hbc89b049541b1f3f
   3:     0x7efeb82f2442 - std::sys::backtrace::BacktraceLock::print::h84d9c59f112a45df
   4:     0x7efeb82f601c - std::panicking::default_hook::{{closure}}::h5230ec8d3834b5dc
   5:     0x7efeb82f5e1f - std::panicking::default_hook::h82fc2bc32e1ed222
   6:     0x7efeb3a7a752 - <alloc[d932a86623700fa6]::boxed::Box<rustc_driver_impl[fadc6ac6fbf5a795]::install_ice_hook::{closure#1}> as core[53647cb28d9a8e2]::ops::function::Fn<(&dyn for<'a, 'b> core[53647cb28d9a8e2]::ops::function::Fn<(&'a std[c965b0aa6c3056df]::panic::PanicHookInfo<'b>,), Output = ()> + core[53647cb28d9a8e2]::marker::Send + core[53647cb28d9a8e2]::marker::Sync, &std[c965b0aa6c3056df]::panic::PanicHookInfo)>>::call
   7:     0x7efeb82f6aeb - std::panicking::rust_panic_with_hook::h7841a0c9dd31384d
   8:     0x7efeb7ec7233 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>::{closure#0}
   9:     0x7efeb7ec67a6 - std[c965b0aa6c3056df]::sys::backtrace::__rust_end_short_backtrace::<std[c965b0aa6c3056df]::panicking::begin_panic<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>::{closure#0}, !>
  10:     0x7efeb39b1d78 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>
  11:     0x7efeb39b1762 - <rustc_errors[1c84b2fc5f2f1f46]::diagnostic::BugAbort as rustc_errors[1c84b2fc5f2f1f46]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7efeb7cf5625 - rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt::<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}
  13:     0x7efeb7cf44aa - rustc_middle[b52fb886abeb7260]::ty::context::tls::with_opt::<rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7efeb7cf4446 - rustc_middle[b52fb886abeb7260]::ty::context::tls::with_context_opt::<rustc_middle[b52fb886abeb7260]::ty::context::tls::with_opt<rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7efeb399f1a2 - rustc_middle[b52fb886abeb7260]::util::bug::bug_fmt
  16:     0x7efeb3fcbd23 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  17:     0x7efeb3fcbc24 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  18:     0x7efeb3fcbc24 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  19:     0x7efeb40d08a4 - rustc_codegen_ssa[f0cfc9b362558ca6]::mir::codegen_mir::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  20:     0x7efeb3fcb6d1 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::codegen_instance::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  21:     0x7efeb3f4f1ee - <rustc_middle[b52fb886abeb7260]::mir::mono::MonoItem as rustc_codegen_ssa[f0cfc9b362558ca6]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  22:     0x7efeb4113252 - rustc_codegen_llvm[77dadc8689b3e58b]::base::compile_codegen_unit::module_codegen
  23:     0x7efeb4112b68 - rustc_codegen_llvm[77dadc8689b3e58b]::base::compile_codegen_unit
  24:     0x7efeb3fca71a - rustc_codegen_ssa[f0cfc9b362558ca6]::base::codegen_crate::<rustc_codegen_llvm[77dadc8689b3e58b]::LlvmCodegenBackend>
  25:     0x7efeb40196bf - <rustc_codegen_llvm[77dadc8689b3e58b]::LlvmCodegenBackend as rustc_codegen_ssa[f0cfc9b362558ca6]::traits::backend::CodegenBackend>::codegen_crate
  26:     0x7efeb3e7f195 - rustc_interface[660d6c224d413c8e]::passes::start_codegen
  27:     0x7efeb3dbd72a - <rustc_interface[660d6c224d413c8e]::queries::Linker>::codegen_and_build_linker
  28:     0x7efeb3b246bc - <std[c965b0aa6c3056df]::thread::local::LocalKey<core[53647cb28d9a8e2]::cell::Cell<*const ()>>>::with::<rustc_middle[b52fb886abeb7260]::ty::context::tls::enter_context<<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>::enter<rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>::{closure#1}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>
  29:     0x7efeb3a85a7c - <rustc_middle[b52fb886abeb7260]::ty::context::TyCtxt>::create_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  30:     0x7efeb3afb027 - <rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  31:     0x7efeb3a7953a - <alloc[d932a86623700fa6]::boxed::Box<dyn for<'a> core[53647cb28d9a8e2]::ops::function::FnOnce<(&'a rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &'a std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena<'a>>, &'a rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena<'a>>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}), Output = core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>> as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2})>>::call_once
  32:     0x7efeb3acde92 - rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>
  33:     0x7efeb3abc3a3 - rustc_span[2c7afcedf470821c]::create_session_globals_then::<(), rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
  34:     0x7efeb3a6ce99 - std[c965b0aa6c3056df]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  35:     0x7efeb3acaa73 - <<std[c965b0aa6c3056df]::thread::Builder>::spawn_unchecked_<rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[53647cb28d9a8e2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7efeb82fb177 - std::sys::pal::unix::thread::Thread::new::thread_start::h208e5045c7868bf5
  37:     0x7efeb2c6bac3 - <unknown>
  38:     0x7efeb2cfd850 - <unknown>
  39:                0x0 - <unknown>

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

warning: the ICE couldn't be written to `/checkout/rustc-ice-2025-07-07T10_33_23-55016.txt`: Read-only file system (os error 30)

note: rustc 1.90.0-nightly (155cec94a 2025-07-07) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C debug-assertions=on -C symbol-mangling-version=legacy -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -Z validate-mir -Z mir-opt-level=3 -Z inline-mir -Z inline-mir-preserve-debug -Z mir_strip_debuginfo=locals-in-tiny-functions -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C embed-bitcode=yes -Z unstable-options -C force-frame-pointers=non-leaf -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
[RUSTC-TIMING] alloctests test:true 26.849
error: could not compile `alloctests` (test "alloctests")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name alloctests --edition=2021 library/alloctests/tests/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 --warn=unexpected_cfgs --check-cfg 'cfg(no_global_oom_handling)' --check-cfg 'cfg(no_rc)' --check-cfg 'cfg(no_sync)' --check-cfg 'cfg(randomized_layouts)' -C debug-assertions=on --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=c9b269bb57d3027d -C extra-filename=-989d64cf613077a6 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern alloctests=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoctests-9307961706c1ee46.rlib --extern rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand-20418ab8b61e09c4.rlib --extern rand_xorshift=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand_xorshift-9916dc691942d3bf.rlib -Csymbol-mangling-version=legacy '--check-cfg=cfg(feature,values(any()))' -Zunstable-options -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zvalidate-mir -Zmir-opt-level=3 -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages -Cembed-bitcode=yes -Zunstable-options -Cforce-frame-pointers=non-leaf '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] stdbenches test:true 8.692
[RUSTC-TIMING] corebenches test:true 61.237
error: internal compiler error: /checkout/compiler/rustc_codegen_ssa/src/base.rs:304:14: coerce_unsized_into: invalid coercion pattern_type!(*const [i32; 3_usize] is !null) -> pattern_type!(*const [i32] is !null)


thread 'rustc' panicked at /checkout/compiler/rustc_codegen_ssa/src/base.rs:304:14:
Box<dyn Any>
stack backtrace:
   0:     0x7fd3dc2f25f2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3f25e7a042e0f78f
   1:     0x7fd3dc340f63 - core::fmt::write::h9228492c07172c71
   2:     0x7fd3dc2e6cf3 - std::io::Write::write_fmt::hbc89b049541b1f3f
   3:     0x7fd3dc2f2442 - std::sys::backtrace::BacktraceLock::print::h84d9c59f112a45df
   4:     0x7fd3dc2f601c - std::panicking::default_hook::{{closure}}::h5230ec8d3834b5dc
   5:     0x7fd3dc2f5e1f - std::panicking::default_hook::h82fc2bc32e1ed222
   6:     0x7fd3d7a7a752 - <alloc[d932a86623700fa6]::boxed::Box<rustc_driver_impl[fadc6ac6fbf5a795]::install_ice_hook::{closure#1}> as core[53647cb28d9a8e2]::ops::function::Fn<(&dyn for<'a, 'b> core[53647cb28d9a8e2]::ops::function::Fn<(&'a std[c965b0aa6c3056df]::panic::PanicHookInfo<'b>,), Output = ()> + core[53647cb28d9a8e2]::marker::Send + core[53647cb28d9a8e2]::marker::Sync, &std[c965b0aa6c3056df]::panic::PanicHookInfo)>>::call
   7:     0x7fd3dc2f6aeb - std::panicking::rust_panic_with_hook::h7841a0c9dd31384d
   8:     0x7fd3dbec7233 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>::{closure#0}
   9:     0x7fd3dbec67a6 - std[c965b0aa6c3056df]::sys::backtrace::__rust_end_short_backtrace::<std[c965b0aa6c3056df]::panicking::begin_panic<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>::{closure#0}, !>
  10:     0x7fd3d79b1d78 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[1c84b2fc5f2f1f46]::ExplicitBug>
  11:     0x7fd3d79b1762 - <rustc_errors[1c84b2fc5f2f1f46]::diagnostic::BugAbort as rustc_errors[1c84b2fc5f2f1f46]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7fd3dbcf5625 - rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt::<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}
  13:     0x7fd3dbcf44aa - rustc_middle[b52fb886abeb7260]::ty::context::tls::with_opt::<rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7fd3dbcf4446 - rustc_middle[b52fb886abeb7260]::ty::context::tls::with_context_opt::<rustc_middle[b52fb886abeb7260]::ty::context::tls::with_opt<rustc_middle[b52fb886abeb7260]::util::bug::opt_span_bug_fmt<rustc_span[2c7afcedf470821c]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7fd3d799f1a2 - rustc_middle[b52fb886abeb7260]::util::bug::bug_fmt
  16:     0x7fd3d7fcbd23 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  17:     0x7fd3d7fcbc24 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  18:     0x7fd3d7fcbc24 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::coerce_unsized_into::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  19:     0x7fd3d80d08a4 - rustc_codegen_ssa[f0cfc9b362558ca6]::mir::codegen_mir::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  20:     0x7fd3d7fcb6d1 - rustc_codegen_ssa[f0cfc9b362558ca6]::base::codegen_instance::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  21:     0x7fd3d7f4f1ee - <rustc_middle[b52fb886abeb7260]::mir::mono::MonoItem as rustc_codegen_ssa[f0cfc9b362558ca6]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[77dadc8689b3e58b]::builder::GenericBuilder<rustc_codegen_llvm[77dadc8689b3e58b]::context::FullCx>>
  22:     0x7fd3d8113252 - rustc_codegen_llvm[77dadc8689b3e58b]::base::compile_codegen_unit::module_codegen
  23:     0x7fd3d8112b68 - rustc_codegen_llvm[77dadc8689b3e58b]::base::compile_codegen_unit
  24:     0x7fd3d7fca71a - rustc_codegen_ssa[f0cfc9b362558ca6]::base::codegen_crate::<rustc_codegen_llvm[77dadc8689b3e58b]::LlvmCodegenBackend>
  25:     0x7fd3d80196bf - <rustc_codegen_llvm[77dadc8689b3e58b]::LlvmCodegenBackend as rustc_codegen_ssa[f0cfc9b362558ca6]::traits::backend::CodegenBackend>::codegen_crate
  26:     0x7fd3d7e7f195 - rustc_interface[660d6c224d413c8e]::passes::start_codegen
  27:     0x7fd3d7dbd72a - <rustc_interface[660d6c224d413c8e]::queries::Linker>::codegen_and_build_linker
  28:     0x7fd3d7b246bc - <std[c965b0aa6c3056df]::thread::local::LocalKey<core[53647cb28d9a8e2]::cell::Cell<*const ()>>>::with::<rustc_middle[b52fb886abeb7260]::ty::context::tls::enter_context<<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>::enter<rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>::{closure#1}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>
  29:     0x7fd3d7a85a7c - <rustc_middle[b52fb886abeb7260]::ty::context::TyCtxt>::create_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  30:     0x7fd3d7afb027 - <rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  31:     0x7fd3d7a7953a - <alloc[d932a86623700fa6]::boxed::Box<dyn for<'a> core[53647cb28d9a8e2]::ops::function::FnOnce<(&'a rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &'a std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena<'a>>, &'a rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena<'a>>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}), Output = core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>>> as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[363f174a13b72b97]::session::Session, rustc_middle[b52fb886abeb7260]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[eabb4c0c82288ef0]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[b52fb886abeb7260]::ty::context::GlobalCtxt>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_middle[b52fb886abeb7260]::arena::Arena>, &rustc_data_structures[eabb4c0c82288ef0]::sync::worker_local::WorkerLocal<rustc_hir[e7cde939b040abe4]::Arena>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2})>>::call_once
  32:     0x7fd3d7acde92 - rustc_interface[660d6c224d413c8e]::passes::create_and_enter_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[660d6c224d413c8e]::queries::Linker>, rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}::{closure#2}>
  33:     0x7fd3d7abc3a3 - rustc_span[2c7afcedf470821c]::create_session_globals_then::<(), rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
  34:     0x7fd3d7a6ce99 - std[c965b0aa6c3056df]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  35:     0x7fd3d7acaa73 - <<std[c965b0aa6c3056df]::thread::Builder>::spawn_unchecked_<rustc_interface[660d6c224d413c8e]::util::run_in_thread_with_globals<rustc_interface[660d6c224d413c8e]::util::run_in_thread_pool_with_globals<rustc_interface[660d6c224d413c8e]::interface::run_compiler<(), rustc_driver_impl[fadc6ac6fbf5a795]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[53647cb28d9a8e2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7fd3dc2fb177 - std::sys::pal::unix::thread::Thread::new::thread_start::h208e5045c7868bf5
  37:     0x7fd3d6c6bac3 - <unknown>
  38:     0x7fd3d6cfd850 - <unknown>
  39:                0x0 - <unknown>

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

warning: the ICE couldn't be written to `/checkout/rustc-ice-2025-07-07T10_33_27-55131.txt`: Read-only file system (os error 30)

note: rustc 1.90.0-nightly (155cec94a 2025-07-07) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C debug-assertions=on -C symbol-mangling-version=legacy -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -Z validate-mir -Z mir-opt-level=3 -Z inline-mir -Z inline-mir-preserve-debug -Z mir_strip_debuginfo=locals-in-tiny-functions -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C embed-bitcode=yes -Z unstable-options -C force-frame-pointers=non-leaf -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
[RUSTC-TIMING] coretests test:true 82.951
error: could not compile `coretests` (test "coretests")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name coretests --edition=2024 library/coretests/tests/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 --warn=unexpected_cfgs --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' -C debug-assertions=on --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=4112b08bb07295ef -C extra-filename=-cb463b5f5ba896ea --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern coretests=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcoretests-c118da5c8ee587a2.rlib --extern rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand-20418ab8b61e09c4.rlib --extern rand_xorshift=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand_xorshift-9916dc691942d3bf.rlib -Csymbol-mangling-version=legacy '--check-cfg=cfg(feature,values(any()))' -Zunstable-options -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zvalidate-mir -Zmir-opt-level=3 -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages -Cembed-bitcode=yes -Zunstable-options -Cforce-frame-pointers=non-leaf '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 101)
Build completed unsuccessfully in 0:02:41
  local time: Mon Jul  7 10:34:49 UTC 2025
  network time: Mon, 07 Jul 2025 10:34:50 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Collaborator

bors commented Jul 7, 2025

☔ The latest upstream changes (presumably #143582) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.