diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-08 14:39:58 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-16 10:59:53 +0200 |
| commit | d160a4e4225eb5e310554316cba78efb2cbe6fa2 (patch) | |
| tree | 393f8bc408372eea7350331ed4bd60c7c3411f26 /src/libsyntax/parse/parser/ty.rs | |
| parent | 7ec38a9ae3c5e7b8eef0ec4696d058cd9e85583d (diff) | |
| download | rust-d160a4e4225eb5e310554316cba78efb2cbe6fa2.tar.gz rust-d160a4e4225eb5e310554316cba78efb2cbe6fa2.zip | |
syntax::parse: don't depend on syntax::ext
Diffstat (limited to 'src/libsyntax/parse/parser/ty.rs')
| -rw-r--r-- | src/libsyntax/parse/parser/ty.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index fe18a08ae1e..ae9f4d06c05 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -210,7 +210,7 @@ impl<'a> Parser<'a> { }; let span = lo.to(self.prev_span); - let ty = P(Ty { kind, span, id: ast::DUMMY_NODE_ID }); + let ty = self.mk_ty(span, kind); // Try to recover from use of `+` with incorrect priority. self.maybe_report_ambiguous_plus(allow_plus, impl_dyn_multi, &ty); @@ -448,4 +448,8 @@ impl<'a> Parser<'a> { self.span_bug(self.token.span, "not a lifetime") } } + + pub(super) fn mk_ty(&self, span: Span, kind: TyKind) -> P<Ty> { + P(Ty { kind, span, id: ast::DUMMY_NODE_ID }) + } } |
