Refactor and re-use BindingAnnotation
This commit is contained in:
@@ -10,9 +10,9 @@ use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, Delimiter, Lit, LitKind, TokenKind};
|
||||
use rustc_ast::util::parser::AssocOp;
|
||||
use rustc_ast::{
|
||||
AngleBracketedArg, AngleBracketedArgs, AnonConst, AttrVec, BinOpKind, BindingMode, Block,
|
||||
BlockCheckMode, Expr, ExprKind, GenericArg, Generics, Item, ItemKind, Mutability, Param, Pat,
|
||||
PatKind, Path, PathSegment, QSelf, Ty, TyKind,
|
||||
AngleBracketedArg, AngleBracketedArgs, AnonConst, AttrVec, BinOpKind, BindingAnnotation, Block,
|
||||
BlockCheckMode, Expr, ExprKind, GenericArg, Generics, Item, ItemKind, Param, Pat, PatKind,
|
||||
Path, PathSegment, QSelf, Ty, TyKind,
|
||||
};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
@@ -37,7 +37,7 @@ const TURBOFISH_SUGGESTION_STR: &str =
|
||||
pub(super) fn dummy_arg(ident: Ident) -> Param {
|
||||
let pat = P(Pat {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
kind: PatKind::Ident(BindingMode::ByValue(Mutability::Not), ident, None),
|
||||
kind: PatKind::Ident(BindingAnnotation::NONE, ident, None),
|
||||
span: ident.span,
|
||||
tokens: None,
|
||||
});
|
||||
@@ -2961,7 +2961,7 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
PatKind::Ident(BindingMode::ByValue(Mutability::Not), ident, None) => {
|
||||
PatKind::Ident(BindingAnnotation::NONE, ident, None) => {
|
||||
match &first_pat.kind {
|
||||
PatKind::Ident(_, old_ident, _) => {
|
||||
let path = PatKind::Path(
|
||||
|
||||
Reference in New Issue
Block a user