Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on trailing comma #100

Open
ViktorWb opened this issue Aug 17, 2024 · 0 comments
Open

Error on trailing comma #100

ViktorWb opened this issue Aug 17, 2024 · 0 comments
Labels

Comments

@ViktorWb
Copy link

The following code compiles:

#[auto_impl::auto_impl(&)]
trait MyTrait<T> {}

But the following code gives an error:

#[auto_impl::auto_impl(&)]
trait MyTrait<T,> {}
error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `,`
 --> src/main.rs:3:1
  |
3 | #[auto_impl::auto_impl(&)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of `#`, `>`, `const`, identifier, or lifetime
  |
  = note: this error originates in the attribute macro `auto_impl::auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

This is a problem when the formatter inserts trailing commas, which happens if you have lots of generics so that they wrap over to a new line:

#[auto_impl::auto_impl(&)]
trait MyTrait<
    A,
    B,
    C,
    D,
> {}
@KodrAus KodrAus added the bug label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants