rust/src/test/ui/consts/promote_borrowed_field.rs
Dylan MacKenzie d6431f69ad Test that borrows of projections are promoted everywhere
Previously, this worked in `fn`s but not `const`s or `static`s.
2019-11-03 12:24:35 -08:00

13 lines
179 B
Rust

// 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;
}