|
1 | 1 | //! Error reporting machinery for lifetime errors. |
2 | 2 |
|
3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
4 | | -use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, inline_fluent}; |
| 4 | +use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, msg}; |
5 | 5 | use rustc_hir as hir; |
6 | 6 | use rustc_hir::GenericBound::Trait; |
7 | 7 | use rustc_hir::QPath::Resolved; |
@@ -291,7 +291,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
291 | 291 | if suggestions.len() > 0 { |
292 | 292 | suggestions.dedup(); |
293 | 293 | diag.multipart_suggestion_verbose( |
294 | | - inline_fluent!("consider restricting the type parameter to the `'static` lifetime"), |
| 294 | + msg!("consider restricting the type parameter to the `'static` lifetime"), |
295 | 295 | suggestions, |
296 | 296 | Applicability::MaybeIncorrect, |
297 | 297 | ); |
@@ -982,18 +982,16 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
982 | 982 | let mut multi_span: MultiSpan = vec![*span].into(); |
983 | 983 | multi_span.push_span_label( |
984 | 984 | *span, |
985 | | - inline_fluent!("this has an implicit `'static` lifetime requirement"), |
| 985 | + msg!("this has an implicit `'static` lifetime requirement"), |
986 | 986 | ); |
987 | 987 | multi_span.push_span_label( |
988 | 988 | ident.span, |
989 | | - inline_fluent!( |
990 | | - "calling this method introduces the `impl`'s `'static` requirement" |
991 | | - ), |
| 989 | + msg!("calling this method introduces the `impl`'s `'static` requirement"), |
992 | 990 | ); |
993 | 991 | err.subdiagnostic(RequireStaticErr::UsedImpl { multi_span }); |
994 | 992 | err.span_suggestion_verbose( |
995 | 993 | span.shrink_to_hi(), |
996 | | - inline_fluent!("consider relaxing the implicit `'static` requirement"), |
| 994 | + msg!("consider relaxing the implicit `'static` requirement"), |
997 | 995 | " + '_", |
998 | 996 | Applicability::MaybeIncorrect, |
999 | 997 | ); |
@@ -1156,7 +1154,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
1156 | 1154 | if ocx.evaluate_obligations_error_on_ambiguity().is_empty() && count > 0 { |
1157 | 1155 | diag.span_suggestion_verbose( |
1158 | 1156 | tcx.hir_body(*body).value.peel_blocks().span.shrink_to_lo(), |
1159 | | - inline_fluent!("dereference the return value"), |
| 1157 | + msg!("dereference the return value"), |
1160 | 1158 | "*".repeat(count), |
1161 | 1159 | Applicability::MachineApplicable, |
1162 | 1160 | ); |
@@ -1200,7 +1198,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
1200 | 1198 | if let Some(closure_span) = closure_span { |
1201 | 1199 | diag.span_suggestion_verbose( |
1202 | 1200 | closure_span, |
1203 | | - inline_fluent!("consider adding 'move' keyword before the nested closure"), |
| 1201 | + msg!("consider adding 'move' keyword before the nested closure"), |
1204 | 1202 | "move ", |
1205 | 1203 | Applicability::MaybeIncorrect, |
1206 | 1204 | ); |
|
0 commit comments