Test that borrows of projections are promoted everywhere

Previously, this worked in `fn`s but not `const`s or `static`s.
This commit is contained in:
Dylan MacKenzie 2019-10-23 09:55:20 -07:00
parent fab0caf172
commit d6431f69ad

View file

@ -0,0 +1,12 @@
// run-pass
// From https://github.com/rust-lang/rust/issues/65727
const _: &i32 = {
let x = &(5, false).0;
x
};
fn main() {
let _: &'static i32 = &(5, false).0;
}