Use transmute_neo in assume_init#158345
Merged
Merged
Conversation
Collaborator
|
|
This comment has been minimized.
This comment has been minimized.
fc37ba8 to
89ee1ba
Compare
scottmcm
commented
Jun 24, 2026
Member
|
r=me with track_caller made miri-conditional to avoid unnecessary busywork for the optimizer. |
89ee1ba to
4eb7436
Compare
Member
Author
|
@bors r=RalfJung |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of rust-lang#143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
Member
Author
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of rust-lang#143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of rust-lang#143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158294 (Use .drectve for MSVC DLL exports) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound) Failed merges: - #155535 (export symbols: support macos/windows(32/64))
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of rust-lang#143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of rust-lang#143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 16 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound) Failed merges: - #158355 (Fixup the refactoring errors in #156246)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-timer
added a commit
that referenced
this pull request
Jun 25, 2026
Rollup merge of #158345 - scottmcm:assume-init-no-read, r=RalfJung Use `transmute_neo` in `assume_init` I noticed this basically open-coding a transmute via `read`, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok. r? @RalfJung as the author of #143327 Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed this basically open-coding a transmute via
read, but now that we have a transmute that doesn't fail there on the typeck size check I figured that we might as well use it here. The Miri errors are preserved (at least locally, but CI will double-check) so hopefully this is ok.r? @RalfJung as the author of #143327
Context is that I saw the raw-ref-cast-and-read in https://github.com/rust-lang/rust/pull/158341/changes#diff-ee00b0dbbebae9c10bf879a79377c87a7a68208a7e213d6ca792a6ef5f216855R87-R90 and thought it could be simpler 🙂