]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / span / regions-close-over-borrowed-ref-in-obj.rs
1 fn id<T>(x: T) -> T { x }
2
3 trait Foo { }
4
5 impl<'a> Foo for &'a isize { }
6
7 fn main() {
8
9     let blah;
10
11     {
12         let ss: &isize = &id(1);
13         //~^ ERROR temporary value dropped while borrowed
14         blah = Box::new(ss) as Box<dyn Foo>;
15     }
16 }