diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-15 14:34:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-15 14:34:10 +0200 |
| commit | 6e8fabb4ac16b30c98968b768b860d2c2e1583d8 (patch) | |
| tree | 97262d6fe68846bffd0ebdb303403b4da9ed4ee1 /src/libsyntax/parse/parser/ty.rs | |
| parent | 19d6178b8f44a8bee56b45df07116a6d490eb7d1 (diff) | |
| parent | a6182711efe32d4dd68da2663129e3e2e462d8cb (diff) | |
| download | rust-6e8fabb4ac16b30c98968b768b860d2c2e1583d8.tar.gz rust-6e8fabb4ac16b30c98968b768b860d2c2e1583d8.zip | |
Rollup merge of #63586 - petrochenkov:nospanned, r=eddyb
cleanup: Remove `Spanned` where possible It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.
Diffstat (limited to 'src/libsyntax/parse/parser/ty.rs')
| -rw-r--r-- | src/libsyntax/parse/parser/ty.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index 1eb3d441e69..337702b8d30 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -4,9 +4,9 @@ use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath}; use crate::ptr::P; use crate::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident}; use crate::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef}; -use crate::ast::{Mutability, AnonConst, FnDecl, Mac_}; +use crate::ast::{Mutability, AnonConst, FnDecl, Mac}; use crate::parse::token::{self, Token}; -use crate::source_map::{respan, Span}; +use crate::source_map::Span; use crate::symbol::{kw}; use rustc_target::spec::abi::Abi; @@ -175,13 +175,14 @@ impl<'a> Parser<'a> { if self.eat(&token::Not) { // Macro invocation in type position let (delim, tts) = self.expect_delimited_token_tree()?; - let node = Mac_ { + let mac = Mac { path, tts, delim, + span: lo.to(self.prev_span), prior_type_ascription: self.last_type_ascription, }; - TyKind::Mac(respan(lo.to(self.prev_span), node)) + TyKind::Mac(mac) } else { // Just a type path or bound list (trait object type) starting with a trait. // `Type` |
