@@ -14,6 +14,7 @@ use rustc_attr as attr;
14
14
use rustc_data_structures:: flat_map_in_place:: FlatMapInPlace ;
15
15
use rustc_feature:: Features ;
16
16
use rustc_feature:: { ACCEPTED_FEATURES , REMOVED_FEATURES , UNSTABLE_FEATURES } ;
17
+ use rustc_lint_defs:: BuiltinLintDiag ;
17
18
use rustc_parse:: validate_attr;
18
19
use rustc_session:: parse:: feature_err;
19
20
use rustc_session:: Session ;
@@ -248,7 +249,6 @@ impl<'a> StripUnconfigured<'a> {
248
249
/// Gives a compiler warning when the `cfg_attr` contains no attributes and
249
250
/// is in the original source file. Gives a compiler error if the syntax of
250
251
/// the attribute is incorrect.
251
- #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
252
252
pub ( crate ) fn expand_cfg_attr ( & self , attr : & Attribute , recursive : bool ) -> Vec < Attribute > {
253
253
let Some ( ( cfg_predicate, expanded_attrs) ) =
254
254
rustc_parse:: parse_cfg_attr ( attr, & self . sess . psess )
@@ -262,7 +262,7 @@ impl<'a> StripUnconfigured<'a> {
262
262
rustc_lint_defs:: builtin:: UNUSED_ATTRIBUTES ,
263
263
attr. span ,
264
264
ast:: CRATE_NODE_ID ,
265
- "`#[cfg_attr]` does not expand to any attributes" ,
265
+ BuiltinLintDiag :: CfgAttrNoAttributes ,
266
266
) ;
267
267
}
268
268
@@ -283,7 +283,6 @@ impl<'a> StripUnconfigured<'a> {
283
283
}
284
284
}
285
285
286
- #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
287
286
fn expand_cfg_attr_item (
288
287
& self ,
289
288
attr : & Attribute ,
@@ -346,15 +345,15 @@ impl<'a> StripUnconfigured<'a> {
346
345
rustc_lint_defs:: builtin:: DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME ,
347
346
attr. span ,
348
347
ast:: CRATE_NODE_ID ,
349
- "`crate_type` within an `#![cfg_attr] attribute is deprecated`" ,
348
+ BuiltinLintDiag :: CrateTypeInCfgAttr ,
350
349
) ;
351
350
}
352
351
if attr. has_name ( sym:: crate_name) {
353
352
self . sess . psess . buffer_lint (
354
353
rustc_lint_defs:: builtin:: DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME ,
355
354
attr. span ,
356
355
ast:: CRATE_NODE_ID ,
357
- "`crate_name` within an `#![cfg_attr] attribute is deprecated`" ,
356
+ BuiltinLintDiag :: CrateNameInCfgAttr ,
358
357
) ;
359
358
}
360
359
attr
0 commit comments