@@ -85,6 +85,9 @@ pub struct Lint {
8585 pub future_incompatible : Option < FutureIncompatibleInfo > ,
8686
8787 pub is_plugin : bool ,
88+
89+ /// `Some` if this lint is feature gated, otherwise `None`.
90+ pub feature_gate : Option < Symbol > ,
8891}
8992
9093/// Extra information for a future incompatibility lint.
@@ -107,6 +110,7 @@ impl Lint {
107110 is_plugin : false ,
108111 report_in_external_macro : false ,
109112 future_incompatible : None ,
113+ feature_gate : None ,
110114 }
111115 }
112116
@@ -276,7 +280,9 @@ macro_rules! declare_lint {
276280 ) ;
277281 ) ;
278282 ( $vis: vis $NAME: ident, $Level: ident, $desc: expr,
279- $( @future_incompatible = $fi: expr; ) ? $( $v: ident) ,* ) => (
283+ $( @future_incompatible = $fi: expr; ) ?
284+ $( @feature_gate = $gate: expr; ) ?
285+ $( $v: ident) ,* ) => (
280286 $vis static $NAME: & $crate:: lint:: Lint = & $crate:: lint:: Lint {
281287 name: stringify!( $NAME) ,
282288 default_level: $crate:: lint:: $Level,
@@ -285,6 +291,7 @@ macro_rules! declare_lint {
285291 is_plugin: false ,
286292 $( $v: true , ) *
287293 $( future_incompatible: Some ( $fi) , ) *
294+ $( feature_gate: Some ( $gate) , ) *
288295 ..$crate:: lint:: Lint :: default_fields_for_macro( )
289296 } ;
290297 ) ;
@@ -328,6 +335,7 @@ macro_rules! declare_tool_lint {
328335 report_in_external_macro: $external,
329336 future_incompatible: None ,
330337 is_plugin: true ,
338+ feature_gate: None ,
331339 } ;
332340 ) ;
333341}
0 commit comments