Use field ident spans directly instead of the full field span in diagnostics on local fields
This commit is contained in:
parent
28cc0b643d
commit
8c2ea715e9
9 changed files with 49 additions and 45 deletions
|
@ -1726,11 +1726,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
)) = binding.kind
|
||||
{
|
||||
let def_id = self.tcx.parent(ctor_def_id);
|
||||
return self
|
||||
.field_def_ids(def_id)?
|
||||
.iter()
|
||||
.map(|&field_id| self.def_span(field_id))
|
||||
.reduce(Span::to); // None for `struct Foo()`
|
||||
return self.field_idents(def_id)?.iter().map(|&f| f.span).reduce(Span::to); // None for `struct Foo()`
|
||||
}
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue