Don't emit "field expressions may not have generic arguments" if it's a method call without ()
This commit is contained in:
parent
33c245b9e9
commit
014363e89e
6 changed files with 18 additions and 17 deletions
|
@ -1369,11 +1369,14 @@ impl<'a> Parser<'a> {
|
|||
))
|
||||
} else {
|
||||
// Field access `expr.f`
|
||||
let span = lo.to(self.prev_token.span);
|
||||
if let Some(args) = seg.args {
|
||||
self.dcx().emit_err(errors::FieldExpressionWithGeneric(args.span()));
|
||||
// See `StashKey::GenericInFieldExpr` for more info on why we stash this.
|
||||
self.dcx()
|
||||
.create_err(errors::FieldExpressionWithGeneric(args.span()))
|
||||
.stash(seg.ident.span, StashKey::GenericInFieldExpr);
|
||||
}
|
||||
|
||||
let span = lo.to(self.prev_token.span);
|
||||
Ok(self.mk_expr(span, ExprKind::Field(self_arg, seg.ident)))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue