mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
17 lines
252 B
Rust
17 lines
252 B
Rust
fn id<T>(x: T) -> T { x }
|
|
|
|
trait Foo { }
|
|
|
|
impl<'a> Foo for &'a isize { }
|
|
|
|
fn main() {
|
|
|
|
let blah;
|
|
|
|
{
|
|
let ss: &isize = &id(1);
|
|
//~^ ERROR temporary value dropped while borrowed
|
|
blah = Box::new(ss) as Box<dyn Foo>;
|
|
}
|
|
}
|