diff options
author | Benjamin Coenen <[email protected]> | 2020-10-20 20:29:31 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-10-20 20:29:31 +0100 |
commit | aa031e91f4f809933eb967edda256ebf6b8bf4ea (patch) | |
tree | c78e34fbda9795c0671c71661a6c63faaf596a3b /docs | |
parent | c00339509d27061f77dac5eef33335095afea8ec (diff) |
add completions for clippy lint in attributes
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/generated_diagnostic.adoc | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/docs/user/generated_diagnostic.adoc b/docs/user/generated_diagnostic.adoc new file mode 100644 index 000000000..ec45d0c2b --- /dev/null +++ b/docs/user/generated_diagnostic.adoc | |||
@@ -0,0 +1,105 @@ | |||
1 | //Generated file, do not edit by hand, see `xtask/src/codegen` | ||
2 | === break-outside-of-loop | ||
3 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L219[diagnostics.rs] | ||
4 | |||
5 | This diagnostic is triggered if `break` keyword is used outside of a loop. | ||
6 | |||
7 | |||
8 | === incorrect-ident-case | ||
9 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L319[diagnostics.rs] | ||
10 | |||
11 | This diagnostic is triggered if item name doesn't follow https://doc.rust-lang.org/1.0.0/style/style/naming/README.html[Rust naming convention]. | ||
12 | |||
13 | |||
14 | === mismatched-arg-count | ||
15 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L267[diagnostics.rs] | ||
16 | |||
17 | This diagnostic is triggered if function is invoked with an incorrect amount of arguments. | ||
18 | |||
19 | |||
20 | === missing-match-arm | ||
21 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L162[diagnostics.rs] | ||
22 | |||
23 | This diagnostic is triggered if `match` block is missing one or more match arms. | ||
24 | |||
25 | |||
26 | === missing-ok-in-tail-expr | ||
27 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L187[diagnostics.rs] | ||
28 | |||
29 | This diagnostic is triggered if block that should return `Result` returns a value not wrapped in `Ok`. | ||
30 | |||
31 | Example: | ||
32 | |||
33 | ```rust | ||
34 | fn foo() -> Result<u8, ()> { | ||
35 | 10 | ||
36 | } | ||
37 | ``` | ||
38 | |||
39 | |||
40 | === missing-pat-fields | ||
41 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L113[diagnostics.rs] | ||
42 | |||
43 | This diagnostic is triggered if pattern lacks some fields that exist in the corresponding structure. | ||
44 | |||
45 | Example: | ||
46 | |||
47 | ```rust | ||
48 | struct A { a: u8, b: u8 } | ||
49 | |||
50 | let a = A { a: 10, b: 20 }; | ||
51 | |||
52 | if let A { a } = a { | ||
53 | // ... | ||
54 | } | ||
55 | ``` | ||
56 | |||
57 | |||
58 | === missing-structure-fields | ||
59 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L66[diagnostics.rs] | ||
60 | |||
61 | This diagnostic is triggered if record lacks some fields that exist in the corresponding structure. | ||
62 | |||
63 | Example: | ||
64 | |||
65 | ```rust | ||
66 | struct A { a: u8, b: u8 } | ||
67 | |||
68 | let a = A { a: 10 }; | ||
69 | ``` | ||
70 | |||
71 | |||
72 | === missing-unsafe | ||
73 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L243[diagnostics.rs] | ||
74 | |||
75 | This diagnostic is triggered if operation marked as `unsafe` is used outside of `unsafe` function or block. | ||
76 | |||
77 | |||
78 | === no-such-field | ||
79 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L39[diagnostics.rs] | ||
80 | |||
81 | This diagnostic is triggered if created structure does not have field provided in record. | ||
82 | |||
83 | |||
84 | === unconfigured-code | ||
85 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L90[diagnostics.rs] | ||
86 | |||
87 | This diagnostic is shown for code with inactive `#[cfg]` attributes. | ||
88 | |||
89 | |||
90 | === unresolved-extern-crate | ||
91 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L35[diagnostics.rs] | ||
92 | |||
93 | This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate. | ||
94 | |||
95 | |||
96 | === unresolved-import | ||
97 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L59[diagnostics.rs] | ||
98 | |||
99 | This diagnostic is triggered if rust-analyzer is unable to discover imported module. | ||
100 | |||
101 | |||
102 | === unresolved-module | ||
103 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L10[diagnostics.rs] | ||
104 | |||
105 | This diagnostic is triggered if rust-analyzer is unable to discover referred module. | ||