diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-18 19:16:05 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-18 19:16:05 +0000 |
commit | f57ce6f5588fe62da6eab7a9ad3a3d06a9cd2ac0 (patch) | |
tree | a0a23c8c03c224578ecb910e129742123d230844 /crates/hir_ty | |
parent | 017dd0b45a5d89eca58458fa7d2cc712019402cc (diff) | |
parent | ebd4c8c5dfd07b27f0cd083bc34b619ede3a6678 (diff) |
Merge #8094
8094: Fix infinite recursion when computing diagnostics for inner items r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/diagnostics/decl_check.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/hir_ty/src/diagnostics/decl_check.rs b/crates/hir_ty/src/diagnostics/decl_check.rs index bfe239793..33a0f4d7d 100644 --- a/crates/hir_ty/src/diagnostics/decl_check.rs +++ b/crates/hir_ty/src/diagnostics/decl_check.rs | |||
@@ -102,7 +102,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> { | |||
102 | let db = self.db; | 102 | let db = self.db; |
103 | for block_def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) { | 103 | for block_def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) { |
104 | for (_, module) in block_def_map.modules() { | 104 | for (_, module) in block_def_map.modules() { |
105 | for (def_id, _) in module.scope.values() { | 105 | for def_id in module.scope.declarations() { |
106 | let mut validator = DeclValidator::new(self.db, self.krate, self.sink); | 106 | let mut validator = DeclValidator::new(self.db, self.krate, self.sink); |
107 | validator.validate_item(def_id); | 107 | validator.validate_item(def_id); |
108 | } | 108 | } |
@@ -902,4 +902,17 @@ extern { | |||
902 | "#, | 902 | "#, |
903 | ); | 903 | ); |
904 | } | 904 | } |
905 | |||
906 | #[test] | ||
907 | fn infinite_loop_inner_items() { | ||
908 | check_diagnostics( | ||
909 | r#" | ||
910 | fn qualify() { | ||
911 | mod foo { | ||
912 | use super::*; | ||
913 | } | ||
914 | } | ||
915 | "#, | ||
916 | ) | ||
917 | } | ||
905 | } | 918 | } |