@@ -17,7 +17,7 @@ use rustc_ast::{
1717} ;
1818use rustc_ast_pretty:: pprust;
1919use rustc_data_structures:: fx:: FxHashSet ;
20- use rustc_errors:: { pluralize, struct_span_err, Diagnostic , ErrorGuaranteed } ;
20+ use rustc_errors:: { pluralize, struct_span_err, Diagnostic , EmissionGuarantee , ErrorGuaranteed } ;
2121use rustc_errors:: { Applicability , DiagnosticBuilder , Handler , PResult } ;
2222use rustc_span:: source_map:: Spanned ;
2323use rustc_span:: symbol:: { kw, Ident } ;
@@ -225,13 +225,13 @@ struct MultiSugg {
225225}
226226
227227impl MultiSugg {
228- fn emit ( self , err : & mut DiagnosticBuilder < ' _ > ) {
228+ fn emit < G : EmissionGuarantee > ( self , err : & mut DiagnosticBuilder < ' _ , G > ) {
229229 err. multipart_suggestion ( & self . msg , self . patches , self . applicability ) ;
230230 }
231231
232232 /// Overrides individual messages and applicabilities.
233- fn emit_many (
234- err : & mut DiagnosticBuilder < ' _ > ,
233+ fn emit_many < G : EmissionGuarantee > (
234+ err : & mut DiagnosticBuilder < ' _ , G > ,
235235 msg : & str ,
236236 applicability : Applicability ,
237237 suggestions : impl Iterator < Item = Self > ,
@@ -1289,7 +1289,7 @@ impl<'a> Parser<'a> {
12891289 ) ;
12901290 err. span_label ( op_span, & format ! ( "not a valid {} operator" , kind. fixity) ) ;
12911291
1292- let help_base_case = |mut err : DiagnosticBuilder < ' _ > , base| {
1292+ let help_base_case = |mut err : DiagnosticBuilder < ' _ , _ > , base| {
12931293 err. help ( & format ! ( "use `{}= 1` instead" , kind. op. chr( ) ) ) ;
12941294 err. emit ( ) ;
12951295 Ok ( base)
0 commit comments