Replace proc-macro-error with proc-macro2-diagnostics#536
Replace proc-macro-error with proc-macro2-diagnostics#536tamird wants to merge 5 commits intoTeXitoi:masterfrom
Conversation
``` TRYBUILD=overwrite cargo test ```
```
warning: unnecessary parentheses around match arm expression
--> structopt-derive/src/parse.rs:177:28
|
177 | "about" => (Ok(About(name, None))),
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
177 - "about" => (Ok(About(name, None))),
177 + "about" => Ok(About(name, None)),
|
warning: unnecessary parentheses around match arm expression
--> structopt-derive/src/parse.rs:178:29
|
178 | "author" => (Ok(Author(name, None))),
| ^ ^
|
help: remove these parentheses
|
178 - "author" => (Ok(Author(name, None))),
178 + "author" => Ok(Author(name, None)),
|
```
```
warning: the following explicit lifetimes could be elided: 'a
--> src/lib.rs:1205:24
|
1205 | fn from_subcommand<'a, 'b>(_sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self>
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
1205 - fn from_subcommand<'a, 'b>(_sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self>
1205 + fn from_subcommand<'b>(_sub: (&'b str, Option<&'b clap::ArgMatches<'_>>)) -> Option<Self>
|
warning: the following explicit lifetimes could be elided: 'a
--> src/lib.rs:1230:24
|
1230 | fn from_subcommand<'a, 'b>(sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
1230 - fn from_subcommand<'a, 'b>(sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self> {
1230 + fn from_subcommand<'b>(sub: (&'b str, Option<&'b clap::ArgMatches<'_>>)) -> Option<Self> {
|
```
proc-macro-error is unmaintained, and structopt-derive is by far its most popular dependent. See https://crates.io/crates/proc-macro-error/reverse_dependencies.
|
@TeXitoi could you have a look please? |
|
That’s a big change for a frozen crate. I’ll try to have a look, but no promise. |
| error: `#[structopt(raw(...))` attributes are removed in structopt 0.3, they are replaced with raw methods | ||
|
|
||
| = help: if you meant to call `clap::Arg::raw()` method you should use bool literal, like `raw(true)` or `raw(false)` | ||
| = note: if you need to call `clap::Arg/App::case_insensitive` method you can do it like this: #[structopt(case_insensitive = true)] |
There was a problem hiding this comment.
That regression should be noted in a CHANGELOG.md entry ?
There was a problem hiding this comment.
No regression allowed for a crate in maintenance just to optimize compilation time. Better to migrate to clap if you want to improve compilation times.
imo that effort would be better spent migrating some of the more popular users. |
|
You mean like this? |
|
I close this MR as there is no activity. |
|
If you can close it, maybe you can also review and accept it? |
|
Sorry. I don't want a regression, and there is one. Also, I'm quite anxious at this PR as this is a big library change, and it might cause a behavior change. I know that you worked in this and that closing this deny your work, but it adds more risk than advantages for my point of view. |
|
Ack. Salvaged some useful stuff into #542 + added GitHub CI. |
See individual commits.
I realize this crate is deprecated in favor of clap, but it still seems to
enjoy some 10,000-40,000 downloads per day over the past three months. Updating
to syn@2 is likely to have positive effect on compilation time for dependents.
See https://crates.io/crates/structopt-derive for download graphs.