@@ -201,6 +201,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
201
201
// For generic associated types (GATs) which implied 'static requirement
202
202
// from higher-ranked trait bounds (HRTB). Try to locate span of the trait
203
203
// and the span which bounded to the trait for adding 'static lifetime suggestion
204
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
205
+ #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
204
206
fn suggest_static_lifetime_for_gat_from_hrtb (
205
207
& self ,
206
208
diag : & mut Diag < ' _ > ,
@@ -254,9 +256,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
254
256
255
257
hrtb_bounds. iter ( ) . for_each ( |bound| {
256
258
let Trait ( PolyTraitRef { trait_ref, span : trait_span, .. } , _) = bound else { return ; } ;
257
- // FIXME: make this translatable
258
- #[ allow( rustc:: diagnostic_outside_of_impl) ]
259
- #[ allow( rustc:: untranslatable_diagnostic) ]
260
259
diag. span_note (
261
260
* trait_span,
262
261
"due to current limitations in the borrow checker, this implies a `'static` lifetime"
@@ -580,6 +579,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
580
579
/// executing...
581
580
/// = note: ...therefore, returned references to captured variables will escape the closure
582
581
/// ```
582
+ #[ allow( rustc:: diagnostic_outside_of_impl) ] // FIXME
583
583
fn report_fnmut_error (
584
584
& self ,
585
585
errci : & ErrorConstraintInfo < ' tcx > ,
@@ -761,6 +761,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
761
761
/// | ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it
762
762
/// | is returning data with lifetime `'b`
763
763
/// ```
764
+ #[ allow( rustc:: diagnostic_outside_of_impl) ] // FIXME
764
765
fn report_general_error ( & self , errci : & ErrorConstraintInfo < ' tcx > ) -> Diag < ' tcx > {
765
766
let ErrorConstraintInfo {
766
767
fr,
@@ -822,6 +823,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
822
823
/// LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + 'a {
823
824
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
824
825
/// ```
826
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
827
+ #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
825
828
fn add_static_impl_trait_suggestion (
826
829
& self ,
827
830
diag : & mut Diag < ' _ > ,
@@ -972,6 +975,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
972
975
self . suggest_constrain_dyn_trait_in_impl ( diag, & visitor. 0 , ident, self_ty) ;
973
976
}
974
977
978
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
979
+ #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
975
980
#[ instrument( skip( self , err) , level = "debug" ) ]
976
981
fn suggest_constrain_dyn_trait_in_impl (
977
982
& self ,
@@ -1034,6 +1039,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
1034
1039
suggest_adding_lifetime_params ( self . infcx . tcx , sub, ty_sup, ty_sub, diag) ;
1035
1040
}
1036
1041
1042
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
1043
+ #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
1037
1044
fn suggest_move_on_borrowing_closure ( & self , diag : & mut Diag < ' _ > ) {
1038
1045
let map = self . infcx . tcx . hir ( ) ;
1039
1046
let body_id = map. body_owned_by ( self . mir_def_id ( ) ) ;
0 commit comments