Skip to content

Commit 53f5794

Browse files
oli-obkRalfJung
andauthored
Apply suggestions from code review
Co-authored-by: Ralf Jung <[email protected]>
1 parent 42cc159 commit 53f5794

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/ui/statics/const_generics.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
//! check that we lose the information that `BAR` points to `FOO`
1+
//! Check that we lose the information that `BAR` points to `FOO`
22
//! when going through a const generic.
3+
//! This is not an intentional guarantee, it just describes the status quo.
34
45
//@ run-pass
56
// With optimizations, LLVM will deduplicate the constant `X` whose
@@ -16,6 +17,7 @@
1617
static FOO: usize = 42;
1718
const BAR: &usize = &FOO;
1819
fn foo<const X: &'static usize>() {
20+
// Without optimizations, `X` ends up pointing to a copy of `FOO` instead of `FOO` itself.
1921
assert_eq!(cfg!(opt), std::ptr::eq(X, &FOO));
2022
}
2123

0 commit comments

Comments
 (0)