Skip to content

Commit

Permalink
Ignore assertions_on_result_states clippy lint
Browse files Browse the repository at this point in the history
    error: called `assert!` with `Result::is_err`
      --> tests/comments.rs:68:5
       |
    68 |     assert!("/*/".parse::<TokenStream>().is_err());
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"/*/".parse::<TokenStream>().unwrap_err()`
       |
       = note: `-D clippy::assertions-on-result-states` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:224:5
        |
    224 |     assert!("1".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"1".parse::<Literal>().unwrap()`
        |
        = note: `-D clippy::assertions-on-result-states` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:225:5
        |
    225 |     assert!("-1".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"-1".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:226:5
        |
    226 |     assert!("-1u12".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"-1u12".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:227:5
        |
    227 |     assert!("1.0".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"1.0".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:228:5
        |
    228 |     assert!("-1.0".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"-1.0".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:229:5
        |
    229 |     assert!("-1.0f12".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"-1.0f12".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:230:5
        |
    230 |     assert!("'a'".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"'a'".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_ok`
       --> tests/test.rs:231:5
        |
    231 |     assert!("\"\n\"".parse::<Literal>().is_ok());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"\"\n\"".parse::<Literal>().unwrap()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:232:5
        |
    232 |     assert!("0 1".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"0 1".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:233:5
        |
    233 |     assert!(" 0".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `" 0".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:234:5
        |
    234 |     assert!("0 ".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"0 ".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:235:5
        |
    235 |     assert!("/* comment */0".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"/* comment */0".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:236:5
        |
    236 |     assert!("0/* comment */".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"0/* comment */".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:237:5
        |
    237 |     assert!("0// comment".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"0// comment".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:238:5
        |
    238 |     assert!("- 1".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"- 1".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:239:5
        |
    239 |     assert!("- 1.0".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"- 1.0".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:240:5
        |
    240 |     assert!("-\"\"".parse::<Literal>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `"-\"\"".parse::<Literal>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:385:5
        |
    385 |     assert!(s.parse::<TokenStream>().is_err());
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `s.parse::<TokenStream>().unwrap_err()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states
  • Loading branch information
dtolnay committed Jul 30, 2022
1 parent a77588b commit e9a734c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/comments.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::assertions_on_result_states)]

use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree};

// #[doc = "..."] -> "..."
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::non_ascii_literal)]
#![allow(clippy::assertions_on_result_states, clippy::non_ascii_literal)]

use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
use std::panic;
Expand Down

0 comments on commit e9a734c

Please sign in to comment.