aboutsummaryrefslogtreecommitdiff
path: root/docs/user/generated_diagnostic.adoc
blob: ec45d0c2b8fb861d8af5667e888c2591815525e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//Generated file, do not edit by hand, see `xtask/src/codegen`
=== break-outside-of-loop
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L219[diagnostics.rs]

This diagnostic is triggered if `break` keyword is used outside of a loop.


=== incorrect-ident-case
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L319[diagnostics.rs]

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].


=== mismatched-arg-count
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L267[diagnostics.rs]

This diagnostic is triggered if function is invoked with an incorrect amount of arguments.


=== missing-match-arm
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L162[diagnostics.rs]

This diagnostic is triggered if `match` block is missing one or more match arms.


=== missing-ok-in-tail-expr
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L187[diagnostics.rs]

This diagnostic is triggered if block that should return `Result` returns a value not wrapped in `Ok`.

Example:

```rust
fn foo() -> Result<u8, ()> {
    10
}
```


=== missing-pat-fields
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L113[diagnostics.rs]

This diagnostic is triggered if pattern lacks some fields that exist in the corresponding structure.

Example:

```rust
struct A { a: u8, b: u8 }

let a = A { a: 10, b: 20 };

if let A { a } = a {
    // ...
}
```


=== missing-structure-fields
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L66[diagnostics.rs]

This diagnostic is triggered if record lacks some fields that exist in the corresponding structure.

Example:

```rust
struct A { a: u8, b: u8 }

let a = A { a: 10 };
```


=== missing-unsafe
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L243[diagnostics.rs]

This diagnostic is triggered if operation marked as `unsafe` is used outside of `unsafe` function or block.


=== no-such-field
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L39[diagnostics.rs]

This diagnostic is triggered if created structure does not have field provided in record.


=== unconfigured-code
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L90[diagnostics.rs]

This diagnostic is shown for code with inactive `#[cfg]` attributes.


=== unresolved-extern-crate
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L35[diagnostics.rs]

This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate.


=== unresolved-import
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L59[diagnostics.rs]

This diagnostic is triggered if rust-analyzer is unable to discover imported module.


=== unresolved-module
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L10[diagnostics.rs]

This diagnostic is triggered if rust-analyzer is unable to discover referred module.