@@ -1233,10 +1233,30 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
12331233}
12341234
12351235declare_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 these kinds.
12371257 UNSTABLE_FEATURES ,
12381258 Allow ,
1239- "enabling unstable features (deprecated. do not use) "
1259+ "enabling unstable features"
12401260}
12411261
12421262declare_lint_pass ! (
@@ -1246,11 +1266,11 @@ declare_lint_pass!(
12461266
12471267impl < ' tcx > LateLintPass < ' tcx > for UnstableFeatures {
12481268 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 ) ;
12541274 }
12551275 }
12561276 }
0 commit comments