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

Projects
None yet
6 participants
@eddyb
Copy link
Member

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.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 25, 2017

r? @michaelwoerister

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

@eddyb eddyb force-pushed the eddyb:return-aliasing branch from 57fe4d3 to 5eed95e Nov 25, 2017

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Nov 25, 2017

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 25, 2017

📌 Commit 5eed95e has been approved by nagisa

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Nov 26, 2017

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

@bors

This comment has been minimized.

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

Auto merge of #46253 - eddyb:return-aliasing, r=nagisa
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

This comment has been minimized.

Copy link
Contributor

bors commented Nov 26, 2017

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

@bors bors merged commit 5eed95e into rust-lang:master Nov 26, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@eddyb eddyb deleted the eddyb:return-aliasing branch Nov 26, 2017

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Dec 4, 2017

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.

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
You can’t perform that action at this time.