Fix infinite recursion when computing diagnostics for inner items
This commit is contained in:
parent
d0805c6444
commit
ebd4c8c5df
@ -102,7 +102,7 @@ fn validate_func(&mut self, func: FunctionId) {
|
||||
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 @@ fn ignores_extern_items() {
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infinite_loop_inner_items() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn qualify() {
|
||||
mod foo {
|
||||
use super::*;
|
||||
}
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user