2
2
//! It also serves as an input to the parser itself.
3
3
4
4
use crate :: config:: CheckCfg ;
5
- use crate :: errors:: {
6
- ExprParenthesesNeeded , FeatureDiagnosticForIssue , FeatureDiagnosticHelp , FeatureGateError ,
7
- } ;
5
+ use crate :: errors:: { FeatureDiagnosticForIssue , FeatureDiagnosticHelp , FeatureGateError } ;
8
6
use crate :: lint:: {
9
7
builtin:: UNSTABLE_SYNTAX_PRE_EXPANSION , BufferedEarlyLint , BuiltinLintDiagnostics , Lint , LintId ,
10
8
} ;
@@ -13,8 +11,8 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
13
11
use rustc_data_structures:: sync:: { Lock , Lrc } ;
14
12
use rustc_errors:: { emitter:: SilentEmitter , ColorConfig , Handler } ;
15
13
use 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 ,
18
16
} ;
19
17
use rustc_feature:: { find_feature_issue, GateIssue , UnstableFeatures } ;
20
18
use rustc_span:: edition:: Edition ;
@@ -324,12 +322,6 @@ impl ParseSess {
324
322
} ) ;
325
323
}
326
324
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
-
333
325
pub fn save_proc_macro_span ( & self , span : Span ) -> usize {
334
326
let mut spans = self . proc_macro_quoted_spans . lock ( ) ;
335
327
spans. push ( span) ;
0 commit comments