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 /crates/hir | |
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 'crates/hir')
-rw-r--r-- | crates/hir/src/code_model.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 7f169ccd2..864f9c0c8 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -781,6 +781,7 @@ impl Function { | |||
781 | } | 781 | } |
782 | 782 | ||
783 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { | 783 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { |
784 | hir_def::diagnostics::validate_body(db.upcast(), self.id.into(), sink); | ||
784 | hir_ty::diagnostics::validate_module_item(db, self.id.into(), sink); | 785 | hir_ty::diagnostics::validate_module_item(db, self.id.into(), sink); |
785 | hir_ty::diagnostics::validate_body(db, self.id.into(), sink); | 786 | hir_ty::diagnostics::validate_body(db, self.id.into(), sink); |
786 | } | 787 | } |