mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Fix infinite recursion when computing diagnostics for inner items
This commit is contained in:
parent
d0805c6444
commit
ebd4c8c5df
1 changed files with 14 additions and 1 deletions
|
@ -102,7 +102,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
|
||||||
let db = self.db;
|
let db = self.db;
|
||||||
for block_def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) {
|
for block_def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) {
|
||||||
for (_, module) in block_def_map.modules() {
|
for (_, module) in block_def_map.modules() {
|
||||||
for (def_id, _) in module.scope.values() {
|
for def_id in module.scope.declarations() {
|
||||||
let mut validator = DeclValidator::new(self.db, self.krate, self.sink);
|
let mut validator = DeclValidator::new(self.db, self.krate, self.sink);
|
||||||
validator.validate_item(def_id);
|
validator.validate_item(def_id);
|
||||||
}
|
}
|
||||||
|
@ -902,4 +902,17 @@ extern {
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn infinite_loop_inner_items() {
|
||||||
|
check_diagnostics(
|
||||||
|
r#"
|
||||||
|
fn qualify() {
|
||||||
|
mod foo {
|
||||||
|
use super::*;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue