@@ -337,7 +337,7 @@ enum Class {
337
337
Ident ( Span ) ,
338
338
Lifetime ,
339
339
PreludeTy ( Span ) ,
340
- PreludeVal ,
340
+ PreludeVal ( Span ) ,
341
341
QuestionMark ,
342
342
Decoration ( & ' static str ) ,
343
343
}
@@ -385,7 +385,7 @@ impl Class {
385
385
Class :: Ident ( _) => "" ,
386
386
Class :: Lifetime => "lifetime" ,
387
387
Class :: PreludeTy ( _) => "prelude-ty" ,
388
- Class :: PreludeVal => "prelude-val" ,
388
+ Class :: PreludeVal ( _ ) => "prelude-val" ,
389
389
Class :: QuestionMark => "question-mark" ,
390
390
Class :: Decoration ( kind) => kind,
391
391
}
@@ -395,7 +395,11 @@ impl Class {
395
395
/// a "span" (a tuple representing `(lo, hi)` equivalent of `Span`).
396
396
fn get_span ( self ) -> Option < Span > {
397
397
match self {
398
- Self :: Ident ( sp) | Self :: Self_ ( sp) | Self :: Macro ( sp) | Self :: PreludeTy ( sp) => Some ( sp) ,
398
+ Self :: Ident ( sp)
399
+ | Self :: Self_ ( sp)
400
+ | Self :: Macro ( sp)
401
+ | Self :: PreludeTy ( sp)
402
+ | Self :: PreludeVal ( sp) => Some ( sp) ,
399
403
Self :: Comment
400
404
| Self :: DocComment
401
405
| Self :: Attribute
@@ -406,7 +410,6 @@ impl Class {
406
410
| Self :: Number
407
411
| Self :: Bool
408
412
| Self :: Lifetime
409
- | Self :: PreludeVal
410
413
| Self :: QuestionMark
411
414
| Self :: Decoration ( _) => None ,
412
415
}
@@ -851,7 +854,9 @@ impl<'src> Classifier<'src> {
851
854
TokenKind :: Ident => match get_real_ident_class ( text, false ) {
852
855
None => match text {
853
856
"Option" | "Result" => Class :: PreludeTy ( self . new_span ( before, text) ) ,
854
- "Some" | "None" | "Ok" | "Err" => Class :: PreludeVal ,
857
+ "Some" | "None" | "Ok" | "Err" => {
858
+ Class :: PreludeVal ( self . new_span ( before, text) )
859
+ }
855
860
// "union" is a weak keyword and is only considered as a keyword when declaring
856
861
// a union type.
857
862
"union" if self . check_if_is_union_keyword ( ) => Class :: KeyWord ,
0 commit comments