1 error[E0261]: use of undeclared lifetime name `'a`
2 --> $DIR/issue-67510.rs:5:21
4 LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
5 | ^^ undeclared lifetime
7 = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
8 help: consider making the bound lifetime-generic with a new `'a` lifetime
10 LL | fn f(x: Box<dyn for<'a> X<Y<'a> = &'a ()>>) {}
12 help: consider introducing lifetime `'a` here
14 LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {}
17 error[E0261]: use of undeclared lifetime name `'a`
18 --> $DIR/issue-67510.rs:5:28
20 LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
21 | ^^ undeclared lifetime
23 help: consider making the bound lifetime-generic with a new `'a` lifetime
25 LL | fn f(x: Box<dyn for<'a> X<Y<'a> = &'a ()>>) {}
27 help: consider introducing lifetime `'a` here
29 LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {}
32 error[E0038]: the trait `X` cannot be made into an object
33 --> $DIR/issue-67510.rs:5:13
35 LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
36 | ^^^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object
38 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
39 --> $DIR/issue-67510.rs:2:10
42 | - this trait cannot be made into an object...
44 | ^ ...because it contains the generic associated type `Y`
45 = help: consider moving `Y` to another trait
47 error: aborting due to 3 previous errors
49 Some errors have detailed explanations: E0038, E0261.
50 For more information about an error, try `rustc --explain E0038`.