@@ -1232,10 +1232,26 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
1232
1232
}
1233
1233
1234
1234
declare_lint ! {
1235
- /// The `unstable_features` is deprecated and should no longer be used.
1235
+ /// The `unstable_features` lint detects uses of `#![feature]`.
1236
+ ///
1237
+ /// ### Example
1238
+ ///
1239
+ /// ```rust,compile_fail
1240
+ /// #![deny(unstable_features)]
1241
+ /// #![feature(test)]
1242
+ /// ```
1243
+ ///
1244
+ /// {{produces}}
1245
+ ///
1246
+ /// ### Explanation
1247
+ ///
1248
+ /// Crates that use unstable features require a nightly compiler which might not be desirable.
1249
+ /// Especially in larger projects with a multitude of crates where some crates are allowed to
1250
+ /// use unstable features and some are not, this lint may come in handy to enforce policies of
1251
+ /// this kind.
1236
1252
UNSTABLE_FEATURES ,
1237
1253
Allow ,
1238
- "enabling unstable features (deprecated. do not use) "
1254
+ "enabling unstable features"
1239
1255
}
1240
1256
1241
1257
declare_lint_pass ! (
@@ -1245,11 +1261,11 @@ declare_lint_pass!(
1245
1261
1246
1262
impl < ' tcx > LateLintPass < ' tcx > for UnstableFeatures {
1247
1263
fn check_attribute ( & mut self , cx : & LateContext < ' _ > , attr : & ast:: Attribute ) {
1248
- if attr. has_name ( sym:: feature) {
1249
- if let Some ( items) = attr. meta_item_list ( ) {
1250
- for item in items {
1251
- cx . emit_spanned_lint ( UNSTABLE_FEATURES , item . span ( ) , BuiltinUnstableFeatures ) ;
1252
- }
1264
+ if attr. has_name ( sym:: feature)
1265
+ && let Some ( items) = attr. meta_item_list ( )
1266
+ {
1267
+ for item in items {
1268
+ cx . emit_spanned_lint ( UNSTABLE_FEATURES , item . span ( ) , BuiltinUnstableFeatures ) ;
1253
1269
}
1254
1270
}
1255
1271
}
0 commit comments