@@ -101,8 +101,6 @@ pub struct Parser<'a> {
101101 /// Use this if you need to check for `token::Ident` or `token::Lifetime` specifically,
102102 /// this also includes edition checks for edition-specific keyword identifiers.
103103 pub normalized_prev_token : Token ,
104- /// FIXME: Remove in favor of the equivalent `prev_token.span`.
105- pub prev_span : Span ,
106104 restrictions : Restrictions ,
107105 /// Used to determine the path to externally loaded source files.
108106 pub ( super ) directory : Directory ,
@@ -377,7 +375,6 @@ impl<'a> Parser<'a> {
377375 normalized_token : Token :: dummy ( ) ,
378376 prev_token : Token :: dummy ( ) ,
379377 normalized_prev_token : Token :: dummy ( ) ,
380- prev_span : DUMMY_SP ,
381378 restrictions : Restrictions :: empty ( ) ,
382379 recurse_into_file_modules,
383380 directory : Directory {
@@ -848,9 +845,6 @@ impl<'a> Parser<'a> {
848845 self . normalized_prev_token = self . normalized_token . take ( ) ;
849846 self . set_token ( next_token) ;
850847
851- // Update fields derived from the previous token.
852- self . prev_span = self . prev_token . span ;
853-
854848 // Diagnostics.
855849 self . expected_tokens . clear ( ) ;
856850 }
@@ -897,12 +891,20 @@ impl<'a> Parser<'a> {
897891
898892 /// Parses unsafety: `unsafe` or nothing.
899893 fn parse_unsafety ( & mut self ) -> Unsafe {
900- if self . eat_keyword ( kw:: Unsafe ) { Unsafe :: Yes ( self . prev_span ) } else { Unsafe :: No }
894+ if self . eat_keyword ( kw:: Unsafe ) {
895+ Unsafe :: Yes ( self . normalized_prev_token . span )
896+ } else {
897+ Unsafe :: No
898+ }
901899 }
902900
903901 /// Parses constness: `const` or nothing.
904902 fn parse_constness ( & mut self ) -> Const {
905- if self . eat_keyword ( kw:: Const ) { Const :: Yes ( self . prev_span ) } else { Const :: No }
903+ if self . eat_keyword ( kw:: Const ) {
904+ Const :: Yes ( self . normalized_prev_token . span )
905+ } else {
906+ Const :: No
907+ }
906908 }
907909
908910 /// Parses mutability (`mut` or nothing).
0 commit comments