mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +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;
|
||||
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 (def_id, _) in module.scope.values() {
|
||||
for def_id in module.scope.declarations() {
|
||||
let mut validator = DeclValidator::new(self.db, self.krate, self.sink);
|
||||
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