A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
1560 matches across 6 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | clippy_utils/src/consts.rs | 41 | Char(char), |
| LOW | clippy_utils/src/consts.rs | 1121 | /// If `expr` evaluates to an integer constant, return its value. |
| LOW | clippy_utils/src/diagnostics.rs | 81 | /// |
| LOW | clippy_utils/src/diagnostics.rs | 101 | /// | |
| LOW | clippy_utils/src/diagnostics.rs | 121 | /// For the `span_lint_and_help` function, the node that was passed into the `LintPass::check_*` |
| LOW | clippy_utils/src/diagnostics.rs | 161 | |
| LOW | clippy_utils/src/diagnostics.rs | 181 | /// If it doesn't, you likely need to use [`span_lint_hir_and_then`] instead. |
| LOW | clippy_utils/src/diagnostics.rs | 221 | /// |
| LOW | clippy_utils/src/diagnostics.rs | 261 | f(diag); |
| LOW | clippy_utils/src/diagnostics.rs | 281 | /// |
| LOW | clippy_utils/src/diagnostics.rs | 301 | /// This is in contrast to [`span_lint_and_then`], which always emits the lint at the node that was |
| LOW | clippy_utils/src/diagnostics.rs | 341 | |
| LOW | clippy_utils/src/diagnostics.rs | 361 | /// If you're emitting the lint at the span of a different node than the one provided by the |
| LOW | clippy_utils/src/visitors.rs | 501 | /// Runs the given function for each sub-expression producing the final value consumed by the parent |
| LOW | clippy_utils/src/lib.rs | 141 | let sess = rustc_lint::LintContext::sess(cx); |
| LOW | clippy_utils/src/lib.rs | 441 | /// Use this if you want to find the `TraitRef` of the `Add` trait in this example: |
| LOW | clippy_utils/src/lib.rs | 721 | /// * Yield/Return statements. |
| LOW | clippy_utils/src/lib.rs | 1321 | node, |
| LOW | clippy_utils/src/lib.rs | 1461 | } |
| LOW | clippy_utils/src/lib.rs | 1841 | /// Checks if a function's body represents the identity function. Looks for bodies of the form: |
| LOW | clippy_utils/src/lib.rs | 2121 | /// # struct S; |
| LOW | clippy_utils/src/lib.rs | 2941 | } |
| LOW | clippy_utils/src/lib.rs | 3061 | fn push_break_target(&mut self, id: HirId) { |
| LOW | clippy_utils/src/lib.rs | 3321 | tcx.def_path_str(callee) |
| LOW | clippy_utils/src/lib.rs | 3361 | // result should be super::super::c::d::e::f |
| LOW | clippy_utils/src/lib.rs | 3461 | } |
| LOW | clippy_utils/src/lib.rs | 3621 | /// Checks if `expr` may be directly used as the return value of its enclosing body. |
| LOW | clippy_utils/src/check_proc_macro.rs | 1 | //! This module handles checking if the span given is from a proc-macro or not. |
| LOW | clippy_utils/src/paths.rs | 161 | pub static ONCE_CELL_SYNC_LAZY: PathLookup = type_path!(once_cell::sync::Lazy); |
| LOW | clippy_utils/src/res.rs | 341 | |
| LOW | clippy_utils/src/str_utils.rs | 61 | /// ```no_run |
| LOW | clippy_utils/src/str_utils.rs | 121 | } |
| LOW | clippy_utils/src/str_utils.rs | 181 | |
| LOW | clippy_utils/src/source.rs | 141 | f: impl for<'a> FnOnce(&'a SourceFile, &'a str, Range<usize>) -> Option<Range<usize>>, |
| LOW | clippy_utils/src/source.rs | 401 | /// Extends the span to the beginning of the spans line, incl. whitespaces. |
| LOW | clippy_utils/src/source.rs | 441 | // sources that the user has no control over. |
| LOW | clippy_utils/src/source.rs | 521 | /// to convert a given `Span` to a `str`. |
| LOW | clippy_utils/src/source.rs | 581 | } |
| LOW | clippy_utils/src/source.rs | 601 | /// y; |
| LOW | clippy_utils/src/source.rs | 701 | ) |
| LOW | clippy_utils/src/source.rs | 721 | /// This will traverse through multiple macro calls. Given the following: |
| LOW | clippy_utils/src/sugg.rs | 21 | |
| LOW | clippy_utils/src/sugg.rs | 701 | /// |
| LOW | clippy_utils/src/sugg.rs | 721 | /// |
| LOW | clippy_utils/src/sugg.rs | 861 | /// The `hir_id` of the closure argument being checked |
| LOW | clippy_utils/src/sugg.rs | 961 | let _ = write!(self.suggestion_start, "{start_snip}{ident_str_with_proj}"); |
| LOW | clippy_utils/src/hir_utils.rs | 41 | Exact, |
| LOW | clippy_utils/src/macros.rs | 161 | .into_iter() |
| LOW | clippy_utils/src/macros.rs | 241 | #[derive(Debug)] |
| LOW | clippy_utils/src/ty/type_certainty/mod.rs | 1 | //! A heuristic to tell whether an expression's type can be determined purely from its |
| LOW | clippy_lints_internal/src/produce_ice.rs | 1 | use rustc_ast::ast::NodeId; |
| LOW | clippy_lints_internal/src/lint_without_lint_pass.rs | 21 | /// |
| LOW | clippy_lints_internal/src/lint_without_lint_pass.rs | 41 | Warn, |
| LOW | …ippy_lints_internal/src/repeated_is_diagnostic_item.rs | 21 | /// compare the output with all the `Symbol`s. |
| LOW | …ippy_lints_internal/src/repeated_is_diagnostic_item.rs | 41 | /// .. |
| LOW | …ippy_lints_internal/src/repeated_is_diagnostic_item.rs | 61 | /// if cx.tcx.is_diagnostic_item(sym::Result, did) { |
| LOW | …ippy_lints_internal/src/repeated_is_diagnostic_item.rs | 81 | /// } |
| LOW | …ippy_lints_internal/src/repeated_is_diagnostic_item.rs | 101 | /// .. |
| LOW | …ippy_lints_internal/src/collapsible_span_lint_calls.rs | 21 | /// These usages of `span_lint_and_then` should be replaced with one of the |
| LOW | …ippy_lints_internal/src/collapsible_span_lint_calls.rs | 41 | /// }); |
| 1462 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/ui/sliced_string_as_bytes.rs | 25 | let s = "Lorem ipsum"; |
| LOW | tests/ui/sliced_string_as_bytes.rs | 26 | let string: String = "dolor sit amet".to_owned(); |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 16 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 16 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 23 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 23 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 29 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 29 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 40 | /// ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 50 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 50 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 59 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 59 | /// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia |
| LOW | tests/ui/too_long_first_doc_paragraph.rs | 65 | /// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetti |
| LOW | …documented_unsafe_blocks/undocumented_unsafe_blocks.rs | 119 | // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor |
| LOW | …documented_unsafe_blocks/undocumented_unsafe_blocks.rs | 119 | // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor |
| LOW | …documented_unsafe_blocks/undocumented_unsafe_blocks.rs | 538 | // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor |
| LOW | …documented_unsafe_blocks/undocumented_unsafe_blocks.rs | 538 | // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor |
| LOW | tests/ui-toml/large_include_file/too_big.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq |
| LOW | tests/ui-toml/large_include_file/too_big.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq |
| LOW | clippy_lints/src/methods/mod.rs | 3624 | /// let s = "Lorem ipsum"; |
| LOW | clippy_lints/src/methods/mod.rs | 3629 | /// let s = "Lorem ipsum"; |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | clippy_lints/src/same_length_and_capacity.rs | 65 | /// // This time, leverage the previously saved capacity: |
| MEDIUM | clippy_lints/src/large_stack_frames.rs | 197 | // TODO: Is there a cleaner, robust way to ask this question? |
| MEDIUM | clippy_lints/src/operators/mod.rs | 497 | /// technically unnecessary. However, it will make the code more robust and doesn't have any |
| MEDIUM | src/driver.rs | 157 | // is there already. Certainly it can't hurt. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | .github/workflows/clippy_mq.yml | 214 | # Check if all jobs that we depend on (in the needs array) were successful. |
| LOW | .github/workflows/clippy_dev.yml | 60 | # Check if all jobs that we depend on (in the needs array) were successful. |
| LOW | .github/workflows/clippy_pr.yml | 83 | # Check if all jobs that we depend on (in the needs array) were successful. |
| LOW | .github/workflows/clippy_changelog.yml | 50 | # Check if all jobs that we depend on (in the needs array) were successful. |
| LOW | .github/workflows/remark.yml | 66 | # Check if all jobs that we depend on (in the needs array) were successful. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | lintcheck/lintcheck_crates.toml | 6 | # For testing you can also add sources to git and local repos like this: |
| LOW | .github/workflows/clippy_mq.yml | 33 | # NOTE: If you modify this job, make sure you copy the changes to clippy.yml |
| LOW | .github/workflows/clippy_pr.yml | 21 | # NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | clippy_lints/src/missing_inline.rs | 115 | // note: we need to check if the trait is exported so we can't use |
| LOW | clippy_lints/src/non_copy_const.rs | 457 | // Normalized as we need to check if this is an array later. |
| LOW | clippy_lints/src/non_copy_const.rs | 500 | // Normalized as we need to check if this is an array later. |
| LOW | clippy_lints/src/non_copy_const.rs | 639 | // Normalized as we need to check if this is an array later. |