Conversation
|
@Nadrieril ready for review :D |
| /// Used instead of `alloc::boxed::Box::write` when rewriting `vec!` lowering. | ||
| /// Writes into a `Box<MaybeUninit<T>>` and returns a `Box<T>`. | ||
| BoxWrite, | ||
| /// Used instead of `alloc::slice::into_vec` when rewriting `vec!` lowering. | ||
| /// Takes a `Box<[T]>` and returns a `Vec<T>`. | ||
| SliceIntoVec, |
There was a problem hiding this comment.
I'd prefer to use the actual std functions, is that doable? I'm thinking that when we encounter a call to box_assume_init_into_vec_unsafe during translation we can trigger translation of these two, so that the reconstruction pass can find them later (or even maybe we can directly transform during translation, whichever easiest)
| @@ -1,5 +1,5 @@ | |||
|
|
|||
| thread 'rustc' panicked at /nix/store/1nbfrsmfmhmhq75gkxk9nik63sq798g5-rust-default-1.95.0-nightly-2026-02-07/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:823:45: | |||
| thread 'rustc' panicked at /Users/opale/.rustup/toolchains/nightly-2026-02-22-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:823:45: | |||
There was a problem hiding this comment.
ugh I don't know why our normal path normalization didn't work here, plz just mark this test as //@ no-check-output
There was a problem hiding this comment.
just manually fixed, will do it next time :P
|
(I really want to get rid of BoxNew, it's an artefact of a time long past ^^) |
|
@Nadrieril is it ok to leave this as is for now so we can keep bumping the toolchain, and we eventually get rid of all the builtin functions later? ill go through the issues for this PR dw; this is partly because @joshlf is opening a PR to have some sort of automatic toolchain bumper in CI (since often the toolchain bump doesn't cause any breakage) |
|
yes do leave the builtins like this we can make it better later |
Continuation of #1030
Fixes #973
Related to rust-lang/rust#148190
Added a transformation pass to make
vec!safe. For the following original MIR:we want something akin to