Closed
Description
The following code [playground]:
pub struct Bar
where
for<'a> &'a mut Self:;
fn main() {}
Should compile, but it does not. Instead it fails with:
error[E0477]: the type `&'a mut Bar` does not fulfill the required lifetime
--> src/main.rs:3:13
|
3 | for<'a> &'a mut Self:;
| ^^^^^^^^^^^^
|
note: type must outlive the empty lifetime as required by this binding
--> src/main.rs:3:13
|
3 | for<'a> &'a mut Self:;
| ^^^^^^^^^^^^
I think this is because we instantiate the predicate for<'a> &'a mut Self: ReEmpty(U0)
here, which doesn't hold because of the HRTB.