dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.82k stars 308 forks source link

Don't use `parse_group` for a visibility. #1598

Closed nnethercote closed 5 months ago

nnethercote commented 6 months ago

There is no need to explicitly handle an empty group, because the standard group ignoring code has the same effect.

nnethercote commented 6 months ago

I'm not 100% certain this PR is valid, but it passes tests, as run with cargo test --release --all-features. Having said that, I do get the "This is not a nightly compiler so not all tests were able to run" warning because I couldn't work out how to get things working with a nightly compiler. (cargo +nightly test --release --all-features gave the same warning.)

If the PR isn't valid, it would be good to have a test that fails when this change is applied.

dtolnay commented 5 months ago

I couldn't work out how to get things working with a nightly compiler

Nightly was broken by this LLVM linkage issue: https://github.com/rust-lang/rust/issues/121889, https://github.com/dtolnay/syn/commit/7aef1edbba28afe1bb6f9ddc0b5095dcd5135849

dtolnay commented 5 months ago

I have added a test in #1601.

Thank you!