dtolnay / seq-macro

Macro to repeat sequentially indexed copies of a fragment of code
Apache License 2.0
137 stars 5 forks source link

seq! doesn't work on 2021 edition #11

Closed nilehmann closed 2 years ago

nilehmann commented 3 years ago

I ran into problems when trying to use seq! in the 2021 edition because ident#N gets tokenized as a prefixed identifier.

kawadakk commented 2 years ago

It can still be used in Rust 2021 edition by inserting whitespace as the compiler error message says:

error: prefix `Foo` is unknown
 --> .../lib.rs:3:16
  |
3 |         pub fn foo#N() -> &'static str {
  |                ^^^ unknown prefix
  |
  = note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
  |
3 -         pub fn foo#N() -> &'static str {
3 +         pub fn foo #N() -> &'static str {
  |