Non-sensical Compiler Suggested Fix

I ran into this trying things in the playground. It returns a non sensical suggested fix. Did a quick search and didn't find anything. Is this known bug or should I file an issue?

Compiling playground v0.0.1 (/playground)
error[E0106]: missing lifetime specifier
  --> src/lib.rs:12:21
   |
12 |     type Item = Foo<R>;
   |                     ^ expected named lifetime parameter
   |
help: consider introducing a named lifetime parameter
   |
12 |     type Item<'a> = Foo<<'a>R>;
   |              ^^^^       ^^^^

Playground

I'd file an issue with a minimal reproducible example personally. I don't know what the correct behavior is, but it's certainly not that.

Done Link

Though nightly does have a suggestion with valid syntax, which leads to GATs

I was pretty sure I had fixed this recently and indeed it is fixed in nightly: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e8d6638803bffc29a1d9770a222cc598

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.