@@ -14,14 +14,13 @@ use rustc_errors::{
1414 BufferedEarlyLint , ColorConfig , DecorateDiagCompat , Diag , DiagCtxt , DiagCtxtHandle ,
1515 DiagMessage , EmissionGuarantee , Level , MultiSpan , StashKey ,
1616} ;
17- use rustc_feature:: { GateIssue , UnstableFeatures , find_feature_issue} ;
17+ use rustc_feature:: { GateIssue , find_feature_issue} ;
1818use rustc_span:: edition:: Edition ;
1919use rustc_span:: hygiene:: ExpnId ;
2020use rustc_span:: source_map:: { FilePathMapping , SourceMap } ;
2121use rustc_span:: { Span , Symbol , sym} ;
2222
2323use crate :: Session ;
24- use crate :: config:: { Cfg , CheckCfg } ;
2524use crate :: errors:: {
2625 CliFeatureDiagnosticHelp , FeatureDiagnosticForIssue , FeatureDiagnosticHelp ,
2726 FeatureDiagnosticSuggestion , FeatureGateError , SuggestUpgradeCompiler ,
@@ -182,7 +181,7 @@ pub fn add_feature_diagnostics_for_issue<G: EmissionGuarantee>(
182181 }
183182
184183 // #23973: do not suggest `#![feature(...)]` if we are in beta/stable
185- if sess. psess . unstable_features . is_nightly_build ( ) {
184+ if sess. unstable_features . is_nightly_build ( ) {
186185 if feature_from_cli {
187186 err. subdiagnostic ( CliFeatureDiagnosticHelp { feature } ) ;
188187 } else if let Some ( span) = inject_span {
@@ -226,7 +225,7 @@ pub fn feature_err_unstable_feature_bound(
226225 let mut err = sess. dcx ( ) . create_err ( FeatureGateError { span, explain : explain. into ( ) } ) ;
227226
228227 // #23973: do not suggest `#![feature(...)]` if we are in beta/stable
229- if sess. psess . unstable_features . is_nightly_build ( ) {
228+ if sess. unstable_features . is_nightly_build ( ) {
230229 err. subdiagnostic ( FeatureDiagnosticHelp { feature } ) ;
231230
232231 if feature == sym:: rustc_attrs {
@@ -245,9 +244,6 @@ pub fn feature_err_unstable_feature_bound(
245244/// Info about a parsing session.
246245pub struct ParseSess {
247246 dcx : DiagCtxt ,
248- pub unstable_features : UnstableFeatures ,
249- pub config : Cfg ,
250- pub check_config : CheckCfg ,
251247 pub edition : Edition ,
252248 /// Places where raw identifiers were used. This is used to avoid complaining about idents
253249 /// clashing with keywords in new editions.
@@ -264,9 +260,6 @@ pub struct ParseSess {
264260 pub ambiguous_block_expr_parse : Lock < FxIndexMap < Span , Span > > ,
265261 pub gated_spans : GatedSpans ,
266262 pub symbol_gallery : SymbolGallery ,
267- /// Spans passed to `proc_macro::quote_span`. Each span has a numerical
268- /// identifier represented by its position in the vector.
269- proc_macro_quoted_spans : AppendOnlyVec < Span > ,
270263 /// Used to generate new `AttrId`s. Every `AttrId` is unique.
271264 pub attr_id_generator : AttrIdGenerator ,
272265}
@@ -286,9 +279,6 @@ impl ParseSess {
286279 pub fn with_dcx ( dcx : DiagCtxt , source_map : Arc < SourceMap > ) -> Self {
287280 Self {
288281 dcx,
289- unstable_features : UnstableFeatures :: from_environment ( None ) ,
290- config : Cfg :: default ( ) ,
291- check_config : CheckCfg :: default ( ) ,
292282 edition : ExpnId :: root ( ) . expn_data ( ) . edition ,
293283 raw_identifier_spans : Default :: default ( ) ,
294284 bad_unicode_identifiers : Lock :: new ( Default :: default ( ) ) ,
@@ -297,7 +287,6 @@ impl ParseSess {
297287 ambiguous_block_expr_parse : Lock :: new ( Default :: default ( ) ) ,
298288 gated_spans : GatedSpans :: default ( ) ,
299289 symbol_gallery : SymbolGallery :: default ( ) ,
300- proc_macro_quoted_spans : Default :: default ( ) ,
301290 attr_id_generator : AttrIdGenerator :: new ( ) ,
302291 }
303292 }
@@ -385,16 +374,6 @@ impl ParseSess {
385374 } ) ;
386375 }
387376
388- pub fn save_proc_macro_span ( & self , span : Span ) -> usize {
389- self . proc_macro_quoted_spans . push ( span)
390- }
391-
392- pub fn proc_macro_quoted_spans ( & self ) -> impl Iterator < Item = ( usize , Span ) > {
393- // This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for
394- // AppendOnlyVec, so we resort to this scheme.
395- self . proc_macro_quoted_spans . iter_enumerated ( )
396- }
397-
398377 pub fn dcx ( & self ) -> DiagCtxtHandle < ' _ > {
399378 self . dcx . handle ( )
400379 }
0 commit comments