@@ -63,7 +63,7 @@ impl TraitOrTraitImpl {
63
63
}
64
64
65
65
struct AstValidator < ' a > {
66
- session : & ' a Session ,
66
+ sess : & ' a Session ,
67
67
features : & ' a Features ,
68
68
69
69
/// The span of the `extern` in an `extern { ... }` block, if any.
@@ -267,7 +267,7 @@ impl<'a> AstValidator<'a> {
267
267
}
268
268
269
269
fn dcx ( & self ) -> DiagCtxtHandle < ' a > {
270
- self . session . dcx ( )
270
+ self . sess . dcx ( )
271
271
}
272
272
273
273
fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
@@ -359,7 +359,7 @@ impl<'a> AstValidator<'a> {
359
359
in_impl : matches ! ( parent, TraitOrTraitImpl :: TraitImpl { .. } ) ,
360
360
const_context_label : parent_constness,
361
361
remove_const_sugg : (
362
- self . session . source_map ( ) . span_extend_while_whitespace ( span) ,
362
+ self . sess . source_map ( ) . span_extend_while_whitespace ( span) ,
363
363
match parent_constness {
364
364
Some ( _) => rustc_errors:: Applicability :: MachineApplicable ,
365
365
None => rustc_errors:: Applicability :: MaybeIncorrect ,
@@ -472,15 +472,15 @@ impl<'a> AstValidator<'a> {
472
472
473
473
fn check_defaultness ( & self , span : Span , defaultness : Defaultness ) {
474
474
if let Defaultness :: Default ( def_span) = defaultness {
475
- let span = self . session . source_map ( ) . guess_head_span ( span) ;
475
+ let span = self . sess . source_map ( ) . guess_head_span ( span) ;
476
476
self . dcx ( ) . emit_err ( errors:: ForbiddenDefault { span, def_span } ) ;
477
477
}
478
478
}
479
479
480
480
/// If `sp` ends with a semicolon, returns it as a `Span`
481
481
/// Otherwise, returns `sp.shrink_to_hi()`
482
482
fn ending_semi_or_hi ( & self , sp : Span ) -> Span {
483
- let source_map = self . session . source_map ( ) ;
483
+ let source_map = self . sess . source_map ( ) ;
484
484
let end = source_map. end_point ( sp) ;
485
485
486
486
if source_map. span_to_snippet ( end) . is_ok_and ( |s| s == ";" ) {
@@ -552,7 +552,7 @@ impl<'a> AstValidator<'a> {
552
552
}
553
553
554
554
fn current_extern_span ( & self ) -> Span {
555
- self . session . source_map ( ) . guess_head_span ( self . extern_mod . unwrap ( ) )
555
+ self . sess . source_map ( ) . guess_head_span ( self . extern_mod . unwrap ( ) )
556
556
}
557
557
558
558
/// An `fn` in `extern { ... }` cannot have qualifiers, e.g. `async fn`.
@@ -648,7 +648,7 @@ impl<'a> AstValidator<'a> {
648
648
if ident. name . as_str ( ) . is_ascii ( ) {
649
649
return ;
650
650
}
651
- let span = self . session . source_map ( ) . guess_head_span ( item_span) ;
651
+ let span = self . sess . source_map ( ) . guess_head_span ( item_span) ;
652
652
self . dcx ( ) . emit_err ( errors:: NoMangleAscii { span } ) ;
653
653
}
654
654
@@ -753,7 +753,7 @@ impl<'a> AstValidator<'a> {
753
753
self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
754
754
} ) ;
755
755
if let Extern :: Implicit ( _) = bfty. ext {
756
- let sig_span = self . session . source_map ( ) . next_point ( ty. span . shrink_to_lo ( ) ) ;
756
+ let sig_span = self . sess . source_map ( ) . next_point ( ty. span . shrink_to_lo ( ) ) ;
757
757
self . maybe_lint_missing_abi ( sig_span, ty. id ) ;
758
758
}
759
759
}
@@ -795,7 +795,7 @@ impl<'a> AstValidator<'a> {
795
795
// FIXME(davidtwco): This is a hack to detect macros which produce spans of the
796
796
// call site which do not have a macro backtrace. See #61963.
797
797
if self
798
- . session
798
+ . sess
799
799
. source_map ( )
800
800
. span_to_snippet ( span)
801
801
. is_ok_and ( |snippet| !snippet. starts_with ( "#[" ) )
@@ -885,7 +885,7 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara
885
885
886
886
impl < ' a > Visitor < ' a > for AstValidator < ' a > {
887
887
fn visit_attribute ( & mut self , attr : & Attribute ) {
888
- validate_attr:: check_attr ( & self . session . psess , attr) ;
888
+ validate_attr:: check_attr ( & self . sess . psess , attr) ;
889
889
}
890
890
891
891
fn visit_ty ( & mut self , ty : & ' a Ty ) {
@@ -1192,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1192
1192
} else if where_clauses. after . has_where_token {
1193
1193
self . dcx ( ) . emit_err ( errors:: WhereClauseAfterTypeAlias {
1194
1194
span : where_clauses. after . span ,
1195
- help : self . session . is_nightly_build ( ) ,
1195
+ help : self . sess . is_nightly_build ( ) ,
1196
1196
} ) ;
1197
1197
}
1198
1198
}
@@ -1328,7 +1328,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1328
1328
( BoundKind :: SuperTraits , BoundConstness :: Never , BoundPolarity :: Maybe ( _) )
1329
1329
if !self . features . more_maybe_bounds =>
1330
1330
{
1331
- self . session
1331
+ self . sess
1332
1332
. create_feature_err (
1333
1333
errors:: OptionalTraitSupertrait {
1334
1334
span : trait_ref. span ,
@@ -1341,7 +1341,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1341
1341
( BoundKind :: TraitObject , BoundConstness :: Never , BoundPolarity :: Maybe ( _) )
1342
1342
if !self . features . more_maybe_bounds =>
1343
1343
{
1344
- self . session
1344
+ self . sess
1345
1345
. create_feature_err (
1346
1346
errors:: OptionalTraitObject { span : trait_ref. span } ,
1347
1347
sym:: more_maybe_bounds,
@@ -1752,13 +1752,13 @@ fn deny_equality_constraints(
1752
1752
}
1753
1753
1754
1754
pub fn check_crate (
1755
- session : & Session ,
1755
+ sess : & Session ,
1756
1756
features : & Features ,
1757
1757
krate : & Crate ,
1758
1758
lints : & mut LintBuffer ,
1759
1759
) -> bool {
1760
1760
let mut validator = AstValidator {
1761
- session ,
1761
+ sess ,
1762
1762
features,
1763
1763
extern_mod : None ,
1764
1764
outer_trait_or_trait_impl : None ,
0 commit comments