22//! It also serves as an input to the parser itself.
33
44use crate :: config:: CheckCfg ;
5- use crate :: errors:: {
6- ExprParenthesesNeeded , FeatureDiagnosticForIssue , FeatureDiagnosticHelp , FeatureGateError ,
7- } ;
5+ use crate :: errors:: { FeatureDiagnosticForIssue , FeatureDiagnosticHelp , FeatureGateError } ;
86use crate :: lint:: {
97 builtin:: UNSTABLE_SYNTAX_PRE_EXPANSION , BufferedEarlyLint , BuiltinLintDiagnostics , Lint , LintId ,
108} ;
@@ -13,8 +11,8 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
1311use rustc_data_structures:: sync:: { Lock , Lrc } ;
1412use rustc_errors:: { emitter:: SilentEmitter , ColorConfig , Handler } ;
1513use rustc_errors:: {
16- fallback_fluent_bundle, AddToDiagnostic , Diagnostic , DiagnosticBuilder , DiagnosticId ,
17- DiagnosticMessage , EmissionGuarantee , ErrorGuaranteed , IntoDiagnostic , MultiSpan , StashKey ,
14+ fallback_fluent_bundle, Diagnostic , DiagnosticBuilder , DiagnosticId , DiagnosticMessage ,
15+ EmissionGuarantee , ErrorGuaranteed , IntoDiagnostic , MultiSpan , StashKey ,
1816} ;
1917use rustc_feature:: { find_feature_issue, GateIssue , UnstableFeatures } ;
2018use rustc_span:: edition:: Edition ;
@@ -324,12 +322,6 @@ impl ParseSess {
324322 } ) ;
325323 }
326324
327- /// Extend an error with a suggestion to wrap an expression with parentheses to allow the
328- /// parser to continue parsing the following operation as part of the same expression.
329- pub fn expr_parentheses_needed ( & self , err : & mut Diagnostic , span : Span ) {
330- ExprParenthesesNeeded :: surrounding ( span) . add_to_diagnostic ( err) ;
331- }
332-
333325 pub fn save_proc_macro_span ( & self , span : Span ) -> usize {
334326 let mut spans = self . proc_macro_quoted_spans . lock ( ) ;
335327 spans. push ( span) ;
0 commit comments