You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#125913 - fmease:early-lints-spruce-up-some-diags, r=Nadrieril
Spruce up the diagnostics of some early lints
Implement the various "*(note to myself) in a follow-up PR we should turn parts of this message into a subdiagnostic (help msg or even struct sugg)*" drive-by comments I left in rust-lang#124417 during my review.
For context, before rust-lang#124417, only a few early lints touched/decorated/customized their diagnostic because the former API made it a bit awkward. Likely because of that, things that should've been subdiagnostics were just crammed into the primary message. This PR rectifies this.
@@ -456,7 +457,7 @@ lint_map_unit_fn = `Iterator::map` call that discard the iterator's values
456
457
.map_label = after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
457
458
.suggestion = you might have meant to use `Iterator::for_each`
458
459
459
-
lint_metavariable_still_repeating = variable '{$name}' is still repeating at this depth
460
+
lint_metavariable_still_repeating = variable `{$name}` is still repeating at this depth
460
461
461
462
lint_metavariable_wrong_operator = meta-variable repeats with different Kleene operator
462
463
@@ -635,8 +636,8 @@ lint_pattern_in_bodiless = patterns aren't allowed in functions without bodies
635
636
lint_pattern_in_foreign = patterns aren't allowed in foreign function declarations
636
637
.label = pattern not allowed in foreign function
637
638
638
-
lint_private_extern_crate_reexport =
639
-
extern crate `{$ident}` is private, and cannot be re-exported, consider declaring with `pub`
639
+
lint_private_extern_crate_reexport =extern crate `{$ident}` is private and cannot be re-exported
640
+
.suggestion = consider making the `extern crate` item publicly accessible
640
641
641
642
lint_proc_macro_derive_resolution_fallback = cannot find {$ns} `{$ident}` in this scope
642
643
.label = names from parent modules are not accessible without an explicit import
@@ -847,7 +848,8 @@ lint_unused_coroutine =
847
848
}{$post} that must be used
848
849
.note = coroutines are lazy and do nothing unless resumed
849
850
850
-
lint_unused_crate_dependency = external crate `{$extern_crate}` unused in `{$local_crate}`: remove the dependency or add `use {$extern_crate} as _;`
851
+
lint_unused_crate_dependency = extern crate `{$extern_crate}` is unused in crate `{$local_crate}`
852
+
.help = remove the dependency or add `use {$extern_crate} as _;` to the crate root
851
853
852
854
lint_unused_def = unused {$pre}`{$def}`{$post} that must be used
853
855
.suggestion = use `let _ = ...` to ignore the resulting value
0 commit comments