Skip to content

Commit 3e654e6

Browse files
committed
Split up the unknown_or_malformed_diagnostic_attributes lint
1 parent 44f415c commit 3e654e6

21 files changed

+141
-44
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ fn register_builtins(store: &mut LintStore) {
340340

341341
add_lint_group!("deprecated_safe", DEPRECATED_SAFE_2024);
342342

343+
add_lint_group!(
344+
"unknown_or_malformed_diagnostic_attributes",
345+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
346+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
347+
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
348+
UNKNOWN_DIAGNOSTIC_ATTRIBUTES
349+
);
350+
343351
// Register renamed and removed lints.
344352
store.register_renamed("single_use_lifetime", "single_use_lifetimes");
345353
store.register_renamed("elided_lifetime_in_path", "elided_lifetimes_in_paths");

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ declare_lint_pass! {
6363
LOSSY_PROVENANCE_CASTS,
6464
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
6565
MACRO_USE_EXTERN_CRATE,
66+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
67+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
6668
META_VARIABLE_MISUSE,
69+
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
6770
MISSING_ABI,
6871
MISSING_FRAGMENT_SPECIFIER,
6972
MISSING_UNSAFE_ON_EXTERN,
@@ -113,8 +116,8 @@ declare_lint_pass! {
113116
UNFULFILLED_LINT_EXPECTATIONS,
114117
UNINHABITED_STATIC,
115118
UNKNOWN_CRATE_TYPES,
119+
UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
116120
UNKNOWN_LINTS,
117-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
118121
UNNAMEABLE_TEST_ITEMS,
119122
UNNAMEABLE_TYPES,
120123
UNREACHABLE_CODE,
@@ -4282,31 +4285,105 @@ declare_lint! {
42824285
}
42834286

42844287
declare_lint! {
4285-
/// The `unknown_or_malformed_diagnostic_attributes` lint detects unrecognized or otherwise malformed
4286-
/// diagnostic attributes.
4288+
/// The `malformed_diagnostic_attributes` lint detects malformed diagnostic attributes.
42874289
///
42884290
/// ### Example
42894291
///
42904292
/// ```rust
4291-
/// #![feature(diagnostic_namespace)]
4292-
/// #[diagnostic::does_not_exist]
4293-
/// struct Foo;
4293+
/// #[diagnostic::do_not_recommend(message = "message")]
4294+
/// trait Trait {}
42944295
/// ```
42954296
///
42964297
/// {{produces}}
42974298
///
4299+
/// ### Explanation
4300+
///
4301+
/// It is usually a mistake to use options or syntax that is not supported. Check the spelling,
4302+
/// and check the diagnostic attribute listing for the correct name and syntax. Also consider if
4303+
/// you are using an old version of the compiler; perhaps the option or syntax is only available
4304+
/// in a newer version. See the [reference] for a list of diagnostic attributes and the syntax
4305+
/// of each.
4306+
///
4307+
/// [reference]: https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnostic-tool-attribute-namespace
4308+
pub MALFORMED_DIAGNOSTIC_ATTRIBUTES,
4309+
Warn,
4310+
"detects malformed diagnostic attributes",
4311+
}
4312+
4313+
declare_lint! {
4314+
/// The `misplaced_diagnostic_attributes` lint detects wrongly placed diagnostic attributes.
4315+
///
4316+
/// ### Example
4317+
///
4318+
/// ```rust
4319+
/// #[diagnostic::do_not_recommend]
4320+
/// struct NotUserFacing;
4321+
/// ```
4322+
///
4323+
/// {{produces}}
42984324
///
42994325
/// ### Explanation
43004326
///
4301-
/// It is usually a mistake to specify a diagnostic attribute that does not exist. Check
4302-
/// the spelling, and check the diagnostic attribute listing for the correct name. Also
4303-
/// consider if you are using an old version of the compiler, and the attribute
4304-
/// is only available in a newer version.
4305-
pub UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
4327+
/// It is usually a mistake to specify a diagnostic attribute on an item it is not meant for.
4328+
/// For example, `#[diagnostic::do_not_recommend]` can only be placed on trait implementations,
4329+
/// and does nothing if placed elsewhere. See the [reference] for a list of diagnostic
4330+
/// attributes and their correct positions.
4331+
///
4332+
/// [reference]: https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnostic-tool-attribute-namespace
4333+
pub MISPLACED_DIAGNOSTIC_ATTRIBUTES,
43064334
Warn,
4307-
"unrecognized or malformed diagnostic attribute",
4335+
"detects diagnostic attributes that are placed on the wrong item",
43084336
}
43094337

4338+
declare_lint! {
4339+
/// The `unknown_diagnostic_attributes` lint detects unknown diagnostic attributes.
4340+
///
4341+
/// ### Example
4342+
///
4343+
/// ```rust
4344+
/// #[diagnostic::does_not_exist]
4345+
/// struct Thing;
4346+
/// ```
4347+
///
4348+
/// {{produces}}
4349+
///
4350+
/// ### Explanation
4351+
///
4352+
/// It is usually a mistake to specify a diagnostic attribute that does not exist. Check the
4353+
/// spelling, and check the diagnostic attribute listing for the correct name. Also consider if
4354+
/// you are using an old version of the compiler and the attribute is only available in a newer
4355+
/// version. See the [reference] for the list of diagnostic attributes.
4356+
///
4357+
/// [reference]: https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnostic-tool-attribute-namespace
4358+
pub UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
4359+
Warn,
4360+
"detects unknown diagnostic attributes",
4361+
}
4362+
4363+
declare_lint! {
4364+
/// The `malformed_diagnostic_format_literals` lint detects malformed diagnostic format
4365+
/// literals.
4366+
///
4367+
/// ### Example
4368+
///
4369+
/// ```rust
4370+
/// #[diagnostic::on_unimplemented(message = "{Self}} does not implement `Trait`")]
4371+
/// trait Trait {}
4372+
/// ```
4373+
///
4374+
/// {{produces}}
4375+
///
4376+
/// ### Explanation
4377+
///
4378+
/// The `#[diagnostic::on_unimplemented]` attribute accepts string literal values that are
4379+
/// similar to `format!`'s string literal. See the [reference] for details on what is permitted
4380+
/// in this string literal.
4381+
///
4382+
/// [reference]: https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnostic-tool-attribute-namespace
4383+
pub MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
4384+
Warn,
4385+
"detects diagnostic attribute with malformed diagnostic format literals",
4386+
}
43104387
declare_lint! {
43114388
/// The `ambiguous_glob_imports` lint detects glob imports that should report ambiguity
43124389
/// errors, but previously didn't do that due to rustc bugs.

compiler/rustc_passes/src/check_attr.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use rustc_middle::{bug, span_bug};
3232
use rustc_session::config::CrateType;
3333
use rustc_session::lint::builtin::{
3434
CONFLICTING_REPR_HINTS, INVALID_DOC_ATTRIBUTES, INVALID_MACRO_EXPORT_ARGUMENTS,
35-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES,
35+
MALFORMED_DIAGNOSTIC_ATTRIBUTES, MISPLACED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES,
3636
};
3737
use rustc_session::parse::feature_err;
3838
use rustc_span::{BytePos, DUMMY_SP, Span, Symbol, edition, sym};
@@ -375,7 +375,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
375375
);
376376
}
377377

378-
/// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl.
378+
/// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl and that it has no
379+
/// arguments.
379380
fn check_do_not_recommend(
380381
&self,
381382
attr_span: Span,
@@ -392,15 +393,15 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
392393
)
393394
{
394395
self.tcx.emit_node_span_lint(
395-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
396+
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
396397
hir_id,
397398
attr_span,
398399
errors::IncorrectDoNotRecommendLocation,
399400
);
400401
}
401402
if !attr.is_word() {
402403
self.tcx.emit_node_span_lint(
403-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
404+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
404405
hir_id,
405406
attr_span,
406407
errors::DoNotRecommendDoesNotExpectArgs,
@@ -412,7 +413,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
412413
fn check_diagnostic_on_unimplemented(&self, attr_span: Span, hir_id: HirId, target: Target) {
413414
if !matches!(target, Target::Trait) {
414415
self.tcx.emit_node_span_lint(
415-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
416+
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
416417
hir_id,
417418
attr_span,
418419
DiagnosticOnUnimplementedOnlyForTraits,

compiler/rustc_resolve/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_middle::middle::stability;
2424
use rustc_middle::ty::{RegisteredTools, TyCtxt, Visibility};
2525
use rustc_session::lint::BuiltinLintDiag;
2626
use rustc_session::lint::builtin::{
27-
LEGACY_DERIVE_HELPERS, OUT_OF_SCOPE_MACRO_CALLS, UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
27+
LEGACY_DERIVE_HELPERS, OUT_OF_SCOPE_MACRO_CALLS, UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
2828
UNUSED_MACRO_RULES, UNUSED_MACROS,
2929
};
3030
use rustc_session::parse::feature_err;
@@ -663,7 +663,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
663663
);
664664

665665
self.tcx.sess.psess.buffer_lint(
666-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
666+
UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
667667
attribute.span(),
668668
node_id,
669669
BuiltinLintDiag::UnknownDiagnosticAttribute { span: attribute.span(), typo_name },

compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use rustc_macros::LintDiagnostic;
1111
use rustc_middle::bug;
1212
use rustc_middle::ty::print::PrintTraitRefExt;
1313
use rustc_middle::ty::{self, GenericArgsRef, GenericParamDef, GenericParamDefKind, TyCtxt};
14-
use rustc_session::lint::builtin::UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES;
14+
use rustc_session::lint::builtin::{
15+
MALFORMED_DIAGNOSTIC_ATTRIBUTES, MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
16+
};
1517
use rustc_span::{Span, Symbol, sym};
1618
use tracing::{debug, info};
1719

@@ -382,7 +384,7 @@ impl IgnoredDiagnosticOption {
382384
if let (Some(new_item), Some(old_item)) = (new, old) {
383385
if let Some(item_def_id) = item_def_id.as_local() {
384386
tcx.emit_node_span_lint(
385-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
387+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
386388
tcx.local_def_id_to_hir_id(item_def_id),
387389
new_item,
388390
IgnoredDiagnosticOption { span: new_item, prev_span: old_item, option_name },
@@ -533,7 +535,7 @@ impl<'tcx> OnUnimplementedDirective {
533535
if is_diagnostic_namespace_variant {
534536
if let Some(def_id) = item_def_id.as_local() {
535537
tcx.emit_node_span_lint(
536-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
538+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
537539
tcx.local_def_id_to_hir_id(def_id),
538540
vec![item.span()],
539541
MalformedOnUnimplementedAttrLint::new(item.span()),
@@ -689,7 +691,7 @@ impl<'tcx> OnUnimplementedDirective {
689691

690692
if let Some(item_def_id) = item_def_id.as_local() {
691693
tcx.emit_node_span_lint(
692-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
694+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
693695
tcx.local_def_id_to_hir_id(item_def_id),
694696
report_span,
695697
MalformedOnUnimplementedAttrLint::new(report_span),
@@ -702,7 +704,7 @@ impl<'tcx> OnUnimplementedDirective {
702704
Attribute::Unparsed(p) if !matches!(p.args, AttrArgs::Empty) => {
703705
if let Some(item_def_id) = item_def_id.as_local() {
704706
tcx.emit_node_span_lint(
705-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
707+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
706708
tcx.local_def_id_to_hir_id(item_def_id),
707709
attr.span(),
708710
MalformedOnUnimplementedAttrLint::new(attr.span()),
@@ -712,7 +714,7 @@ impl<'tcx> OnUnimplementedDirective {
712714
_ => {
713715
if let Some(item_def_id) = item_def_id.as_local() {
714716
tcx.emit_node_span_lint(
715-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
717+
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
716718
tcx.local_def_id_to_hir_id(item_def_id),
717719
attr.span(),
718720
MissingOptionsForOnUnimplementedAttr,
@@ -859,7 +861,7 @@ impl<'tcx> OnUnimplementedFormatString {
859861
if self.is_diagnostic_namespace_variant {
860862
if let Some(trait_def_id) = trait_def_id.as_local() {
861863
tcx.emit_node_span_lint(
862-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
864+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
863865
tcx.local_def_id_to_hir_id(trait_def_id),
864866
self.span,
865867
WrappedParserError { description: e.description, label: e.label },

compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented_format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_parse_format::{
88
Alignment, Argument, Count, FormatSpec, ParseError, ParseMode, Parser, Piece as RpfPiece,
99
Position,
1010
};
11-
use rustc_session::lint::builtin::UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES;
11+
use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_FORMAT_LITERALS;
1212
use rustc_span::def_id::DefId;
1313
use rustc_span::{BytePos, Pos, Span, Symbol, kw, sym};
1414

@@ -70,7 +70,7 @@ impl FormatWarning {
7070
let this = tcx.item_ident(item_def_id);
7171
if let Some(item_def_id) = item_def_id.as_local() {
7272
tcx.emit_node_span_lint(
73-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
73+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
7474
tcx.local_def_id_to_hir_id(item_def_id),
7575
span,
7676
UnknownFormatParameterForOnUnimplementedAttr {
@@ -83,7 +83,7 @@ impl FormatWarning {
8383
FormatWarning::PositionalArgument { span, .. } => {
8484
if let Some(item_def_id) = item_def_id.as_local() {
8585
tcx.emit_node_span_lint(
86-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
86+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
8787
tcx.local_def_id_to_hir_id(item_def_id),
8888
span,
8989
DisallowedPositionalArgument,
@@ -93,7 +93,7 @@ impl FormatWarning {
9393
FormatWarning::InvalidSpecifier { span, .. } => {
9494
if let Some(item_def_id) = item_def_id.as_local() {
9595
tcx.emit_node_span_lint(
96-
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
96+
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
9797
tcx.local_def_id_to_hir_id(item_def_id),
9898
span,
9999
InvalidFormatSpecifier,

src/tools/lint-docs/src/groups.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ static GROUP_DESCRIPTIONS: &[(&str, &str)] = &[
2626
"Lints that detect identifiers which will be come keywords in later editions",
2727
),
2828
("deprecated-safe", "Lints for functions which were erroneously marked as safe in the past"),
29+
(
30+
"unknown-or-malformed-diagnostic-attributes",
31+
"detects unknown or malformed diagnostic attributes",
32+
),
2933
];
3034

3135
type LintGroups = BTreeMap<String, BTreeSet<String>>;

tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(unknown_or_malformed_diagnostic_attributes)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= note: `#[deny(unknown_diagnostic_attributes)]` implied by `#[deny(unknown_or_malformed_diagnostic_attributes)]`
1213

1314
error: aborting due to 1 previous error
1415

tests/ui/diagnostic_namespace/do_not_recommend/does_not_acccept_args.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
44
LL | #[diagnostic::do_not_recommend(not_accepted)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
1010
--> $DIR/does_not_acccept_args.rs:15:1

tests/ui/diagnostic_namespace/do_not_recommend/does_not_acccept_args.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
44
LL | #[diagnostic::do_not_recommend(not_accepted)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
1010
--> $DIR/does_not_acccept_args.rs:15:1

tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implement
44
LL | #[diagnostic::do_not_recommend]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(misplaced_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
1010
--> $DIR/incorrect-locations.rs:11:1

tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implement
44
LL | #[diagnostic::do_not_recommend]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(misplaced_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
1010
--> $DIR/incorrect-locations.rs:11:1

tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unknown diagnostic attribute
44
LL | #[diagnostic::non_existing_attribute]
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(unknown_diagnostic_attributes)]` on by default
88

99
warning: unknown diagnostic attribute
1010
--> $DIR/non_existing_attributes_accepted.rs:8:15

tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unmatched `}` found
44
LL | #[diagnostic::on_unimplemented(message = "{{Test } thing")]
55
| ^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
7+
= note: `#[warn(malformed_diagnostic_format_literals)]` on by default
88

99
warning: positional format arguments are not allowed here
1010
--> $DIR/broken_format.rs:7:49

0 commit comments

Comments
 (0)