diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-15 02:35:36 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-15 12:31:50 +0300 |
| commit | a6182711efe32d4dd68da2663129e3e2e462d8cb (patch) | |
| tree | 022f678d6a426f264dc06c7847542f55b531762d /src/libsyntax_ext | |
| parent | 433b1e36e19824742175de681b8579c861217207 (diff) | |
| download | rust-a6182711efe32d4dd68da2663129e3e2e462d8cb.tar.gz rust-a6182711efe32d4dd68da2663129e3e2e462d8cb.zip | |
Remove `Spanned` from `{ast,hir}::FieldPat`
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index a454593bc65..d080dc37a92 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -187,7 +187,7 @@ use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind}; use syntax::ast::{VariantData, GenericParamKind, GenericArg}; use syntax::attr; use syntax::ext::base::{Annotatable, ExtCtxt, SpecialDerives}; -use syntax::source_map::{self, respan}; +use syntax::source_map::respan; use syntax::util::map_in_place::MapInPlace; use syntax::ptr::P; use syntax::symbol::{Symbol, kw, sym}; @@ -1610,15 +1610,13 @@ impl<'a> TraitDef<'a> { if ident.is_none() { cx.span_bug(sp, "a braced struct with unnamed fields in `derive`"); } - source_map::Spanned { + ast::FieldPat { + ident: ident.unwrap(), + is_shorthand: false, + attrs: ThinVec::new(), + id: ast::DUMMY_NODE_ID, span: pat.span.with_ctxt(self.span.ctxt()), - node: ast::FieldPat { - id: ast::DUMMY_NODE_ID, - ident: ident.unwrap(), - pat, - is_shorthand: false, - attrs: ThinVec::new(), - }, + pat, } }) .collect(); |
