Work around test suite warning in rustc older than 1.39

Apparently this is fine in 1.39 and up, but older compilers warn.

    warning: enum is never used: `Error`
       --> tests/test_display.rs:151:5
        |
    151 |     pub enum Error {}
        |     ^^^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default

    warning: struct is never constructed: `MyError`
      --> tests/test_lints.rs:15:5
       |
    15 |     pub struct MyError;
       |     ^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(dead_code)]` on by default
This commit is contained in:
David Tolnay 2020-06-15 16:16:19 -07:00
parent bcb60bd1b5
commit f42549e0ef
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 4 additions and 0 deletions

View File

@ -149,6 +149,8 @@ fn test_void() {
#[derive(Error, Debug)] #[derive(Error, Debug)]
#[error("...")] #[error("...")]
pub enum Error {} pub enum Error {}
let _: Error;
} }
#[test] #[test]

View File

@ -13,4 +13,6 @@ fn test_unused_qualifications() {
#[derive(Debug, Error)] #[derive(Debug, Error)]
#[error("...")] #[error("...")]
pub struct MyError; pub struct MyError;
let _: MyError;
} }