1
Fork 0

Add a lint for not using field pattern shorthands

Closes #17792.
This commit is contained in:
P1start 2014-10-06 13:36:53 +13:00
parent 56d544f7ad
commit ead6c4b9d4
53 changed files with 266 additions and 203 deletions

View file

@ -169,7 +169,7 @@ pub trait AstBuilder {
bm: ast::BindingMode) -> P<ast::Pat>;
fn pat_enum(&self, span: Span, path: ast::Path, subpats: Vec<P<ast::Pat>> ) -> P<ast::Pat>;
fn pat_struct(&self, span: Span,
path: ast::Path, field_pats: Vec<ast::FieldPat> ) -> P<ast::Pat>;
path: ast::Path, field_pats: Vec<Spanned<ast::FieldPat>> ) -> P<ast::Pat>;
fn pat_tuple(&self, span: Span, pats: Vec<P<ast::Pat>>) -> P<ast::Pat>;
fn pat_some(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat>;
@ -796,7 +796,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
self.pat(span, pat)
}
fn pat_struct(&self, span: Span,
path: ast::Path, field_pats: Vec<ast::FieldPat>) -> P<ast::Pat> {
path: ast::Path, field_pats: Vec<Spanned<ast::FieldPat>>) -> P<ast::Pat> {
let pat = ast::PatStruct(path, field_pats, false);
self.pat(span, pat)
}