File tree Expand file tree Collapse file tree 3 files changed +15
-14
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -382,3 +382,7 @@ lint-builtin-explicit-outlives = outlives requirements can be inferred
382
382
[ one ] this bound
383
383
*[ other ] these bounds
384
384
}
385
+
386
+ lint-builtin-incomplete-features = the feature `{ $name } ` is incomplete and may not be safe to use and/or cause compiler crashes
387
+ .note = see issue #{ $n } <https://github.com/rust-lang/rust/issues/{ $n } > for more information
388
+ .help = consider using `min_{ $name } ` instead, which is more stable and complete
Original file line number Diff line number Diff line change @@ -115,6 +115,12 @@ impl IntoDiagnosticArg for String {
115
115
}
116
116
}
117
117
118
+ impl IntoDiagnosticArg for std:: num:: NonZeroU32 {
119
+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
120
+ DiagnosticArgValue :: Str ( Cow :: Owned ( self . to_string ( ) ) )
121
+ }
122
+ }
123
+
118
124
impl IntoDiagnosticArg for Edition {
119
125
fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
120
126
DiagnosticArgValue :: Str ( Cow :: Owned ( self . to_string ( ) ) )
Original file line number Diff line number Diff line change @@ -2347,23 +2347,14 @@ impl EarlyLintPass for IncompleteFeatures {
2347
2347
. filter ( |( & name, _) | features. incomplete ( name) )
2348
2348
. for_each ( |( & name, & span) | {
2349
2349
cx. struct_span_lint ( INCOMPLETE_FEATURES , span, |lint| {
2350
- let mut builder = lint. build ( & format ! (
2351
- "the feature `{}` is incomplete and may not be safe to use \
2352
- and/or cause compiler crashes",
2353
- name,
2354
- ) ) ;
2350
+ let mut builder = lint. build ( fluent:: lint:: builtin_incomplete_features) ;
2351
+ builder. set_arg ( "name" , name) ;
2355
2352
if let Some ( n) = rustc_feature:: find_feature_issue ( name, GateIssue :: Language ) {
2356
- builder. note ( & format ! (
2357
- "see issue #{} <https://github.com/rust-lang/rust/issues/{}> \
2358
- for more information",
2359
- n, n,
2360
- ) ) ;
2353
+ builder. set_arg ( "n" , n) ;
2354
+ builder. note ( fluent:: lint:: note) ;
2361
2355
}
2362
2356
if HAS_MIN_FEATURES . contains ( & name) {
2363
- builder. help ( & format ! (
2364
- "consider using `min_{}` instead, which is more stable and complete" ,
2365
- name,
2366
- ) ) ;
2357
+ builder. help ( fluent:: lint:: help) ;
2367
2358
}
2368
2359
builder. emit ( ) ;
2369
2360
} )
You can’t perform that action at this time.
0 commit comments