We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46091b0 commit d03c61aCopy full SHA for d03c61a
tests/codegen/noalias-freeze.rs
@@ -0,0 +1,21 @@
1
+//@ compile-flags: -Copt-level=1
2
+
3
+// References returned by a Frozen pointer type
4
+// could be marked as "noalias", which caused miscompilation errors.
5
+// This test runs the most minimal possible code that can reproduce this bug,
6
+// and checks that noalias does not appear.
7
+// See https://github.com/rust-lang/rust/issues/46239
8
9
+#![crate_type = "lib"]
10
11
+fn project<T>(x: &(T,)) -> &T { &x.0 }
12
13
+fn dummy() {}
14
15
+// CHECK-LABEL: @foo(
16
+// CHECK-NOT: noalias
17
+#[no_mangle]
18
+pub fn foo() {
19
+ let f = (dummy as fn(),);
20
+ (*project(&f))();
21
+}
tests/run-make/no-mark-noalias/main.rs
tests/run-make/no-mark-noalias/rmake.rs
0 commit comments