Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Numerous warnings when building cargo-count #47

@mikemadden42

Description

@mikemadden42
$ rustc --version
rustc 1.52.1 (9bc8c42bb 2021-05-09)

$ sw_vers
ProductName:	macOS
ProductVersion:	11.3.1
BuildVersion:	20E241

I'm seeing the following warnings when building with cargo build --release:

   Compiling libc v0.2.15
   Compiling winapi-build v0.1.1
   Compiling winapi v0.2.8
   Compiling unicode-width v0.1.3
   Compiling regex-syntax v0.3.5
   Compiling unicode-segmentation v0.1.2
   Compiling vec_map v0.6.0
   Compiling bitflags v0.7.0
   Compiling ansi_term v0.9.0
   Compiling strsim v0.5.1
   Compiling glob v0.2.11
   Compiling utf8-ranges v0.1.3
   Compiling tabwriter v0.1.25
   Compiling kernel32-sys v0.2.2
   Compiling memchr v0.1.11
   Compiling term_size v0.2.1
   Compiling gitignore v1.0.4
   Compiling aho-corasick v0.5.2
   Compiling clap v2.11.2
   Compiling thread-id v2.0.0
   Compiling thread_local v0.2.6
   Compiling regex v0.1.75
   Compiling cargo-count v0.2.4 (/Users/mjm/rust2/cargo-count)
warning: unused macro definition
  --> src/macros.rs:17:1
   |
17 | / macro_rules! werr(
18 | |     ($($arg:tt)*) => ({
19 | |         use std::io::{Write, stderr};
20 | |         write!(&mut stderr(), $($arg)*).ok();
21 | |     })
22 | | );
   | |__^
   |
   = note: `#[warn(unused_macros)]` on by default

warning: unused macro definition
  --> src/macros.rs:61:1
   |
61 | / macro_rules! debug {
62 | |     ($fmt:expr) => ();
63 | |     ($fmt:expr, $($arg:tt)*) => ();
64 | | }
   | |_^

warning: trait objects without an explicit `dyn` are deprecated
  --> src/error.rs:58:32
   |
58 |     fn cause(&self) -> Option<&Error> {
   |                                ^^^^^ help: use `dyn`: `dyn Error`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

warning: use of deprecated trait `std::ascii::AsciiExt`: use inherent methods instead
  --> src/config.rs:10:1
   |
10 | / arg_enum! {
11 | |     #[derive(Debug)]
12 | |     pub enum Utf8Rule {
13 | |         Ignore,
...  |
16 | |     }
17 | | }
   | |_^
   |
   = note: `#[warn(deprecated)]` on by default
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/main.rs:285:5
    |
285 |     cli_try!(counts.count());
    |     ------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/main.rs:286:5
    |
286 |     cli_try!(counts.write_results());
    |     --------------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/macros.rs:6:54
   |
6  |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
   |                                                      ^^^^^^^^^^^
   | 
  ::: src/config.rs:55:34
   |
55 |                         ret.push(cli_try!(env::current_dir()).join(p));
   |                                  ---------------------------- in this macro invocation
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/macros.rs:6:54
   |
6  |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
   |                                                      ^^^^^^^^^^^
   | 
  ::: src/config.rs:61:26
   |
61 |                 ret.push(cli_try!(env::current_dir()).join(".git"));
   |                          ---------------------------- in this macro invocation
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/macros.rs:6:54
   |
6  |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
   |                                                      ^^^^^^^^^^^
   | 
  ::: src/config.rs:65:22
   |
65 |                 vec![cli_try!(env::current_dir()).join(".git")]
   |                      ---------------------------- in this macro invocation
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/macros.rs:6:54
   |
6  |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
   |                                                      ^^^^^^^^^^^
   | 
  ::: src/config.rs:77:22
   |
77 |                 vec![cli_try!(env::current_dir())]
   |                      ---------------------------- in this macro invocation
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:116:36
    |
116 |                 let mut file_ref = cli_try!(File::open(&file));
    |                                    --------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:126:25
    |
126 |                         cli_try!(file_ref.read_to_end(&mut vec_buf));
    |                         --------------------------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:130:25
    |
130 |                         cli_try!(file_ref.read_to_string(&mut buffer));
    |                         ----------------------------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |               Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                        ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:272:9
    |
272 | /         cli_try!(write!(w,
273 | |                         "\tLanguage\tFiles\tLines\tBlanks\tComments\tCode{}\n",
274 | |                         if self.cfg.usafe { "\tUnsafe (%)" } else { "" }));
    | |___________________________________________________________________________- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |               Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                        ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:275:9
    |
275 | /         cli_try!(write!(w,
276 | |                         "\t--------\t-----\t-----\t------\t--------\t----{}\n",
277 | |                         if self.cfg.usafe { "\t----------" } else { "" }));
    | |___________________________________________________________________________- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |               Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                        ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:285:17
    |
285 | /                 cli_try!(write!(w,
286 | |                                 "\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n",
287 | |                                 count.lang.name(),
288 | |                                 count.total_files(),
...   |
296 | |                                     format!("{} ({:.2}%)", count.usafe(), usafe_per)
297 | |                                 }));
    | |____________________________________- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:299:17
    |
299 |                 cli_try!(write!(w, "\t{}\n", count));
    |                 ------------------------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |               Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                        ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:302:9
    |
302 | /         cli_try!(write!(w,
303 | |                         "\t--------\t-----\t-----\t------\t--------\t----{}\n",
304 | |                         if self.cfg.usafe { "\t----------" } else { "" }));
    | |___________________________________________________________________________- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |               Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                        ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:305:9
    |
305 | /         cli_try!(write!(w,
306 | |                         "{}\t\t{}\t{}\t{}\t{}\t{}{}\n",
307 | |                         "Totals:",
308 | |                         fmt::format_number(self.tot as u64, self.cfg.thousands),
...   |
318 | |                             "".to_owned()
319 | |                         }));
    | |____________________________- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
   --> src/macros.rs:6:54
    |
6   |             Err(e) => return Err(CliError::Generic(e.description().to_owned()))
    |                                                      ^^^^^^^^^^^
    | 
   ::: src/count/counts.rs:321:9
    |
321 |         cli_try!(w.flush());
    |         -------------------- in this macro invocation
    |
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/error.rs:44:58
   |
44 |         write!(f, "{} {}", Format::Error("error:"), self.description())
   |                                                          ^^^^^^^^^^^

warning: 21 warnings emitted

    Finished release [optimized] target(s) in 19.15s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions