Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on clippy pedantic lints in CI #1242

Merged
merged 9 commits into from
Jul 6, 2023
Merged

Turn on clippy pedantic lints in CI #1242

merged 9 commits into from
Jul 6, 2023

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jul 6, 2023

No description provided.

    warning: wildcard matches only a single variant and will also match any future added variants
      --> gen/src/error.rs:43:13
       |
    43 |             _ => None,
       |             ^ help: try this: `Error::NoBridgeMod`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
       = note: `-W clippy::match-wildcard-for-single-variants` implied by `-W clippy::pedantic`
    warning: redundant closure
      --> gen/src/cfg.rs:64:45
       |
    64 |             let value = string.as_ref().map(|string| string.value());
       |                                             ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `syn::LitStr::value`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
       = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic`
    warning: consider adding a `;` to the last statement for consistent formatting
       --> gen/src/write.rs:132:17
        |
    132 |                 check_trivial_extern_type(out, ety, reasons)
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_trivial_extern_type(out, ety, reasons);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
        = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`

    warning: consider adding a `;` to the last statement for consistent formatting
      --> syntax/parse.rs:45:17
       |
    45 |                 parse_foreign_mod(cx, foreign_mod, &mut apis, trusted, namespace)
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `parse_foreign_mod(cx, foreign_mod, &mut apis, trusted, namespace);`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    warning: consider adding a `;` to the last statement for consistent formatting
      --> gen/lib/tests/test.rs:27:5
       |
    27 |     assert!(cxx_gen::generate_header_and_cc(rs, &opt).is_err())
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `assert!(cxx_gen::generate_header_and_cc(rs, &opt).is_err());`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
       = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
    warning: unnested or-patterns
      --> gen/src/check.rs:19:20
       |
    19 |             if let Some(Component::CurDir) | Some(Component::ParentDir) = first_component {
       |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
       = note: `-W clippy::unnested-or-patterns` implied by `-W clippy::pedantic`
    help: nest the patterns
       |
    19 |             if let Some(Component::CurDir | Component::ParentDir) = first_component {
       |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:208:17
        |
    208 | /                 Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(I8) | Some(I16) | Some(I32)
    209 | |                 | Some(I64) => out.include.cstdint = true,
        | |___________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    208 |                 Some(U8 | U16 | U32 | U64 | I8 | I16 | I32 | I64) => out.include.cstdint = true,
        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:214:17
        |
    214 |                 Some(Bool) | Some(Char) | Some(F32) | Some(F64) | None => {}
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    214 |                 Some(Bool | Char | F32 | F64) | None => {}
        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:851:9
        |
    851 |         Some(Type::Str(_)) | Some(Type::SliceRef(_)) if !indirect_return => write!(out, ")"),
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    851 |         Some(Type::Str(_) | Type::SliceRef(_)) if !indirect_return => write!(out, ")"),
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
        --> gen/src/write.rs:1185:9
         |
    1185 |         Some(Type::RustBox(ty)) | Some(Type::UniquePtr(ty)) => {
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
         |
    1185 |         Some(Type::RustBox(ty) | Type::UniquePtr(ty)) => {
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
        --> gen/src/write.rs:1196:9
         |
    1196 |         Some(Type::Str(_)) | Some(Type::SliceRef(_)) => {
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
         |
    1196 |         Some(Type::Str(_) | Type::SliceRef(_)) => {
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:126:17
        |
    126 | /                 None | Some(Bool) | Some(Char) | Some(U8) | Some(U16) | Some(U32) | Some(U64)
    127 | |                 | Some(Usize) | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize)
    128 | |                 | Some(F32) | Some(F64) | Some(RustString) => return,
        | |__________________________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    126 ~                 None |
    127 + Some(Bool | Char | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize
    128 ~ | F32 | F64 | RustString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:165:13
        |
    165 | /             None | Some(Bool) | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize)
    166 | |             | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32)
    167 | |             | Some(F64) | Some(CxxString) => return,
        | |_________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    165 ~             None |
    166 + Some(Bool | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32
    167 ~ | F64 | CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:168:13
        |
    168 |             Some(Char) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    168 |             Some(Char | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:186:13
        |
    186 | /             None | Some(Bool) | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize)
    187 | |             | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32)
    188 | |             | Some(F64) | Some(CxxString) => return,
        | |_________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    186 ~             None |
    187 + Some(Bool | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32
    188 ~ | F64 | CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:189:13
        |
    189 |             Some(Char) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    189 |             Some(Char | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:210:13
        |
    210 | /             None | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize) | Some(I8)
    211 | |             | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32) | Some(F64)
    212 | |             | Some(CxxString) => return,
        | |_____________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    210 ~             None |
    211 + Some(U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32 | F64 |
    212 ~ CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:214:13
        |
    214 |             Some(Bool) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    214 |             Some(Bool | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/build/src/lib.rs:458:21
        |
    458 |                     Some("h") | Some("hh") | Some("hpp") => {}
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    458 |                     Some("h" | "hh" | "hpp") => {}
        |                     ~~~~~~~~~~~~~~~~~~~~~~~~
    warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
      --> gen/cmd/src/app.rs:87:27
       |
    87 |                     path: include.to_owned(),
       |                           ^^^^^^^^^^^^^^^^^^ help: consider using: `include.clone()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
       = note: `-W clippy::implicit-clone` implied by `-W clippy::pedantic`
… code

    warning: adding items after statements is confusing, since items exist from the start of the scope
      --> demo/src/main.rs:15:12
       |
    15 |         fn next_chunk(buf: &mut MultiBuf) -> &[u8];
       |            ^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
       = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
@dtolnay dtolnay merged commit b35e34f into master Jul 6, 2023
@dtolnay dtolnay deleted the clippypedantic branch July 6, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant