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 { }
|
2014-08-05 21:59:24 -05:00
|
|
|
|
2015-01-08 04:54:35 -06:00
|
|
|
impl<'a> Foo for &'a isize { }
|
2014-08-05 21:59:24 -05:00
|
|
|
|
2014-08-27 20:46:52 -05:00
|
|
|
fn main() {
|
2021-08-24 19:39:40 -05:00
|
|
|
|
2014-08-27 20:46:52 -05:00
|
|
|
let blah;
|
2021-08-24 19:39:40 -05:00
|
|
|
|
2014-08-27 20:46:52 -05:00
|
|
|
{
|
2017-08-13 03:46:49 -05:00
|
|
|
let ss: &isize = &id(1);
|
2019-04-22 02:40:08 -05:00
|
|
|
//~^ ERROR temporary value dropped while borrowed
|
2021-08-24 19:39:40 -05:00
|
|
|
blah = Box::new(ss) as Box<dyn Foo>;
|
2017-12-13 19:27:23 -06:00
|
|
|
}
|
2014-08-27 20:46:52 -05:00
|
|
|
}
|