Closed
Description
trait X { fn foo(&self) {} }
fn p3<'a, 'b, T: 'b>(v: T) -> Box<dyn X + 'a> where T: X {
Box::new(v)
}
produces:
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:4:5
|
3 | fn p3<'a, 'b, T: 'b>(v: T) -> Box<dyn X + 'a> where T: X {
| -- help: consider adding an explicit lifetime bound `T: 'a`...
4 | Box::new(v)
| ^^^^^^^^^^^
|
It should suggest T: 'a + 'b
(or similar), ideally in the same format as E0599.