PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 17, 2022

[FIXED] How can I silence Rust warnings in macros from external crates?

 July 17, 2022     macros, rust, static-analysis, warnings     No comments   

Issue

Using clap's arg_enum macro I get this warning:

warning: use of deprecated item 'std::ascii::AsciiExt': use inherent methods instead
  --> src/main.rs:37:1
   |
37 | / arg_enum!{
38 | |     #[derive(Debug)]
39 | |     pub enum Operation {
40 | |         Add,
...  |
47 | |     }
48 | | }
   | |_^
   |
   = note: #[warn(deprecated)] on by default
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

How can I silence it? I've tried putting #[allow(deprecated)] before the arg_enum! and before the extern crate clap; but neither had any effect.


Solution

No, this is not possible yet. Add macro checks to lints (issue #48855) is open to add such functionality.



Answered By - Shepmaster
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing