-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@ compile-flags: -Copt-level=1 | ||
|
||
// References returned by a Frozen pointer type | ||
// could be marked as "noalias", which caused miscompilation errors. | ||
// This test runs the most minimal possible code that can reproduce this bug, | ||
// and checks that noalias does not appear. | ||
// See https://github.com/rust-lang/rust/issues/46239 | ||
|
||
#![crate_type = "lib"] | ||
|
||
fn project<T>(x: &(T,)) -> &T { &x.0 } | ||
|
||
fn dummy() {} | ||
|
||
// CHECK-LABEL: @foo( | ||
// CHECK-NOT: noalias | ||
#[no_mangle] | ||
pub fn foo() { | ||
let f = (dummy as fn(),); | ||
(*project(&f))(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.