Skip to content

Commit

Permalink
Ignore blocks_in_conditions clippy lint
Browse files Browse the repository at this point in the history
    warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
      --> tests/common/parse.rs:16:34
       |
    16 |       match panic::catch_unwind(|| {
       |  __________________________________^
    17 | |         let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
    18 | |         let file_path_mapping = FilePathMapping::empty();
    19 | |         let sess = ParseSess::new(locale_resources, file_path_mapping);
    ...  |
    32 | |         }
    33 | |     }) {
       | |_____^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
       = note: `-W clippy::blocks-in-conditions` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::blocks_in_conditions)]`

    warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
       --> tests/test_round_trip.rs:90:50
        |
    90  |           let equal = match panic::catch_unwind(|| {
        |  __________________________________________________^
    91  | |             let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
    92  | |             let file_path_mapping = FilePathMapping::empty();
    93  | |             let sess = ParseSess::new(locale_resources, file_path_mapping);
    ...   |
    114 | |             Ok((before, after))
    115 | |         }) {
        | |_________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
  • Loading branch information
dtolnay committed Dec 17, 2023
1 parent e11575e commit 66ee902
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#![recursion_limit = "1024"]
#![feature(rustc_private)]
#![allow(
clippy::blocks_in_conditions,
clippy::doc_markdown,
clippy::explicit_deref_methods,
clippy::let_underscore_untyped,
Expand Down
1 change: 1 addition & 0 deletions tests/test_round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![recursion_limit = "1024"]
#![feature(rustc_private)]
#![allow(
clippy::blocks_in_conditions,
clippy::manual_assert,
clippy::manual_let_else,
clippy::match_like_matches_macro,
Expand Down

0 comments on commit 66ee902

Please sign in to comment.