kpreid / exhaust

Exhaustive iteration trait in Rust
https://docs.rs/exhaust/
Apache License 2.0
13 stars 2 forks source link

Exhaust derive triggers non_camel_case_types warning from Rust Analyzer #44

Closed tesselode closed 2 months ago

tesselode commented 2 months ago
use exhaust::Exhaust;

fn main() {}

#[derive(Exhaust)]
enum Cool {
    A,
    B,
    C,
}

When using Rust Analyzer, I get the following warnings:

kpreid commented 2 months ago

This is, technically, a rust-analyzer bug, as is any time rust-analyzer fires a lint and rustc does not. The problem is that RA doesn't implement the exact same rules for suppressing lints in macros. (I'd link an RA bug, but after searching there doesn't seem to be one that covers exactly this case of “the implicit lint suppression should have done it” — all the bugs currently open seem to be about #[allow]s getting ignored.

(I do think it's reasonable to apply a workaround, though, since this is a long-standing problem.)

By the way, I didn't know that anyone else was using exhaust yet — is there a way I could have gotten your feedback on the 0.2 changes before I published the release (or any feedback on the direction of development in general)?

tesselode commented 2 months ago

You can ping me on the Rust GameDev discord if you want! I'm @tesselode there. I don't have any strong opinions on the v0.2 changes, since I don't understand what new use case they enable.