@@ -1233,10 +1233,30 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
1233
1233
}
1234
1234
1235
1235
declare_lint ! {
1236
- /// The `unstable_features` is deprecated and should no longer be used.
1236
+ /// The `unstable_features` lint detects uses of `#![feature]`.
1237
+ ///
1238
+ /// ### Example
1239
+ ///
1240
+ /// ```rust,compile_fail
1241
+ /// #![deny(unstable_features)]
1242
+ /// #![feature(test)]
1243
+ /// ```
1244
+ ///
1245
+ /// {{produces}}
1246
+ ///
1247
+ /// ### Explanation
1248
+ ///
1249
+ /// In larger nightly-based projects which
1250
+ ///
1251
+ /// * consist of a multitude of crates where a subset of crates has to compile on
1252
+ /// stable either unconditionally or depending on a `cfg` flag to for example
1253
+ /// allow stable users to depend on them,
1254
+ /// * don't use nightly for experimental features but for, e.g., unstable options only,
1255
+ ///
1256
+ /// this lint may come in handy to enforce policies of this kind.
1237
1257
UNSTABLE_FEATURES ,
1238
1258
Allow ,
1239
- "enabling unstable features (deprecated. do not use) "
1259
+ "enabling unstable features"
1240
1260
}
1241
1261
1242
1262
declare_lint_pass ! (
@@ -1246,11 +1266,11 @@ declare_lint_pass!(
1246
1266
1247
1267
impl < ' tcx > LateLintPass < ' tcx > for UnstableFeatures {
1248
1268
fn check_attribute ( & mut self , cx : & LateContext < ' _ > , attr : & ast:: Attribute ) {
1249
- if attr. has_name ( sym:: feature) {
1250
- if let Some ( items) = attr. meta_item_list ( ) {
1251
- for item in items {
1252
- cx . emit_spanned_lint ( UNSTABLE_FEATURES , item . span ( ) , BuiltinUnstableFeatures ) ;
1253
- }
1269
+ if attr. has_name ( sym:: feature)
1270
+ && let Some ( items) = attr. meta_item_list ( )
1271
+ {
1272
+ for item in items {
1273
+ cx . emit_spanned_lint ( UNSTABLE_FEATURES , item . span ( ) , BuiltinUnstableFeatures ) ;
1254
1274
}
1255
1275
}
1256
1276
}
0 commit comments