Rollup merge of #138460 - xizheyin:issue-138319, r=petrochenkov
Pass struct field HirId when check_expr_struct_fields Fixes #138319 r? compiler cc ``@Mark-Simulacrum``
This commit is contained in:
commit
43c41a801a
6 changed files with 74 additions and 3 deletions
|
@ -2060,7 +2060,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
// struct-like enums (yet...), but it's definitely not
|
||||
// a bug to have constructed one.
|
||||
if adt_kind != AdtKind::Enum {
|
||||
tcx.check_stability(v_field.did, Some(expr.hir_id), field.span, None);
|
||||
tcx.check_stability(v_field.did, Some(field.hir_id), field.span, None);
|
||||
}
|
||||
|
||||
self.field_ty(field.span, v_field, args)
|
||||
|
|
|
@ -1422,7 +1422,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
self.tcx.check_stability(
|
||||
variant.fields[FieldIdx::from_usize(i)].did,
|
||||
Some(pat.hir_id),
|
||||
Some(subpat.hir_id),
|
||||
subpat.span,
|
||||
None,
|
||||
);
|
||||
|
@ -1686,7 +1686,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
.get(&ident)
|
||||
.map(|(i, f)| {
|
||||
self.write_field_index(field.hir_id, *i);
|
||||
self.tcx.check_stability(f.did, Some(pat.hir_id), span, None);
|
||||
self.tcx.check_stability(f.did, Some(field.hir_id), span, None);
|
||||
self.field_ty(span, f, args)
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue