Skip to content

Commit

Permalink
Ignore single_element_loop clippy lint in test
Browse files Browse the repository at this point in the history
    warning: for loop over a single element
       --> tests/test_expr.rs:333:5
        |
    333 | /     for stmt in [
    334 | |         // Parentheses required. See rust-lang/rust#87026.
    335 | |         quote! {
    336 | |             break 'label: loop { break 'label 42; };
    ...   |
    339 | |         syn::parse2::<Stmt>(stmt).unwrap_err();
    340 | |     }
        | |_____^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_element_loop
        = note: `-W clippy::single-element-loop` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::single_element_loop)]`
    help: try
        |
    333 ~     {
    334 +         let stmt = {
    335 +         let mut _s = $crate::__private::TokenStream::new();
    336 +         $crate::quote_each_token!{_s $($tt)*}
    337 +         _s
    338 +     };
    339 +         syn::parse2::<Stmt>(stmt).unwrap_err();
    340 +     }
        |
  • Loading branch information
dtolnay committed Nov 6, 2023
1 parent a876185 commit b88f86f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_expr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::uninlined_format_args)]
#![allow(clippy::single_element_loop, clippy::uninlined_format_args)]

#[macro_use]
mod macros;
Expand Down

0 comments on commit b88f86f

Please sign in to comment.