Add flag to configure noalias on Box<T>#99436
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 20, 2022
Merged
Conversation
Contributor
|
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
26aaa45 to
09ac838
Compare
This comment has been minimized.
This comment has been minimized.
Member
|
Wait, (Checking the code) ah, |
Member
Author
|
How about |
09ac838 to
200f3b8
Compare
noalias on Box<T>noalias on Box<T>
Member
|
The changes look good to me, but to make sure that it works, can you please add a test? (see this for info) |
200f3b8 to
a8253c4
Compare
Member
Author
|
I added a test to ensure that noalias doesn't get passed when the flag is set to no. Now that I think about it, I should add another test for the default case. |
To aid making an informed decision about the aliasing rules of box, give users an option to remove `noalias` from box.
Member
Author
|
So, I hope it works now. |
a8253c4 to
7c900c9
Compare
fee1-dead
approved these changes
Jul 19, 2022
Member
fee1-dead
left a comment
There was a problem hiding this comment.
looks good to me pending CI green.
Member
Author
|
@fee1-dead and it's green now 🎉 |
Member
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 20, 2022
Rollup of 7 pull requests Successful merges: - rust-lang#98101 (stdlib support for Apple WatchOS) - rust-lang#99345 (Do not allow typeck children items to constrain outer RPITs) - rust-lang#99383 (Formalize defining_use_anchor) - rust-lang#99436 (Add flag to configure `noalias` on `Box<T>`) - rust-lang#99483 (Fix a numerical underflow in tuple wrap suggestion) - rust-lang#99485 (Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations) - rust-lang#99486 (Refactor: remove a string comparison between types in `check_str_addition`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
The aliasing rules of
Box<T>are still not decided, but currently,Box<T>is unique and getsnoalias. To aid making an informed decision about the future ofBox<T>, this PR adds a flag-Zbox-noaliasto configurenoaliasforBox<T>(for example, for benchmarking). The same flag already exists for&mut Tnoalias, where it was added because it was the problem of various miscompilations in LLVM.For more information, see rust-lang/unsafe-code-guidelines#326