rust/tests/ui/regions/regions-close-param-into-ob...

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

28 lines
579 B
Rust
Raw Normal View History

2015-02-19 07:58:07 +08:00
trait X { fn foo(&self) {} }
2019-05-29 02:46:13 +08:00
fn p1<T>(v: T) -> Box<dyn X + 'static>
where T : X
{
Box::new(v) //~ ERROR parameter type `T` may not live long enough
}
2019-05-29 02:46:13 +08:00
fn p2<T>(v: Box<T>) -> Box<dyn X + 'static>
where Box<T> : X
{
Box::new(v) //~ ERROR parameter type `T` may not live long enough
}
2019-05-29 02:46:13 +08:00
fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
where T : X
{
Box::new(v) //~ ERROR parameter type `T` may not live long enough
}
2019-05-29 02:46:13 +08:00
fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
where Box<T> : X
{
Box::new(v) //~ ERROR parameter type `T` may not live long enough
}
fn main() {}