Skip to content

Macro parser doesn't allow _ as ident #8699

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

Closed
lilyball opened this issue Aug 23, 2013 · 1 comment
Closed

Macro parser doesn't allow _ as ident #8699

lilyball opened this issue Aug 23, 2013 · 1 comment

Comments

@lilyball
Copy link
Contributor

The macro parser doesn't seem to accept _ where an ident is expected:

externfn!(fn foo(_: u8))

yields

Untitled.rs:1:17: 1:18 error: expected ident, found _
Untitled.rs:1 externfn!(fn foo(_: u8))
                               ^
@lilyball
Copy link
Contributor Author

engla on IRC pointed out that function arguments are actually patterns, not identifiers, and that's why they allow _.

xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
…j,xFrednet

Don't lint `vec_init_then_push` when further extended

fixes rust-lang#7071

This will still lint when a larger number of pushes are done (four currently). The exact number could be debated, but this is more readable then a sequence of pushes so it shouldn't be too large.

changelog: Don't lint `vec_init_then_push` when further extended.
changelog: Remove `mut` binding from `vec_init_then_push` when possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant