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 4 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.

@Veykril
Copy link
Member

Veykril commented Mar 12, 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.

@Veykril I think for the most part you could just treat pattern types opaquely and ignore the pattern's details. Casts to the base type don't require looking at the pattern and instantiating pattern types from literals could just be ignored by r-a and left to rustc. I don't think you actually need the layout of pattern types for anything else

But isn't the point of them that they have niches? If we treat them opaquely we won't see the niches of the type for layout calculation.

Either way I should be unblocked regarding rust-lang/rust-analyzer#7434 so I can start working on that again starting next week. Though if you want to get this merged and r-a is the remaining blocking reason we can work around it by special casing the relevant std/core type(s) if needed I think

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 12, 2025

But isn't the point of them that they have niches? If we treat them opaquely we won't see the niches of the type for layout calculation.

Ah then the sizes shown by ra would be wrong. Hmm I've never seem the sizes, didn't think about that

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from f1070f2 to bbf47b3 Compare March 12, 2025 09:03
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from bbf47b3 to c5481a8 Compare March 12, 2025 09:13
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from c5481a8 to 6f2e921 Compare March 12, 2025 10:17
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 6f2e921 to e65f76e Compare March 13, 2025 12:39
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2025

The Miri subtree was changed

cc @rust-lang/miri

@bors
Copy link
Collaborator

bors commented Mar 15, 2025

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

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from e65f76e to 7bbf6e9 Compare April 28, 2025 08:01
@Veykril
Copy link
Member

Veykril commented Apr 28, 2025

Btw, the implementation block has been lifted in r-a. (that is the pre-requisite work for rust-lang/rust-analyzer#7434). But since we still use chalk's IR we can't represent pattern types in the type system yet, so that's still kind of blocked there.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 7bbf6e9 to 92fedff Compare May 2, 2025 16:37
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 92fedff to 1d4df95 Compare May 5, 2025 09:04
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from 1d4df95 to afef083 Compare May 5, 2025 15:45
@rustbot rustbot added O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels May 5, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the push-tzonluoyuwkq branch from afef083 to 38ac3e6 Compare May 6, 2025 08:19
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 20.2s done
#19 DONE 24.6s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
[RUSTC-TIMING] ____ test:false 0.026
##[endgroup]
##[group][AOT] arbitrary_self_types_pointers_and_wrappers
[AOT] arbitrary_self_types_pointers_and_wrappers
##[error]error: internal compiler error: compiler/rustc_codegen_cranelift/src/unsize.rs:173:14: coerce_unsized_into: invalid coercion pattern_type!(*const Wrapper<i32> is !null) -> pattern_type!(*const Wrapper<dyn [Binder { value: Trait(Trait), bound_vars: [] }] + '{erased}> is !null)


thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/unsize.rs:173:14:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: rustc_codegen_cranelift::unsize::coerce_unsized_into
   7: rustc_codegen_cranelift::unsize::coerce_unsized_into
   8: rustc_codegen_cranelift::unsize::coerce_unsized_into
   9: rustc_codegen_cranelift::unsize::coerce_unsized_into
  10: rustc_codegen_cranelift::unsize::coerce_unsized_into
  11: rustc_codegen_cranelift::base::codegen_fn_body
  12: rustc_codegen_cranelift::base::codegen_fn
  13: rustc_codegen_cranelift::driver::aot::module_codegen
  14: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
  15: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
  16: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
  17: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  18: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  19: rustc_codegen_cranelift::driver::aot::run_aot
  20: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  21: rustc_interface::passes::start_codegen
  22: <rustc_interface::queries::Linker>::codegen_and_build_linker
  23: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  24: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  25: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  26: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  27: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  28: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please make sure that you have updated to the latest nightly

warning: the ICE couldn't be written to `/checkout/compiler/rustc_codegen_cranelift/rustc-ice-2025-05-06T08_47_54-255609.txt`: Read-only file system (os error 30)

note: rustc 1.88.0-nightly (5b72ed1c2 2025-05-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C debuginfo=2 -C panic=abort -Z force-unstable-if-unmarked

query stack during panic:
end of query stack
stmt _1 = move _2 as Ptr<Wrapper<dyn Trait>> (PointerCoercion(Unsize, AsCast))
fn main() -> () {
    let mut _0: ();
    let mut _1: Ptr<Wrapper<dyn Trait>>;
    let mut _2: Ptr<Wrapper<i32>>;
    let mut _3: std::boxed::Box<Wrapper<i32>>;
    let mut _4: Wrapper<i32>;
    let mut _5: (&i32, &i32);
    let mut _6: &i32;
    let _7: i32;
    let mut _8: &i32;
    let mut _11: bool;
    let mut _12: i32;
    let mut _13: i32;
    let _15: !;
    let mut _16: std::option::Option<std::fmt::Arguments<'_>>;
    let mut _17: Wrapper<Ptr<dyn Trait>>;
    let mut _18: Wrapper<Ptr<i32>>;
    let mut _19: Ptr<i32>;
    let mut _20: std::boxed::Box<i32>;
    let mut _21: (&i32, &i32);
    let mut _22: &i32;
    let _23: i32;
    let mut _24: &i32;
    let mut _27: bool;
    let mut _28: i32;
    let mut _29: i32;
    let _31: !;
    let mut _32: std::option::Option<std::fmt::Arguments<'_>>;
    let mut _33: Wrapper<Ptr<Wrapper<dyn Trait>>>;
    let mut _34: Wrapper<Ptr<Wrapper<i32>>>;
    let mut _35: Ptr<Wrapper<i32>>;
    let mut _36: std::boxed::Box<Wrapper<i32>>;
    let mut _37: Wrapper<i32>;
    let mut _38: (&i32, &i32);
    let mut _39: &i32;
    let _40: i32;
    let mut _41: &i32;
    let mut _44: bool;
    let mut _45: i32;
    let mut _46: i32;
    let _48: !;
    let mut _49: std::option::Option<std::fmt::Arguments<'_>>;
    scope 1 {
        debug pw => _1;
        let _9: &i32;
        let _10: &i32;
        scope 2 {
            debug left_val => _9;
            debug right_val => _10;
            let _14: core::panicking::AssertKind;
            scope 3 {
                debug kind => _14;
            }
        }
        scope 4 {
            debug wp => _17;
            let _25: &i32;
            let _26: &i32;
            scope 5 {
                debug left_val => _25;
                debug right_val => _26;
                let _30: core::panicking::AssertKind;
                scope 6 {
                    debug kind => _30;
                }
            }
            scope 7 {
                debug wpw => _33;
                let _42: &i32;
                let _43: &i32;
                scope 8 {
                    debug left_val => _42;
                    debug right_val => _43;
                    let _47: core::panicking::AssertKind;
                    scope 9 {
                        debug kind => _47;
                    }
                }
            }
        }
    }

    bb0: {
        _4 = Wrapper::<i32>(const 5_i32);
        _3 = std::boxed::Box::<Wrapper<i32>>::new(move _4) -> [return: bb1, unwind unreachable];
    }

    bb1: {
        _2 = Ptr::<Wrapper<i32>>(move _3);
        _1 = move _2 as Ptr<Wrapper<dyn Trait>> (PointerCoercion(Unsize, AsCast));
        _7 = <dyn Trait as Trait>::ptr_wrapper(move _1) -> [return: bb2, unwind unreachable];
    }

    bb2: {
        _6 = &_7;
        _8 = const main::promoted[2];
        _5 = (move _6, move _8);
        _9 = copy (_5.0: &i32);
        _10 = copy (_5.1: &i32);
        _12 = copy (*_9);
        _13 = copy (*_10);
        _11 = Eq(move _12, move _13);
        switchInt(move _11) -> [0: bb4, otherwise: bb3];
    }

    bb3: {
        _20 = std::boxed::Box::<i32>::new(const 6_i32) -> [return: bb5, unwind unreachable];
    }

    bb4: {
        _14 = core::panicking::AssertKind::Eq;
        _16 = std::option::Option::<std::fmt::Arguments<'_>>::None;
        _15 = core::panicking::assert_failed::<i32, i32>(move _14, copy _9, copy _10, move _16) -> unwind unreachable;
    }

    bb5: {
        _19 = Ptr::<i32>(move _20);
        _18 = Wrapper::<Ptr<i32>>(move _19);
        _17 = move _18 as Wrapper<Ptr<dyn Trait>> (PointerCoercion(Unsize, AsCast));
        _23 = <dyn Trait as Trait>::wrapper_ptr(move _17) -> [return: bb6, unwind unreachable];
    }

    bb6: {
        _22 = &_23;
        _24 = const main::promoted[1];
        _21 = (move _22, move _24);
        _25 = copy (_21.0: &i32);
        _26 = copy (_21.1: &i32);
        _28 = copy (*_25);
        _29 = copy (*_26);
        _27 = Eq(move _28, move _29);
        switchInt(move _27) -> [0: bb8, otherwise: bb7];
    }

    bb7: {
        _37 = Wrapper::<i32>(const 7_i32);
        _36 = std::boxed::Box::<Wrapper<i32>>::new(move _37) -> [return: bb9, unwind unreachable];
    }

    bb8: {
        _30 = core::panicking::AssertKind::Eq;
        _32 = std::option::Option::<std::fmt::Arguments<'_>>::None;
        _31 = core::panicking::assert_failed::<i32, i32>(move _30, copy _25, copy _26, move _32) -> unwind unreachable;
    }

    bb9: {
        _35 = Ptr::<Wrapper<i32>>(move _36);
        _34 = Wrapper::<Ptr<Wrapper<i32>>>(move _35);
        _33 = move _34 as Wrapper<Ptr<Wrapper<dyn Trait>>> (PointerCoercion(Unsize, AsCast));
        _40 = <dyn Trait as Trait>::wrapper_ptr_wrapper(move _33) -> [return: bb10, unwind unreachable];
    }

    bb10: {
        _39 = &_40;
        _41 = const main::promoted[0];
        _38 = (move _39, move _41);
        _42 = copy (_38.0: &i32);
        _43 = copy (_38.1: &i32);
        _45 = copy (*_42);
        _46 = copy (*_43);
        _44 = Eq(move _45, move _46);
        switchInt(move _44) -> [0: bb12, otherwise: bb11];
    }

    bb11: {
        return;
    }

    bb12: {
        _47 = core::panicking::AssertKind::Eq;
        _49 = std::option::Option::<std::fmt::Arguments<'_>>::None;
        _48 = core::panicking::assert_failed::<i32, i32>(move _47, copy _42, copy _43, move _49) -> unwind unreachable;
    }
}

error: aborting due to 1 previous error

"/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustc-clif" "-Csymbol-mangling-version=v0" "-Zrandomize-layout" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "--check-cfg=cfg(llvm_enzyme)" "-Zmacro-backtrace" "-Csplit-debuginfo=off" "-Clink-arg=-L/usr/lib/llvm-19/lib" "-Cllvm-args=-import-instr-limit=10" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Alinker-messages" "-L" "crate=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_clif/build/example" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_clif/build/example" "-Cdebuginfo=2" "--target" "x86_64-unknown-linux-gnu" "-Cpanic=abort" "--check-cfg=cfg(jit)" "example/arbitrary_self_types_pointers_and_wrappers.rs" exited with status ExitStatus(unix_wait_status(25856))
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:23:40
  local time: Tue May  6 08:47:54 UTC 2025
  network time: Tue, 06 May 2025 08:47:54 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

10 participants