mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-18 19:21:38 +00:00
Handle missing fields diagnostics
This commit is contained in:
parent
7de0b2e75a
commit
e6a103ae50
11 changed files with 59 additions and 12 deletions
|
|
@ -319,8 +319,9 @@ impl<'a> Ctx<'a> {
|
|||
};
|
||||
let visibility = self.lower_visibility(field);
|
||||
let type_ref = TypeRef::from_ast_opt(body_ctx, field.ty());
|
||||
let has_default = field.expr().is_some();
|
||||
|
||||
Field { name, type_ref, visibility }
|
||||
Field { name, type_ref, visibility, has_default }
|
||||
}
|
||||
|
||||
fn lower_tuple_field(
|
||||
|
|
@ -332,7 +333,7 @@ impl<'a> Ctx<'a> {
|
|||
let name = Name::new_tuple_field(idx);
|
||||
let visibility = self.lower_visibility(field);
|
||||
let type_ref = TypeRef::from_ast_opt(body_ctx, field.ty());
|
||||
Field { name, type_ref, visibility }
|
||||
Field { name, type_ref, visibility, has_default: false }
|
||||
}
|
||||
|
||||
fn lower_union(&mut self, union: &ast::Union) -> Option<FileItemTreeId<Union>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue