@@ -63,7 +63,7 @@ impl TraitOrTraitImpl {
6363}
6464
6565struct AstValidator < ' a > {
66- session : & ' a Session ,
66+ sess : & ' a Session ,
6767features : & ' a Features ,
6868
6969/// The span of the `extern` in an `extern { ... }` block, if any.
@@ -267,7 +267,7 @@ impl<'a> AstValidator<'a> {
267267}
268268
269269fn dcx ( & self ) -> DiagCtxtHandle < ' a > {
270- self . session . dcx ( )
270+ self . sess . dcx ( )
271271}
272272
273273fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
@@ -359,7 +359,7 @@ impl<'a> AstValidator<'a> {
359359in_impl : matches ! ( parent, TraitOrTraitImpl :: TraitImpl { .. } ) ,
360360const_context_label : parent_constness,
361361remove_const_sugg : (
362- self . session . source_map ( ) . span_extend_while_whitespace ( span) ,
362+ self . sess . source_map ( ) . span_extend_while_whitespace ( span) ,
363363match parent_constness {
364364Some ( _) => rustc_errors:: Applicability :: MachineApplicable ,
365365None => rustc_errors:: Applicability :: MaybeIncorrect ,
@@ -472,15 +472,15 @@ impl<'a> AstValidator<'a> {
472472
473473fn check_defaultness ( & self , span : Span , defaultness : Defaultness ) {
474474if 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) ;
476476self . dcx ( ) . emit_err ( errors:: ForbiddenDefault { span, def_span } ) ;
477477}
478478}
479479
480480/// If `sp` ends with a semicolon, returns it as a `Span`
481481/// Otherwise, returns `sp.shrink_to_hi()`
482482fn ending_semi_or_hi ( & self , sp : Span ) -> Span {
483- let source_map = self . session . source_map ( ) ;
483+ let source_map = self . sess . source_map ( ) ;
484484let end = source_map. end_point ( sp) ;
485485
486486if source_map. span_to_snippet ( end) . is_ok_and ( |s| s == ";" ) {
@@ -552,7 +552,7 @@ impl<'a> AstValidator<'a> {
552552}
553553
554554fn 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 ( ) )
556556}
557557
558558/// An `fn` in `extern { ... }` cannot have qualifiers, e.g. `async fn`.
@@ -648,7 +648,7 @@ impl<'a> AstValidator<'a> {
648648if ident. name . as_str ( ) . is_ascii ( ) {
649649return ;
650650}
651- let span = self . session . source_map ( ) . guess_head_span ( item_span) ;
651+ let span = self . sess . source_map ( ) . guess_head_span ( item_span) ;
652652self . dcx ( ) . emit_err ( errors:: NoMangleAscii { span } ) ;
653653}
654654
@@ -753,7 +753,7 @@ impl<'a> AstValidator<'a> {
753753self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
754754} ) ;
755755if 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 ( ) ) ;
757757self . maybe_lint_missing_abi ( sig_span, ty. id ) ;
758758}
759759}
@@ -795,7 +795,7 @@ impl<'a> AstValidator<'a> {
795795// FIXME(davidtwco): This is a hack to detect macros which produce spans of the
796796// call site which do not have a macro backtrace. See #61963.
797797if self
798- . session
798+ . sess
799799. source_map ( )
800800. span_to_snippet ( span)
801801. is_ok_and ( |snippet| !snippet. starts_with ( "#[" ) )
@@ -885,7 +885,7 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara
885885
886886impl < ' a > Visitor < ' a > for AstValidator < ' a > {
887887fn visit_attribute ( & mut self , attr : & Attribute ) {
888- validate_attr:: check_attr ( & self . session . psess , attr) ;
888+ validate_attr:: check_attr ( & self . sess . psess , attr) ;
889889}
890890
891891fn visit_ty ( & mut self , ty : & ' a Ty ) {
@@ -1192,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11921192} else if where_clauses. after . has_where_token {
11931193self . dcx ( ) . emit_err ( errors:: WhereClauseAfterTypeAlias {
11941194span : where_clauses. after . span ,
1195- help : self . session . is_nightly_build ( ) ,
1195+ help : self . sess . is_nightly_build ( ) ,
11961196} ) ;
11971197}
11981198}
@@ -1328,7 +1328,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13281328( BoundKind :: SuperTraits , BoundConstness :: Never , BoundPolarity :: Maybe ( _) )
13291329if !self . features . more_maybe_bounds =>
13301330{
1331- self . session
1331+ self . sess
13321332. create_feature_err (
13331333 errors:: OptionalTraitSupertrait {
13341334span : trait_ref. span ,
@@ -1341,7 +1341,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13411341( BoundKind :: TraitObject , BoundConstness :: Never , BoundPolarity :: Maybe ( _) )
13421342if !self . features . more_maybe_bounds =>
13431343{
1344- self . session
1344+ self . sess
13451345. create_feature_err (
13461346 errors:: OptionalTraitObject { span : trait_ref. span } ,
13471347 sym:: more_maybe_bounds,
@@ -1752,13 +1752,13 @@ fn deny_equality_constraints(
17521752}
17531753
17541754pub fn check_crate (
1755- session : & Session ,
1755+ sess : & Session ,
17561756features : & Features ,
17571757krate : & Crate ,
17581758lints : & mut LintBuffer ,
17591759) -> bool {
17601760let mut validator = AstValidator {
1761- session ,
1761+ sess ,
17621762 features,
17631763extern_mod : None ,
17641764outer_trait_or_trait_impl : None ,
0 commit comments