File tree 1 file changed +10
-9
lines changed
compiler/rustc_parse/src/parser
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,16 @@ impl MultiSugg {
242
242
err. multipart_suggestions ( msg, suggestions. map ( |s| s. patches ) , applicability) ;
243
243
}
244
244
}
245
+
246
+ #[ derive( SessionDiagnostic ) ]
247
+ #[ error( slug = "parser-maybe-report-ambiguous-plus" ) ]
248
+ struct AmbiguousPlus {
249
+ pub sum_with_parens : String ,
250
+ #[ primary_span]
251
+ #[ suggestion( code = "({sum_with_parens})" ) ]
252
+ pub span : Span ,
253
+ }
254
+
245
255
// SnapshotParser is used to create a snapshot of the parser
246
256
// without causing duplicate errors being emitted when the `Parser`
247
257
// is dropped.
@@ -1171,15 +1181,6 @@ impl<'a> Parser<'a> {
1171
1181
impl_dyn_multi : bool ,
1172
1182
ty : & Ty ,
1173
1183
) {
1174
- #[ derive( SessionDiagnostic ) ]
1175
- #[ error( slug = "parser-maybe-report-ambiguous-plus" ) ]
1176
- struct AmbiguousPlus {
1177
- pub sum_with_parens : String ,
1178
- #[ primary_span]
1179
- #[ suggestion( code = "({sum_with_parens})" ) ]
1180
- pub span : Span ,
1181
- }
1182
-
1183
1184
if matches ! ( allow_plus, AllowPlus :: No ) && impl_dyn_multi {
1184
1185
self . sess . emit_err ( AmbiguousPlus {
1185
1186
sum_with_parens : pprust:: ty_to_string ( & ty) ,
You can’t perform that action at this time.
0 commit comments