-
Notifications
You must be signed in to change notification settings - Fork 332
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.