diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-23 23:05:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-23 23:05:25 +0100 |
commit | c483212f274e9a5e348451cd4bbd0487e172458b (patch) | |
tree | dcb279acf2cd6262ede408615a4b3f9bed8098fc /docs/user | |
parent | ea25ae614b21237c4a536304da875bdc29f0c65a (diff) | |
parent | 5350c15e27bfb85d2e7ae3eae0e624197f2b9a70 (diff) |
Merge #6339
6339: Diagnose #[cfg]s in bodies r=matklad a=jonas-schievink
This PR threads diagnostics through body lowering using the `BodySourceMap`, and emits `InactiveCode` diagnostics for expressions, statements, and match arms that are `#[cfg]`d out.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/generated_diagnostic.adoc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/user/generated_diagnostic.adoc b/docs/user/generated_diagnostic.adoc index ec45d0c2b..34c4f98a3 100644 --- a/docs/user/generated_diagnostic.adoc +++ b/docs/user/generated_diagnostic.adoc | |||
@@ -5,6 +5,12 @@ | |||
5 | This diagnostic is triggered if `break` keyword is used outside of a loop. | 5 | This diagnostic is triggered if `break` keyword is used outside of a loop. |
6 | 6 | ||
7 | 7 | ||
8 | === inactive-code | ||
9 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L98[diagnostics.rs] | ||
10 | |||
11 | This diagnostic is shown for code with inactive `#[cfg]` attributes. | ||
12 | |||
13 | |||
8 | === incorrect-ident-case | 14 | === incorrect-ident-case |
9 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L319[diagnostics.rs] | 15 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L319[diagnostics.rs] |
10 | 16 | ||
@@ -81,25 +87,19 @@ This diagnostic is triggered if operation marked as `unsafe` is used outside of | |||
81 | This diagnostic is triggered if created structure does not have field provided in record. | 87 | This diagnostic is triggered if created structure does not have field provided in record. |
82 | 88 | ||
83 | 89 | ||
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 | 90 | === unresolved-extern-crate |
91 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L35[diagnostics.rs] | 91 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L43[diagnostics.rs] |
92 | 92 | ||
93 | This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate. | 93 | This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate. |
94 | 94 | ||
95 | 95 | ||
96 | === unresolved-import | 96 | === unresolved-import |
97 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L59[diagnostics.rs] | 97 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L67[diagnostics.rs] |
98 | 98 | ||
99 | This diagnostic is triggered if rust-analyzer is unable to discover imported module. | 99 | This diagnostic is triggered if rust-analyzer is unable to discover imported module. |
100 | 100 | ||
101 | 101 | ||
102 | === unresolved-module | 102 | === unresolved-module |
103 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L10[diagnostics.rs] | 103 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L18[diagnostics.rs] |
104 | 104 | ||
105 | This diagnostic is triggered if rust-analyzer is unable to discover referred module. | 105 | This diagnostic is triggered if rust-analyzer is unable to discover referred module. |