Rollup merge of #152612 - JonathanBrouwer:rename_to_msg, r=jdonszelmann
Rename `inline_fluent!` to `msg!` This was the most popular name for the macro as voted in [#t-compiler > Bikeshed the new `inline_fluent!` macro @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Bikeshed.20the.20new.20.60inline_fluent!.60.20macro/near/572751863)
This commit is contained in:
commit
38cc50b6e4
64 changed files with 647 additions and 840 deletions
|
|
@ -5,9 +5,7 @@ use hir::intravisit::{self, Visitor};
|
|||
use rustc_abi::{ExternAbi, ScalableElt};
|
||||
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
|
||||
use rustc_errors::codes::*;
|
||||
use rustc_errors::{
|
||||
Applicability, ErrorGuaranteed, inline_fluent, pluralize, struct_span_code_err,
|
||||
};
|
||||
use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err};
|
||||
use rustc_hir::attrs::{AttributeKind, EiiDecl, EiiImpl, EiiImplResolution};
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
|
|
@ -1771,7 +1769,7 @@ fn check_method_receiver<'tcx>(
|
|||
the `arbitrary_self_types` feature",
|
||||
),
|
||||
)
|
||||
.with_help(inline_fluent!("consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`"))
|
||||
.with_help(msg!("consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`"))
|
||||
.emit()
|
||||
}
|
||||
None | Some(ArbitrarySelfTypesLevel::Basic)
|
||||
|
|
@ -1795,7 +1793,7 @@ fn check_method_receiver<'tcx>(
|
|||
the `arbitrary_self_types_pointers` feature",
|
||||
),
|
||||
)
|
||||
.with_help(inline_fluent!("consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`"))
|
||||
.with_help(msg!("consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`"))
|
||||
.emit()
|
||||
}
|
||||
_ =>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use rustc_abi::ExternAbi;
|
|||
use rustc_errors::codes::*;
|
||||
use rustc_errors::{
|
||||
Applicability, Diag, DiagCtxtHandle, DiagSymbolList, Diagnostic, EmissionGuarantee, Level,
|
||||
MultiSpan, inline_fluent, listify,
|
||||
MultiSpan, listify, msg,
|
||||
};
|
||||
use rustc_hir::limit::Limit;
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
|
|
@ -444,7 +444,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingGenericParams {
|
|||
let mut err = Diag::new(
|
||||
dcx,
|
||||
level,
|
||||
inline_fluent!(
|
||||
msg!(
|
||||
"the {$descr} {$parameterCount ->
|
||||
[one] parameter
|
||||
*[other] parameters
|
||||
|
|
@ -455,7 +455,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingGenericParams {
|
|||
err.code(E0393);
|
||||
err.span_label(
|
||||
self.def_span,
|
||||
inline_fluent!(
|
||||
msg!(
|
||||
"{$descr} {$parameterCount ->
|
||||
[one] parameter
|
||||
*[other] parameters
|
||||
|
|
@ -511,7 +511,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingGenericParams {
|
|||
// least we can clue them to the correct syntax `Trait</* Term */>`.
|
||||
err.span_suggestion_verbose(
|
||||
self.span.shrink_to_hi(),
|
||||
inline_fluent!(
|
||||
msg!(
|
||||
"explicitly specify the {$descr} {$parameterCount ->
|
||||
[one] parameter
|
||||
*[other] parameters
|
||||
|
|
@ -533,7 +533,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingGenericParams {
|
|||
if !suggested {
|
||||
err.span_label(
|
||||
self.span,
|
||||
inline_fluent!(
|
||||
msg!(
|
||||
"missing {$parameterCount ->
|
||||
[one] reference
|
||||
*[other] references
|
||||
|
|
@ -542,7 +542,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingGenericParams {
|
|||
);
|
||||
}
|
||||
|
||||
err.note(inline_fluent!(
|
||||
err.note(msg!(
|
||||
"because the parameter {$parameterCount ->
|
||||
[one] default references
|
||||
*[other] defaults reference
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use rustc_data_structures::sorted_map::SortedMap;
|
|||
use rustc_data_structures::unord::UnordMap;
|
||||
use rustc_errors::codes::*;
|
||||
use rustc_errors::{
|
||||
Applicability, Diag, ErrorGuaranteed, MultiSpan, SuggestionStyle, inline_fluent, listify,
|
||||
pluralize, struct_span_code_err,
|
||||
Applicability, Diag, ErrorGuaranteed, MultiSpan, SuggestionStyle, listify, msg, pluralize,
|
||||
struct_span_code_err,
|
||||
};
|
||||
use rustc_hir::def::{CtorOf, DefKind, Res};
|
||||
use rustc_hir::def_id::DefId;
|
||||
|
|
@ -304,7 +304,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||
// was also not an exact match, so we also suggest changing it.
|
||||
err.span_suggestion_verbose(
|
||||
assoc_ident.span,
|
||||
inline_fluent!("...and changing the associated {$assoc_kind} name"),
|
||||
msg!("...and changing the associated {$assoc_kind} name"),
|
||||
suggested_name,
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue