-
Notifications
You must be signed in to change notification settings - Fork 430
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
Enable various new clippy lints #1025
base: rust-next
Are you sure you want to change the base?
Commits on Jul 16, 2023
-
rust: move 'rust_common_flags' to a separate configuration file
Currently, 'rustc_common_flags' lives in the top-level 'Makefile'. This means that we need to touch this whenever adjustments to Rust's CLI configuration are desired, such as changing what lints Clippy should emit. This patch moves these flags to a separate file within 'rust/' so that necessary changes can be made without affecting 'Makefile'. It copies the behavior currently used with 'bindgen_parameters', which accepts comments. Additionally, 'let_unit_value` is no longer specifically named as it is now part of the 'style' group [1]. [1]: rust-lang/rust-clippy#8563 Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3754849 - Browse repository at this point
Copy the full SHA 3754849View commit details -
rust: clippy: enable lints from 'pedantic' that have no errors
This patch selects a subset of lints from Clippy's 'pedantic' group and enables them. The only lints enabled here are those that do not show any errors with any of the files we currently have. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 82157b8 - Browse repository at this point
Copy the full SHA 82157b8View commit details -
rust: clippy: enable 'undocumented_unsafe_blocks' lint
This patch enables the 'undocumented_unsafe_blocks' lint and adds comments where needed for this lint to pass. Clippy will now deny unsafe code that does not have an associated '// SAFETY: ' comment, which helps improve the maintainability of potentially dangerous code. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bbc6d1c - Browse repository at this point
Copy the full SHA bbc6d1cView commit details -
rust: clippy: enable three trivial lints with corrections
This patch enables three trivial lints and adds corrections so existing code passes. Lints added were: - 'expl_impl_clone_on_copy': check for implementing `Clone` when `Copy` already exists. - 'explicit_deref_methods': check for usage of `.deref()` to encourage cleaner code. - 'trivially_copy_pass_by_ref': check for small types that would be easier passed by value than by reference. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8f4700d - Browse repository at this point
Copy the full SHA 8f4700dView commit details -
rust: clippy: enable two pointer-related lints
- 'ptr_as_ptr': enforce that '*const -> *const' and '*mut -> *mut' conversions be done via '.cast()' rather than 'as', to avoid accidental changes in mutability. - 'transmute_ptr_to_ptr': detect transumtes that could be written as lessi dangerous casts. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a764f0a - Browse repository at this point
Copy the full SHA a764f0aView commit details -
rust: clippy: enable lints related to improving style
- 'manual_assert': detect combined usage of 'if' and 'panic' when 'assert' would have been more straightforward. - 'redundant_else': enforce that blocks are not nested within 'else' after conditional control flow statments. - 'semicolon_if_nothing_returned': enforce consistent style that makes it more clear that a statement is not used. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2118d15 - Browse repository at this point
Copy the full SHA 2118d15View commit details -
rust: clippy: enable 'items_after_statements' and 'redundant_closure_…
…for_...' - 'items_after_statements': prevent confusing scope since items and statements do not follow the same rules. - 'redundant_closure_for_method_calls': simplify closures that call a single method. This is the associated function equivalent of 'redundant_closure'. Signed-off-by: Trevor Gross <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b2d5dbc - Browse repository at this point
Copy the full SHA b2d5dbcView commit details