rust/tests/ui/span/regions-close-over-borrowed-ref-in-obj.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
252 B
Rust
Raw Normal View History

2017-08-13 03:46:49 -05:00
fn id<T>(x: T) -> T { x }
2015-04-18 00:12:20 -05:00
trait Foo { }
impl<'a> Foo for &'a isize { }
fn main() {
let blah;
{
2017-08-13 03:46:49 -05:00
let ss: &isize = &id(1);
//~^ ERROR temporary value dropped while borrowed
blah = Box::new(ss) as Box<dyn Foo>;
2017-12-13 19:27:23 -06:00
}
}