Skip to content
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

Ignore deprecation warning in clap macro invocation #1910

Merged
merged 1 commit into from
Jul 10, 2020
Merged

Conversation

faern
Copy link
Member

@faern faern commented Jul 10, 2020

Maybe about time to get rid of the annoying:

warning: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred

  --> mullvad-daemon/src/cli.rs:69:17
   |
69 |         .author(crate_authors!(", "))
   |                 ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

I have realized that clap will never fix the warning. Simply because that would bump the MSRV, and clap 2 has apparently stated that it should remain at 1.24 🤷‍♂️ :( (clap-rs/clap#1988)

So I rearranged the code a little bit in order to be able to stick an #[allow(deprecated)] on the problematic code, but just as little of it as possible.

We use the same macro in mullvad-cli. But for some reason that does not emit any warning during regular build, so I did not touch it. I don't know why and I did not spend any time on figuring it out either.

Git checklist:


This change is Reviewable

@faern faern requested a review from jvff July 10, 2020 11:19
Copy link
Contributor

@jvff jvff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@faern faern merged commit 838a4df into master Jul 10, 2020
@faern faern deleted the fix-clap-warning branch July 10, 2020 13:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants