SergioBenitez / proc-macro2-diagnostics

Diagnostics for stable and nightly proc-macros!
Apache License 2.0
10 stars 5 forks source link

feature request: use structs + deprecated for warnings on stable #9

Open jkelleyrtp opened 2 months ago

jkelleyrtp commented 2 months ago

Hi, we want to use this crate to emit warnings in dioxus proc macros, but since warnings get emitted as errors, it's not quite usable for us.

https://github.com/DioxusLabs/dioxus/issues/2807

That's fine - we only have this one warning that we can cfg-gate to nightly, but there is a way to emit warnings on stable using a #[deprecated] struct.

We'd be happy to implement it if you'd be willing to accept it :)

SergioBenitez commented 2 months ago

there is a way to emit warnings on stable using a #[deprecated] struct.

There are a few ways to exploit lints to get warnings on stable, but as far as I know none of them come close to giving a good warning message. Is using deprecated different? Can you avoid the warning: use of deprecated ____ part of the warning, somehow? If it looks good, it would be amazing to make it the default. If it looks okay, then perhaps we could offer some way to enable/disable the feature, say via some setting in the diagnostic struct or similar.