-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: handle -Zmutable-noalias like -Zbox-noalias
- Loading branch information
1 parent
c757267
commit d165a6d
Showing
4 changed files
with
31 additions
and
28 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
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
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
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,23 @@ | ||
// compile-flags: -O -Zmutable-noalias=no | ||
|
||
#![crate_type = "lib"] | ||
|
||
// `-Zmutable-noalias=no` should disable noalias on mut refs... | ||
|
||
// CHECK-LABEL: @test_mut_ref( | ||
// CHECK-NOT: noalias | ||
// CHECK-SAME: %x | ||
#[no_mangle] | ||
pub fn test_mut_ref(x: &mut i32) -> &mut i32 { | ||
x | ||
} | ||
|
||
// ...but not on shared refs | ||
|
||
// CHECK-LABEL: @test_ref( | ||
// CHECK-SAME: noalias | ||
// CHECK-SAME: %x | ||
#[no_mangle] | ||
pub fn test_ref(x: &i32) -> &i32 { | ||
x | ||
} |