Skip to content
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

rustc_trans: don't apply noalias on returned references. #46253

Merged
merged 1 commit into from
Nov 26, 2017

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Nov 25, 2017

In #45225 frozen returned &T were accidentally maked noalias, unlike &mut T.
Return value noalias is only sound for functions that return dynamic allocations, e.g. Box, and using it on anything else can lead to miscompilation, as LLVM assumes certain usage patterns.
Fixes #46239.

@eddyb eddyb added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2017
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@nagisa
Copy link
Member

nagisa commented Nov 25, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Nov 25, 2017

📌 Commit 5eed95e has been approved by nagisa

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 25, 2017
@kennytm
Copy link
Member

kennytm commented Nov 26, 2017

@bors p=1 — may be needed by #46270 as well.

@bors
Copy link
Contributor

bors commented Nov 26, 2017

⌛ Testing commit 5eed95e with merge 71b21ed...

bors added a commit that referenced this pull request Nov 26, 2017
rustc_trans: don't apply noalias on returned references.

In #45225 frozen returned `&T` were accidentally maked `noalias`, unlike `&mut T`.
Return value `noalias` is only sound for functions that return dynamic allocations, e.g. `Box`, and using it on anything else can lead to miscompilation, as LLVM assumes certain usage patterns.
Fixes #46239.
@bors
Copy link
Contributor

bors commented Nov 26, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nagisa
Pushing 71b21ed to master...

@michaelwoerister
Copy link
Member

As per the IRC discussion with @eddyb on Friday, I'll tentatively mark this as beta-accepted. @rust-lang/compiler, please veto within the next 15 hours if you don't think this is a good idea. I'll do the backport tomorrow.

@michaelwoerister michaelwoerister added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Dec 4, 2017
bors added a commit that referenced this pull request Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants