Skip to content

Commit d6431f6

Browse files
Test that borrows of projections are promoted everywhere
Previously, this worked in `fn`s but not `const`s or `static`s.
1 parent fab0caf commit d6431f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-pass
2+
3+
// From https://github.com/rust-lang/rust/issues/65727
4+
5+
const _: &i32 = {
6+
let x = &(5, false).0;
7+
x
8+
};
9+
10+
fn main() {
11+
let _: &'static i32 = &(5, false).0;
12+
}

0 commit comments

Comments
 (0)