| /third_party/rust/rust/src/tools/clippy/book/src/ |
| D | lints.md | 1 # Clippy's Lints 3 Clippy offers a bunch of additional lints, to help its users write more correct 4 and idiomatic Rust code. A full list of all lints, that can be filtered by 9 of lints they offer and recommended actions when you should see a lint out of 17 The `clippy::correctness` group is the only lint group in Clippy which lints are 22 Lints in this category are carefully picked and should be free of false 23 positives. So just `#[allow]`ing those lints is not recommended. 27 The `clippy::suspicious` group is similar to the correctness lints in that it 28 contains lints that trigger on code that is really _sus_ and should be fixed. As 29 opposed to correctness lints, it might be possible that the linted code is [all …]
|
| D | lint_configuration.md | 9 and lints affected. 32 **Affected lints:** 55 **Affected lints:** 71 **Affected lints:** 76 Suppress lints whenever the suggested change would cause breakage for other crates. 81 **Affected lints:** 106 **Affected lints:** 162 **Affected lints:** 172 **Affected lints:** 184 **Affected lints:** [all …]
|
| D | usage.md | 21 The above command will run the default set of lints, which are included in the 22 lint group `clippy::all`. You might want to use even more lints, or you may not 52 [rustc documentation]: https://doc.rust-lang.org/rustc/lints/levels.html#configuring-warning-levels 54 #### Even more lints 57 have to enable the lints in those groups manually. 59 For a full list of all lints with their description and examples, please refer 68 lints, that may have some intentional false positives in order to prevent false 77 The second group is the `restriction` group. This group contains lints that 80 through the lints in this group and enable the ones that fit your need. 82 > _Note:_ You shouldn't enable the whole lint group, but cherry-pick lints from [all …]
|
| D | configuration.md | 5 Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`, which is searche… 20 contains all config values, their default, and a list of lints they affect. 36 ### Allowing/denying lints 38 You can add options to your code to `allow`/`warn`/`deny` Clippy lints: 40 * the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`) 42 * all lints using both the `clippy` and `clippy::pedantic` lint groups (`#![deny(clippy::all)]`, 43 …`#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive lints pr… 46 * only some lints (`#![deny(clippy::single_match, clippy::box_vec)]`, etc.) 54 If you do not want to include your lint levels in your code, you can globally enable/disable lints … 69 This also works with lint groups. For example, you can run Clippy with warnings for all lints enabl… [all …]
|
| D | README.md | 6 A collection of lints to catch common mistakes and improve your 9 [There are over 600 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/i… 11 Lints are divided into categories, each with a default [lint 12 level](https://doc.rust-lang.org/rustc/lints/levels.html). You can choose how 18 | `clippy::all` | all lints that are on by default (correctness, suspicious, style, complex… 24 | `clippy::pedantic` | lints which are rather strict or might have false positives … 25 | `clippy::nursery` | new lints that are still under development … 26 | `clippy::cargo` | lints for the cargo manifest … 32 contains "restriction lints", which are for things which are usually not
|
| /third_party/rust/rust/src/doc/rustc/src/lints/ |
| D | levels.md | 3 In `rustc`, lints are divided into five *levels*: 17 These lints exist, but by default, do nothing. For example, consider this 33 These lints exist mostly to be manually turned on via configuration, as we'll 67 level is capped via cap-lints. 92 Lints are configurable via levels, so in a similar way to 'allow' lints, 103 levels may still be capped with `--cap-lints` (see below) so `rustc --cap-lints warn` 104 will make lints set to 'forbid' just warn. 120 You can also "cap" lints so that the compiler can choose to ignore 125 The `-A`, `-W`, `--force-warn` `-D`, and `-F` flags let you turn one or more lints 164 You can also pass each flag more than once for changing multiple lints: [all …]
|
| D | index.md | 1 # Lints chapter 4 Rust compiler contains a number of lints, and when it compiles your code, it will 5 also run the lints. These lints may produce a warning, an error, or nothing at all, 30 ## Future-incompatible lints 33 existing code to stop compiling. "Future-incompatible" lints are issued in
|
| /third_party/rust/rust/src/tools/clippy/clippy_dev/src/ |
| D | update_lints.rs | 37 let (lints, deprecated_lints, renamed_lints) = gather_all(); in update() 38 generate_lint_files(update_mode, &lints, &deprecated_lints, &renamed_lints); in update() 43 lints: &[Lint], in generate_lint_files() 47 let internal_lints = Lint::internal_lints(lints); in generate_lint_files() 48 let mut usable_lints = Lint::usable_lints(lints); in generate_lint_files() 55 " lints included in this crate!]", in generate_lint_files() 65 " lints included in this crate!]", in generate_lint_files() 97 "// begin lints modules, do not remove this comment, it’s used in `update_lints`\n", in generate_lint_files() 98 "// end lints modules, do not remove this comment, it’s used in `update_lints`", in generate_lint_files() 130 for (lint_group, mut lints) in grouped_by_lint_group { in print_lints() [all …]
|
| /third_party/rust/rust/src/tools/clippy/ |
| D | README.md | 6 A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang… 8 [There are over 600 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/i… 10 Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc… 15 | `clippy::all` | all lints that are on by default (correctness, suspicious, style, complex… 21 | `clippy::pedantic` | lints which are rather strict or have occasional false positives … 22 | `clippy::restriction` | lints which prevent the use of language and library features[^restrict] … 23 | `clippy::nursery` | new lints that are still under development … 24 | `clippy::cargo` | lints for the cargo manifest … 29 lints may lint against perfectly reasonable code, may not have an alternative suggestion, 30 and may contradict any other lints (including other categories). Lints should be considered [all …]
|
| D | CHANGELOG.md | 17 ### New Lints 55 * [`extra_unused_type_parameters`]: No longer lints on public items if `avoid-breaking-exported-api… 68 * [`arithmetic_side_effects`]: No longer lints on right or left shifts with constant integers, as t… 78 * [`single_component_path_imports`]: No longer lints if the import is used relative to `self` 82 * [`let_unit_value`]: No longer lints if the expression contains an `await` 86 * [`manual_clamp`]: No longer lints in constant context 92 * [`needless_return`]: No longer lints match statements with incompatible branches 96 * [`mem_replace_option_with_none`]: No longer lints on field expressions 98 * [`items_after_statements`]: No longer lints on items from macros 104 * [`almost_swapped`]: No longer lints if a variable is assigned to itself [all …]
|
| /third_party/rust/rust/src/tools/lint-docs/src/ |
| D | groups.rs | 10 ("unused", "Lints that detect things being declared but not used, or excess syntax"), 11 ("let-underscore", "Lints that detect wildcard let bindings that are likely to be invalid"), 12 ("rustdoc", "Rustdoc-specific lints"), 13 ("rust-2018-idioms", "Lints to nudge you toward idiomatic features of Rust 2018"), 15 ("future-incompatible", "Lints that detect code that has future-compatibility problems"), 16 ("rust-2018-compatibility", "Lints used to transition code from the 2015 edition to 2018"), 17 ("rust-2021-compatibility", "Lints used to transition code from the 2018 edition to 2021"), 24 pub(crate) fn generate_group_docs(&self, lints: &[Lint]) -> Result<(), Box<dyn Error>> { in generate_group_docs() 30 contents.replace("{{groups-table}}", &self.make_groups_table(lints, &groups)?); in generate_group_docs() 67 let lints = parts in collect_groups() localVariable [all …]
|
| D | lib.rs | 115 /// Collects all lints, and writes the markdown documentation at the given directory. 117 let mut lints = self.gather_lints()?; in extract_lint_docs() localVariable 118 for lint in &mut lints { in extract_lint_docs() 129 self.save_lints_markdown(&lints)?; in extract_lint_docs() 130 self.generate_group_docs(&lints)?; in extract_lint_docs() 134 /// Collects all lints from all files in the given directory. 136 let mut lints = Vec::new(); in gather_lints() localVariable 141 lints.extend(self.lints_from_file(entry.path())?); in gather_lints() 143 if lints.is_empty() { in gather_lints() 144 return Err("no lints were found!".into()); in gather_lints() [all …]
|
| /third_party/rust/rust/src/librustdoc/ |
| D | lint.rs | 13 /// A little detail easy to forget is that there is a way to set the lint level for all lints 18 /// * Vector of tuples of lints' name and their associated "max" level 33 let lints = || { in init_lints() localVariable 39 let lint_opts = lints() in init_lints() 41 // Permit feature-gated lints to avoid feature errors when trying to in init_lints() 42 // allow all lints. in init_lints() 52 let lint_caps = lints() in init_lints() 54 // We don't want to allow *all* lints so let's ignore in init_lints() 83 /// [rustdoc book]: ../../../rustdoc/lints.html#broken_intra_doc_links 94 /// [rustdoc book]: ../../../rustdoc/lints.html#private_intra_doc_links [all …]
|
| /third_party/rust/rust/src/tools/clippy/tests/ui/ |
| D | suspicious_to_owned.rs | 17 // we expect no lints for this in main() 20 // we expect no lints for this in main() 27 // we expect no lints for this in main() 30 // we expect no lints for this in main() 37 // we expect no lints for this in main() 40 // we expect no lints for this in main() 47 // we expect no lints for this in main() 50 // we expect no lints for this in main() 54 // we expect no lints for these in main() 59 // we expect implicit_clone lints for these in main()
|
| D | blanket_clippy_restriction_lints.stderr | 4 = help: enable the restriction lints you need individually 5 = note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings` 13 = help: enable the restriction lints you need individually 21 = help: enable the restriction lints you need individually 29 = help: enable the restriction lints you need individually
|
| /third_party/rust/rust/tests/rustdoc-ui/lints/ |
| D | unknown-renamed-lints.stderr | 2 --> $DIR/unknown-renamed-lints.rs:5:9 8 --> $DIR/unknown-renamed-lints.rs:1:9 14 --> $DIR/unknown-renamed-lints.rs:7:9 20 --> $DIR/unknown-renamed-lints.rs:9:9 26 --> $DIR/unknown-renamed-lints.rs:3:9 32 --> $DIR/unknown-renamed-lints.rs:11:9 38 --> $DIR/unknown-renamed-lints.rs:13:9 44 --> $DIR/unknown-renamed-lints.rs:16:9 50 --> $DIR/unknown-renamed-lints.rs:19:9 56 --> $DIR/unknown-renamed-lints.rs:23:9
|
| /third_party/rust/rust/src/doc/rustc/src/ |
| D | SUMMARY.md | 6 - [Lints](lints/index.md) 7 - [Lint Levels](lints/levels.md) 8 - [Lint Groups](lints/groups.md) 9 - [Lint Listing](lints/listing/index.md) 10 - [Allowed-by-default Lints](lints/listing/allowed-by-default.md) 11 - [Warn-by-default Lints](lints/listing/warn-by-default.md) 12 - [Deny-by-default Lints](lints/listing/deny-by-default.md)
|
| /third_party/rust/rust/tests/ui/lint/ |
| D | lints-in-foreign-macros.stderr | 2 --> $DIR/lints-in-foreign-macros.rs:11:16 11 --> $DIR/lints-in-foreign-macros.rs:4:9 18 --> $DIR/lints-in-foreign-macros.rs:16:18 24 --> $DIR/lints-in-foreign-macros.rs:17:19 30 --> $DIR/lints-in-foreign-macros.rs:4:1 42 --> $DIR/lints-in-foreign-macros.rs:5:9 48 --> $DIR/lints-in-foreign-macros.rs:18:6 54 --> $DIR/lints-in-foreign-macros.rs:19:7
|
| /third_party/rust/rust/src/tools/clippy/book/src/development/proposals/ |
| D | roadmap-2021.md | 64 #### `lints.toml` Configuration 78 There are more and more issues about managing lints in Clippy popping up. Lints 81 to better manage lints, or improve the process of classifying lints, so that 82 disabling lints due to FPs becomes rare. It is important to note, that Clippy 83 lints are less conservative than `rustc` lints, which won't change in the 95 In the worst case, new lints are only available in nightly for 2 weeks, before 98 stable. This leads to annoyed users, that will disable these new lints in the 140 working on separate lints, a meeting adds a synchronous alternative at a known 158 #### Process for New and Existing Lints 160 As already mentioned above, classifying new lints gets quite hard, because the [all …]
|
| D | syntax-tree-patterns.md | 8 allows to describe lints using *syntax tree patterns*. 15 lints. For non-trivial lints, it often requires nested pattern matching of AST / 65 and reading lints**. 68 compiler-internal data structures. Clippy lints are currently written against 70 structures might break a lot of lints. The second goal of this RFC is to **make 71 lints independent of the compiler's AST / HIR data structures**. 75 A lot of complexity in writing lints currently seems to come from having to 112 The pattern can then be used to implement lints in the following way: 325 A lot of lints require checks that go beyond what the pattern syntax described 329 value (as needed by lints like `almost_swapped`). Instead of allowing users to [all …]
|
| /third_party/rust/rust/src/tools/clippy/clippy_lints/src/utils/internal_lints/ |
| D | metadata_collector.rs | 1 //! This lint is used to collect metadata about clippy lints. This metadata is exported as a json 43 const JSON_OUTPUT_FILE: &str = "../util/gh-pages/lints.json"; 46 /// These lints are excluded from the export. 51 /// Lints within this group will be excluded from the collection. These groups 56 /// This is the lint level for deprecated lints that will be displayed in the lint list 59 /// lint level for deprecated lints is set in `DEPRECATED_LINT_LEVEL`. 111 /// Collects metadata about clippy lints for the website. 133 … /// "docs": " ### What it does\nCollects metadata about clippy lints for the website. [...] " 139 "A busy bee collection metadata about lints" 147 /// All collected lints [all …]
|
| /third_party/rust/rust/src/tools/clippy/clippy_lints/src/utils/ |
| D | mod.rs | 27 pub lints: Vec<String>, field 41 let (lints, doc) = parse_config_field_doc(doc_comment) in new() 46 lints, in new() 57 "## `{}`\n{}\n\n**Default Value:** `{}` (`{}`)\n\n---\n**Affected lints:**\n{}\n\n", in to_markdown_paragraph() 65 self.lints in to_markdown_paragraph() 102 // Extract lints in parse_config_field_doc() 104 let lints: Vec<String> = doc_comment in parse_config_field_doc() localVariable 114 Some((lints, documentation)) in parse_config_field_doc()
|
| /third_party/rust/rust/tests/ui/lint/rfc-2383-lint-reason/ |
| D | lint-attribute-only-with-reason.stderr | 7 = note: attribute `allow` without any lints has no effect 20 = note: attribute `expect` without any lints has no effect 28 = note: attribute `warn` without any lints has no effect 33 LL | #[deny(reason = "All listed lints are denied")] 36 = note: attribute `deny` without any lints has no effect 44 = note: attribute `forbid` without any lints has no effect
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-db/src/tests/ |
| D | sourcegen_lints.rs | 46 "curl https://rust-lang.github.io/rust-clippy/master/lints.json --output {lints_json}" in sourcegen_lint_completions() 54 let destination = project_root().join("crates/ide_db/src/generated/lints.rs"); in sourcegen_lint_completions() 72 let lints = stdout[start_lints..].lines().skip(1).take_while(|l| !l.is_empty()).map(|line| { in generate_lint_descriptor() localVariable 79 let (name, lints) = line.trim().split_once(char::is_whitespace).unwrap(); in generate_lint_descriptor() 82 format!("lint group for: {}", lints.trim()).into(), in generate_lint_descriptor() 83 lints in generate_lint_descriptor() 90 let lints = lints in generate_lint_descriptor() localVariable 94 for (name, description, ..) in &lints { in generate_lint_descriptor() 99 for (name, description, children) in &lints { in generate_lint_descriptor() 128 let (name, lints) = line.trim().split_once(char::is_whitespace).unwrap(); in generate_lint_descriptor() [all …]
|
| /third_party/rust/rust/tests/rustdoc-ui/issues/ |
| D | issue-91713.stdout | 2 check_doc_test_visibility - run various visibility-related lints on doctests 10 run-lints - runs some of rustdoc's lints 20 run-lints
|