@@ -333,7 +333,7 @@ enum Class {
333
333
/// `Ident` isn't rendered in the HTML but we still need it for the `Span` it contains.
334
334
Ident ( Span ) ,
335
335
Lifetime ,
336
- PreludeTy ,
336
+ PreludeTy ( Span ) ,
337
337
PreludeVal ,
338
338
QuestionMark ,
339
339
Decoration ( & ' static str ) ,
@@ -381,7 +381,7 @@ impl Class {
381
381
Class :: Bool => "bool-val" ,
382
382
Class :: Ident ( _) => "" ,
383
383
Class :: Lifetime => "lifetime" ,
384
- Class :: PreludeTy => "prelude-ty" ,
384
+ Class :: PreludeTy ( _ ) => "prelude-ty" ,
385
385
Class :: PreludeVal => "prelude-val" ,
386
386
Class :: QuestionMark => "question-mark" ,
387
387
Class :: Decoration ( kind) => kind,
@@ -392,7 +392,7 @@ impl Class {
392
392
/// a "span" (a tuple representing `(lo, hi)` equivalent of `Span`).
393
393
fn get_span ( self ) -> Option < Span > {
394
394
match self {
395
- Self :: Ident ( sp) | Self :: Self_ ( sp) | Self :: Macro ( sp) => Some ( sp) ,
395
+ Self :: Ident ( sp) | Self :: Self_ ( sp) | Self :: Macro ( sp) | Self :: PreludeTy ( sp ) => Some ( sp) ,
396
396
Self :: Comment
397
397
| Self :: DocComment
398
398
| Self :: Attribute
@@ -403,7 +403,6 @@ impl Class {
403
403
| Self :: Number
404
404
| Self :: Bool
405
405
| Self :: Lifetime
406
- | Self :: PreludeTy
407
406
| Self :: PreludeVal
408
407
| Self :: QuestionMark
409
408
| Self :: Decoration ( _) => None ,
@@ -847,7 +846,7 @@ impl<'src> Classifier<'src> {
847
846
}
848
847
TokenKind :: Ident => match get_real_ident_class ( text, false ) {
849
848
None => match text {
850
- "Option" | "Result" => Class :: PreludeTy ,
849
+ "Option" | "Result" => Class :: PreludeTy ( self . new_span ( before , text ) ) ,
851
850
"Some" | "None" | "Ok" | "Err" => Class :: PreludeVal ,
852
851
// "union" is a weak keyword and is only considered as a keyword when declaring
853
852
// a union type.
0 commit comments