We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42cc159 commit 53f5794Copy full SHA for 53f5794
tests/ui/statics/const_generics.rs
@@ -1,5 +1,6 @@
1
-//! check that we lose the information that `BAR` points to `FOO`
+//! Check that we lose the information that `BAR` points to `FOO`
2
//! when going through a const generic.
3
+//! This is not an intentional guarantee, it just describes the status quo.
4
5
//@ run-pass
6
// With optimizations, LLVM will deduplicate the constant `X` whose
@@ -16,6 +17,7 @@
16
17
static FOO: usize = 42;
18
const BAR: &usize = &FOO;
19
fn foo<const X: &'static usize>() {
20
+ // Without optimizations, `X` ends up pointing to a copy of `FOO` instead of `FOO` itself.
21
assert_eq!(cfg!(opt), std::ptr::eq(X, &FOO));
22
}
23
0 commit comments