|
1 | 1 | use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser};
|
2 | 2 |
|
3 |
| -use syntax::ast::{ |
4 |
| - self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind, |
5 |
| - Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, |
6 |
| -}; |
| 3 | +use rustc_data_structures::fx::FxHashSet; |
| 4 | +use rustc_errors::{self, PResult, Applicability, DiagnosticBuilder, Handler, pluralize}; |
| 5 | +use rustc_error_codes::*; |
| 6 | +use syntax::ast::{self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item}; |
| 7 | +use syntax::ast::{ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind}; |
7 | 8 | use syntax::token::{self, TokenKind, token_can_begin_expr};
|
8 | 9 | use syntax::print::pprust;
|
9 | 10 | use syntax::ptr::P;
|
10 |
| -use syntax::symbol::{kw, sym}; |
11 | 11 | use syntax::ThinVec;
|
12 | 12 | use syntax::util::parser::AssocOp;
|
13 | 13 | use syntax::struct_span_err;
|
14 |
| - |
15 |
| -use errors::{PResult, Applicability, DiagnosticBuilder, pluralize}; |
16 |
| -use rustc_data_structures::fx::FxHashSet; |
| 14 | +use syntax_pos::symbol::{kw, sym}; |
17 | 15 | use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError};
|
| 16 | + |
18 | 17 | use log::{debug, trace};
|
19 | 18 | use std::mem;
|
20 | 19 |
|
21 |
| -use rustc_error_codes::*; |
22 |
| - |
23 | 20 | const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments";
|
24 | 21 |
|
25 | 22 | /// Creates a placeholder argument.
|
@@ -61,10 +58,10 @@ pub enum Error {
|
61 | 58 | }
|
62 | 59 |
|
63 | 60 | impl Error {
|
64 |
| - fn span_err<S: Into<MultiSpan>>( |
| 61 | + fn span_err( |
65 | 62 | self,
|
66 |
| - sp: S, |
67 |
| - handler: &errors::Handler, |
| 63 | + sp: impl Into<MultiSpan>, |
| 64 | + handler: &Handler, |
68 | 65 | ) -> DiagnosticBuilder<'_> {
|
69 | 66 | match self {
|
70 | 67 | Error::FileNotFoundForModule {
|
@@ -212,7 +209,7 @@ impl<'a> Parser<'a> {
|
212 | 209 | self.sess.span_diagnostic.span_bug(sp, m)
|
213 | 210 | }
|
214 | 211 |
|
215 |
| - pub(super) fn diagnostic(&self) -> &'a errors::Handler { |
| 212 | + pub(super) fn diagnostic(&self) -> &'a Handler { |
216 | 213 | &self.sess.span_diagnostic
|
217 | 214 | }
|
218 | 215 |
|
|
0 commit comments