File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -354,3 +354,7 @@ lint-builtin-mutable-transmutes =
354
354
transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell
355
355
356
356
lint-builtin-unstable-features = unstable feature
357
+
358
+ lint-builtin-unreachable-pub = unreachable `pub` { $what }
359
+ .suggestion = consider restricting its visibility
360
+ .help = or consider exporting it for use by other crates
Original file line number Diff line number Diff line change @@ -1385,16 +1385,17 @@ impl UnreachablePub {
1385
1385
}
1386
1386
let def_span = cx. tcx . sess . source_map ( ) . guess_head_span ( span) ;
1387
1387
cx. struct_span_lint ( UNREACHABLE_PUB , def_span, |lint| {
1388
- let mut err = lint. build ( & format ! ( "unreachable `pub` {}" , what) ) ;
1388
+ let mut err = lint. build ( fluent:: lint:: builtin_unreachable_pub) ;
1389
+ err. set_arg ( "what" , what) ;
1389
1390
1390
1391
err. span_suggestion (
1391
1392
vis_span,
1392
- "consider restricting its visibility" ,
1393
+ fluent :: lint :: suggestion ,
1393
1394
"pub(crate)" ,
1394
1395
applicability,
1395
1396
) ;
1396
1397
if exportable {
1397
- err. help ( "or consider exporting it for use by other crates" ) ;
1398
+ err. help ( fluent :: lint :: help ) ;
1398
1399
}
1399
1400
err. emit ( ) ;
1400
1401
} ) ;
You can’t perform that action at this time.
0 commit comments