-
Notifications
You must be signed in to change notification settings - Fork 13.3k
handle function alignment in miri #140072
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
Merged
Merged
+36
−2
Conversation
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
r? @RalfJung |
RalfJung
reviewed
Apr 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
@bors r+ rollup |
ChrisDenton
added a commit
to ChrisDenton/rust
that referenced
this pull request
Apr 22, 2025
handle function alignment in miri tracking issue: rust-lang#82232 Fixes rust-lang/miri#4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 22, 2025
…enton Rollup of 8 pull requests Successful merges: - rust-lang#139309 (make abi_unsupported_vector_types a hard error) - rust-lang#139617 (Use posix_spawn on cygwin) - rust-lang#140072 (handle function alignment in miri) - rust-lang#140104 (Fix auto diff failing on inherent impl blocks) - rust-lang#140124 (Update books) - rust-lang#140144 (Handle another negated literal in `eat_token_lit`.) - rust-lang#140146 (Update `compiler_builtins` to 0.1.156) - rust-lang#140149 (test_nan: ensure the NAN contant is quiet) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 22, 2025
…enton Rollup of 8 pull requests Successful merges: - rust-lang#139617 (Use posix_spawn on cygwin) - rust-lang#139921 (improve diagnostic for raw pointer field access with ->) - rust-lang#140031 (compiletest: Fix deadline bugs in new executor) - rust-lang#140072 (handle function alignment in miri) - rust-lang#140104 (Fix auto diff failing on inherent impl blocks) - rust-lang#140124 (Update books) - rust-lang#140144 (Handle another negated literal in `eat_token_lit`.) - rust-lang#140149 (test_nan: ensure the NAN contant is quiet) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 22, 2025
…enton Rollup of 8 pull requests Successful merges: - rust-lang#139617 (Use posix_spawn on cygwin) - rust-lang#139921 (improve diagnostic for raw pointer field access with ->) - rust-lang#140031 (compiletest: Fix deadline bugs in new executor) - rust-lang#140072 (handle function alignment in miri) - rust-lang#140104 (Fix auto diff failing on inherent impl blocks) - rust-lang#140124 (Update books) - rust-lang#140144 (Handle another negated literal in `eat_token_lit`.) - rust-lang#140149 (test_nan: ensure the NAN contant is quiet) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 23, 2025
Rollup merge of rust-lang#140072 - folkertdev:miri-fn-align, r=RalfJung handle function alignment in miri tracking issue: rust-lang#82232 Fixes rust-lang/miri#4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
tracking issue: #82232
Fixes rust-lang/miri#4282
The
#[repr(align(N))]
attribute on functions was ignored when using miri. For such a function, its address should be a multiple ofN
.There is some further discussion in the thread #t-compiler/const-eval > function address alignment on how
dyn Fn
should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.