@@ -290,7 +290,7 @@ pub enum TokenKind {
290
290
/// `:`
291
291
Colon ,
292
292
/// `::`
293
- ModSep ,
293
+ PathSep ,
294
294
/// `->`
295
295
RArrow ,
296
296
/// `<-`
@@ -393,7 +393,7 @@ impl TokenKind {
393
393
BinOpEq ( Shr ) => ( Gt , Ge ) ,
394
394
DotDot => ( Dot , Dot ) ,
395
395
DotDotDot => ( Dot , DotDot ) ,
396
- ModSep => ( Colon , Colon ) ,
396
+ PathSep => ( Colon , Colon ) ,
397
397
RArrow => ( BinOp ( Minus ) , Gt ) ,
398
398
LArrow => ( Lt , BinOp ( Minus ) ) ,
399
399
FatArrow => ( Eq , Gt ) ,
@@ -454,7 +454,9 @@ impl Token {
454
454
match self . kind {
455
455
Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Not | Tilde | BinOp ( _)
456
456
| BinOpEq ( _) | At | Dot | DotDot | DotDotDot | DotDotEq | Comma | Semi | Colon
457
- | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | Question | SingleQuote => true ,
457
+ | PathSep | RArrow | LArrow | FatArrow | Pound | Dollar | Question | SingleQuote => {
458
+ true
459
+ }
458
460
459
461
OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | DocComment ( ..) | Ident ( ..)
460
462
| Lifetime ( ..) | Interpolated ( ..) | Eof => false ,
@@ -481,7 +483,7 @@ impl Token {
481
483
// DotDotDot is no longer supported, but we need some way to display the error
482
484
DotDot | DotDotDot | DotDotEq | // range notation
483
485
Lt | BinOp ( Shl ) | // associated path
484
- ModSep | // global path
486
+ PathSep | // global path
485
487
Lifetime ( ..) | // labeled loop
486
488
Pound => true , // expression attributes
487
489
Interpolated ( ref nt) => matches ! ( & nt. 0 , NtLiteral ( ..) |
@@ -507,7 +509,7 @@ impl Token {
507
509
// DotDotDot is no longer supported
508
510
| DotDot | DotDotDot | DotDotEq // ranges
509
511
| Lt | BinOp ( Shl ) // associated path
510
- | ModSep => true , // global path
512
+ | PathSep => true , // global path
511
513
Interpolated ( ref nt) => matches ! ( & nt. 0 , NtLiteral ( ..) |
512
514
NtPat ( ..) |
513
515
NtBlock ( ..) |
@@ -530,7 +532,7 @@ impl Token {
530
532
Question | // maybe bound in trait object
531
533
Lifetime ( ..) | // lifetime bound in trait object
532
534
Lt | BinOp ( Shl ) | // associated path
533
- ModSep => true , // global path
535
+ PathSep => true , // global path
534
536
Interpolated ( ref nt) => matches ! ( & nt. 0 , NtTy ( ..) | NtPath ( ..) ) ,
535
537
// For anonymous structs or unions, which only appear in specific positions
536
538
// (type of struct fields or union fields), we don't consider them as regular types
@@ -708,7 +710,7 @@ impl Token {
708
710
}
709
711
710
712
pub fn is_path_start ( & self ) -> bool {
711
- self == & ModSep
713
+ self == & PathSep
712
714
|| self . is_qpath_start ( )
713
715
|| self . is_whole_path ( )
714
716
|| self . is_path_segment_keyword ( )
@@ -821,7 +823,7 @@ impl Token {
821
823
_ => return None ,
822
824
} ,
823
825
Colon => match joint. kind {
824
- Colon => ModSep ,
826
+ Colon => PathSep ,
825
827
_ => return None ,
826
828
} ,
827
829
SingleQuote => match joint. kind {
@@ -830,7 +832,7 @@ impl Token {
830
832
} ,
831
833
832
834
Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq ( ..) | At | DotDotDot
833
- | DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar
835
+ | DotDotEq | Comma | Semi | PathSep | RArrow | LArrow | FatArrow | Pound | Dollar
834
836
| Question | OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | Ident ( ..)
835
837
| Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Eof => return None ,
836
838
} ;
0 commit comments