Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
oli-obk wants to merge 5 commits into rust-lang:master
base: master
Choose a base branch
Loading
from oli-obk:push-tzonluoyuwkq

Conversation

Copy link
Contributor

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

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

cramertj and Scripter17 reacted with heart emoji lqd and cramertj reacted with rocket emoji

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

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.

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

This comment has been minimized.

Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

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.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

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

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor Author

oli-obk commented Jun 6, 2025

Will fix the ICE in #142124

Copy link
Collaborator

bors commented Jun 7, 2025

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

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

Copy link
Collaborator

bors commented Jun 16, 2025

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

This comment has been minimized.

Copy link
Collaborator

bors commented Jul 7, 2025

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

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Jul 15, 2025
Copy link
Collaborator

rustbot commented Jul 15, 2025

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a

This comment has been minimized.

Copy link
Collaborator

bors commented Jul 22, 2025

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

This comment has been minimized.

Copy link
Collaborator

bors commented Jul 23, 2025

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

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] process_spawning test:true 1.282
[RUSTC-TIMING] floats test:true 1.907
[RUSTC-TIMING] num test:true 1.096
[RUSTC-TIMING] type_name_unsized test:true 0.248
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:3637 ~ core[0716]::marker::Sync)), bound_vars: [] }, Binder { value: AutoTrait(DefId(2:38218 ~ core[0716]::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: 0x7f898a7bcd82 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3f25e7a042e0f78f
 1: 0x7f898a80b6f3 - core::fmt::write::h9228492c07172c71
 2: 0x7f898a7b1483 - std::io::Write::write_fmt::hbc89b049541b1f3f
 3: 0x7f898a7bcbd2 - std::sys::backtrace::BacktraceLock::print::h84d9c59f112a45df
 4: 0x7f898a7c07ac - std::panicking::default_hook::{{closure}}::h5230ec8d3834b5dc
 5: 0x7f898a7c05af - std::panicking::default_hook::h82fc2bc32e1ed222
 6: 0x7f8985f58d32 - <alloc[d932a86623700fa6]::boxed::Box<rustc_driver_impl[6bcdcf93142f3bdf]::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: 0x7f898a7c127b - std::panicking::rust_panic_with_hook::h7841a0c9dd31384d
 8: 0x7f898a36e993 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>::{closure#0}
 9: 0x7f898a36e666 - std[c965b0aa6c3056df]::sys::backtrace::__rust_end_short_backtrace::<std[c965b0aa6c3056df]::panicking::begin_panic<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>::{closure#0}, !>
 10: 0x7f8985dc5aa4 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>
 11: 0x7f8985dc5a42 - <rustc_errors[a1f313aa0069ed6d]::diagnostic::BugAbort as rustc_errors[a1f313aa0069ed6d]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
 12: 0x7f8989fbec55 - rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt::<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}
 13: 0x7f8989fbd5da - rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_opt::<rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}, !>::{closure#0}
 14: 0x7f8989fbd576 - rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_context_opt::<rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_opt<rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
 15: 0x7f8985d7f7f2 - rustc_middle[9f3c98c38c00b5a6]::util::bug::bug_fmt
 16: 0x7f898651c6a3 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 17: 0x7f898651c5a4 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 18: 0x7f898651c5a4 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 19: 0x7f898638530a - rustc_codegen_ssa[d27da0192346df8a]::mir::codegen_mir::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 20: 0x7f8986523617 - <rustc_middle[9f3c98c38c00b5a6]::mir::mono::MonoItem as rustc_codegen_ssa[d27da0192346df8a]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 21: 0x7f898642aaa2 - rustc_codegen_llvm[d5cdcb2fcf06f31b]::base::compile_codegen_unit::module_codegen
 22: 0x7f898642a3b8 - rustc_codegen_llvm[d5cdcb2fcf06f31b]::base::compile_codegen_unit
 23: 0x7f898651b4ed - rustc_codegen_ssa[d27da0192346df8a]::base::codegen_crate::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::LlvmCodegenBackend>
 24: 0x7f898649bdbf - <rustc_codegen_llvm[d5cdcb2fcf06f31b]::LlvmCodegenBackend as rustc_codegen_ssa[d27da0192346df8a]::traits::backend::CodegenBackend>::codegen_crate
 25: 0x7f898619aa65 - rustc_interface[7d1b1ab6c7a3b353]::passes::start_codegen
 26: 0x7f89861ffd2a - <rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>::codegen_and_build_linker
 27: 0x7f8985e41f6c - <std[c965b0aa6c3056df]::thread::local::LocalKey<core[53647cb28d9a8e2]::cell::Cell<*const ()>>>::with::<rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::enter_context<<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>::enter<rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>::{closure#1}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>
 28: 0x7f8985eaa15b - <rustc_middle[9f3c98c38c00b5a6]::ty::context::TyCtxt>::create_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
 29: 0x7f8985f1d787 - <rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
 30: 0x7f8985f57b4a - <alloc[d932a86623700fa6]::boxed::Box<dyn for<'a> core[53647cb28d9a8e2]::ops::function::FnOnce<(&'a rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &'a std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena<'a>>, &'a rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena<'a>>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}), Output = core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>> as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2})>>::call_once
 31: 0x7f8985eefc5a - rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>
 32: 0x7f8985e8f643 - rustc_span[981f1240f2624e58]::create_session_globals_then::<(), rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
 33: 0x7f8985f4b899 - std[c965b0aa6c3056df]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
 34: 0x7f8985e9d6e3 - <<std[c965b0aa6c3056df]::thread::Builder>::spawn_unchecked_<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::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}
 35: 0x7f898a7c5907 - std::sys::pal::unix::thread::Thread::new::thread_start::h208e5045c7868bf5
 36: 0x7f898506bac3 - <unknown>
 37: 0x7f89850fd850 - <unknown>
 38: 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月24日T08_12_29-55099.txt`: Read-only file system (os error 30)
note: rustc 1.90.0-nightly (e361ea2fc 2025年07月24日) 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 27.687
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] allocbenches test:true 78.365
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: 0x7f93459bcd82 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3f25e7a042e0f78f
 1: 0x7f9345a0b6f3 - core::fmt::write::h9228492c07172c71
 2: 0x7f93459b1483 - std::io::Write::write_fmt::hbc89b049541b1f3f
 3: 0x7f93459bcbd2 - std::sys::backtrace::BacktraceLock::print::h84d9c59f112a45df
 4: 0x7f93459c07ac - std::panicking::default_hook::{{closure}}::h5230ec8d3834b5dc
 5: 0x7f93459c05af - std::panicking::default_hook::h82fc2bc32e1ed222
 6: 0x7f9341158d32 - <alloc[d932a86623700fa6]::boxed::Box<rustc_driver_impl[6bcdcf93142f3bdf]::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: 0x7f93459c127b - std::panicking::rust_panic_with_hook::h7841a0c9dd31384d
 8: 0x7f934556e993 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>::{closure#0}
 9: 0x7f934556e666 - std[c965b0aa6c3056df]::sys::backtrace::__rust_end_short_backtrace::<std[c965b0aa6c3056df]::panicking::begin_panic<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>::{closure#0}, !>
 10: 0x7f9340fc5aa4 - std[c965b0aa6c3056df]::panicking::begin_panic::<rustc_errors[a1f313aa0069ed6d]::ExplicitBug>
 11: 0x7f9340fc5a42 - <rustc_errors[a1f313aa0069ed6d]::diagnostic::BugAbort as rustc_errors[a1f313aa0069ed6d]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
 12: 0x7f93451bec55 - rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt::<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}
 13: 0x7f93451bd5da - rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_opt::<rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}, !>::{closure#0}
 14: 0x7f93451bd576 - rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_context_opt::<rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::with_opt<rustc_middle[9f3c98c38c00b5a6]::util::bug::opt_span_bug_fmt<rustc_span[981f1240f2624e58]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
 15: 0x7f9340f7f7f2 - rustc_middle[9f3c98c38c00b5a6]::util::bug::bug_fmt
 16: 0x7f934171c6a3 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 17: 0x7f934171c5a4 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 18: 0x7f934171c5a4 - rustc_codegen_ssa[d27da0192346df8a]::base::coerce_unsized_into::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 19: 0x7f934158530a - rustc_codegen_ssa[d27da0192346df8a]::mir::codegen_mir::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 20: 0x7f9341723617 - <rustc_middle[9f3c98c38c00b5a6]::mir::mono::MonoItem as rustc_codegen_ssa[d27da0192346df8a]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::builder::GenericBuilder<rustc_codegen_llvm[d5cdcb2fcf06f31b]::context::FullCx>>
 21: 0x7f934162aaa2 - rustc_codegen_llvm[d5cdcb2fcf06f31b]::base::compile_codegen_unit::module_codegen
 22: 0x7f934162a3b8 - rustc_codegen_llvm[d5cdcb2fcf06f31b]::base::compile_codegen_unit
 23: 0x7f934171b4ed - rustc_codegen_ssa[d27da0192346df8a]::base::codegen_crate::<rustc_codegen_llvm[d5cdcb2fcf06f31b]::LlvmCodegenBackend>
 24: 0x7f934169bdbf - <rustc_codegen_llvm[d5cdcb2fcf06f31b]::LlvmCodegenBackend as rustc_codegen_ssa[d27da0192346df8a]::traits::backend::CodegenBackend>::codegen_crate
 25: 0x7f934139aa65 - rustc_interface[7d1b1ab6c7a3b353]::passes::start_codegen
 26: 0x7f93413ffd2a - <rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>::codegen_and_build_linker
 27: 0x7f9341041f6c - <std[c965b0aa6c3056df]::thread::local::LocalKey<core[53647cb28d9a8e2]::cell::Cell<*const ()>>>::with::<rustc_middle[9f3c98c38c00b5a6]::ty::context::tls::enter_context<<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>::enter<rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>::{closure#1}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>::{closure#0}, core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>
 28: 0x7f93410aa15b - <rustc_middle[9f3c98c38c00b5a6]::ty::context::TyCtxt>::create_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
 29: 0x7f934111d787 - <rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
 30: 0x7f9341157b4a - <alloc[d932a86623700fa6]::boxed::Box<dyn for<'a> core[53647cb28d9a8e2]::ops::function::FnOnce<(&'a rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &'a std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena<'a>>, &'a rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena<'a>>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}), Output = core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>>> as core[53647cb28d9a8e2]::ops::function::FnOnce<(&rustc_session[2eee1ba1dc0dbbfa]::session::Session, rustc_middle[9f3c98c38c00b5a6]::ty::context::CurrentGcx, alloc[d932a86623700fa6]::sync::Arc<rustc_data_structures[72bc8994c09e69dc]::jobserver::Proxy>, &std[c965b0aa6c3056df]::sync::once_lock::OnceLock<rustc_middle[9f3c98c38c00b5a6]::ty::context::GlobalCtxt>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_middle[9f3c98c38c00b5a6]::arena::Arena>, &rustc_data_structures[72bc8994c09e69dc]::sync::worker_local::WorkerLocal<rustc_hir[707f209c2f1a5458]::Arena>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2})>>::call_once
 31: 0x7f93410efc5a - rustc_interface[7d1b1ab6c7a3b353]::passes::create_and_enter_global_ctxt::<core[53647cb28d9a8e2]::option::Option<rustc_interface[7d1b1ab6c7a3b353]::queries::Linker>, rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}::{closure#2}>
 32: 0x7f934108f643 - rustc_span[981f1240f2624e58]::create_session_globals_then::<(), rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
 33: 0x7f934114b899 - std[c965b0aa6c3056df]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
 34: 0x7f934109d6e3 - <<std[c965b0aa6c3056df]::thread::Builder>::spawn_unchecked_<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_with_globals<rustc_interface[7d1b1ab6c7a3b353]::util::run_in_thread_pool_with_globals<rustc_interface[7d1b1ab6c7a3b353]::interface::run_compiler<(), rustc_driver_impl[6bcdcf93142f3bdf]::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}
 35: 0x7f93459c5907 - std::sys::pal::unix::thread::Thread::new::thread_start::h208e5045c7868bf5
 36: 0x7f934026bac3 - <unknown>
 37: 0x7f93402fd850 - <unknown>
 38: 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月24日T08_11_16-54891.txt`: Read-only file system (os error 30)
note: rustc 1.90.0-nightly (e361ea2fc 2025年07月24日) 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 114.234
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)
[RUSTC-TIMING] alloctests test:true 69.232
Build completed unsuccessfully in 0:04:05
 local time: Thu Jul 24 08:13:42 UTC 2025
 network time: 2025年7月24日 08:13:42 GMT
##[error]Process completed with exit code 1.

Copy link
Collaborator

bors commented Aug 3, 2025

☔ The latest upstream changes (presumably #144814) 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
Reviewers

@RalfJung RalfJung RalfJung left review comments

@compiler-errors compiler-errors compiler-errors approved these changes

@scottmcm scottmcm scottmcm left review comments

@tmiasko tmiasko tmiasko left review comments

+1 more reviewer

@programmerjake programmerjake programmerjake left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
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-clippy Relevant to the Clippy team. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /