@@ -15,13 +15,13 @@ use crate::errors;
15
15
/// The common case.
16
16
macro_rules! gate {
17
17
( $visitor: expr, $feature: ident, $span: expr, $explain: expr) => { {
18
- if !$visitor. features. $feature && !$span. allows_unstable( sym:: $feature) {
18
+ if !$visitor. features. $feature( ) && !$span. allows_unstable( sym:: $feature) {
19
19
#[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
20
20
feature_err( & $visitor. sess, sym:: $feature, $span, $explain) . emit( ) ;
21
21
}
22
22
} } ;
23
23
( $visitor: expr, $feature: ident, $span: expr, $explain: expr, $help: expr) => { {
24
- if !$visitor. features. $feature && !$span. allows_unstable( sym:: $feature) {
24
+ if !$visitor. features. $feature( ) && !$span. allows_unstable( sym:: $feature) {
25
25
// FIXME: make this translatable
26
26
#[ allow( rustc:: diagnostic_outside_of_impl) ]
27
27
#[ allow( rustc:: untranslatable_diagnostic) ]
@@ -43,7 +43,7 @@ macro_rules! gate_alt {
43
43
/// The case involving a multispan.
44
44
macro_rules! gate_multi {
45
45
( $visitor: expr, $feature: ident, $spans: expr, $explain: expr) => { {
46
- if !$visitor. features. $feature {
46
+ if !$visitor. features. $feature( ) {
47
47
let spans: Vec <_> =
48
48
$spans. filter( |span| !span. allows_unstable( sym:: $feature) ) . collect( ) ;
49
49
if !spans. is_empty( ) {
@@ -56,7 +56,7 @@ macro_rules! gate_multi {
56
56
/// The legacy case.
57
57
macro_rules! gate_legacy {
58
58
( $visitor: expr, $feature: ident, $span: expr, $explain: expr) => { {
59
- if !$visitor. features. $feature && !$span. allows_unstable( sym:: $feature) {
59
+ if !$visitor. features. $feature( ) && !$span. allows_unstable( sym:: $feature) {
60
60
feature_warn( & $visitor. sess, sym:: $feature, $span, $explain) ;
61
61
}
62
62
} } ;
@@ -150,7 +150,7 @@ impl<'a> PostExpansionVisitor<'a> {
150
150
151
151
// FIXME(non_lifetime_binders): Const bound params are pretty broken.
152
152
// Let's keep users from using this feature accidentally.
153
- if self . features . non_lifetime_binders {
153
+ if self . features . non_lifetime_binders ( ) {
154
154
let const_param_spans: Vec < _ > = params
155
155
. iter ( )
156
156
. filter_map ( |param| match param. kind {
@@ -210,7 +210,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
210
210
}
211
211
212
212
// Emit errors for non-staged-api crates.
213
- if !self . features . staged_api {
213
+ if !self . features . staged_api ( ) {
214
214
if attr. has_name ( sym:: unstable)
215
215
|| attr. has_name ( sym:: stable)
216
216
|| attr. has_name ( sym:: rustc_const_unstable)
@@ -470,7 +470,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
470
470
// Limit `min_specialization` to only specializing functions.
471
471
gate_alt ! (
472
472
& self ,
473
- self . features. specialization || ( is_fn && self . features. min_specialization) ,
473
+ self . features. specialization( ) || ( is_fn && self . features. min_specialization( ) ) ,
474
474
sym:: specialization,
475
475
i. span,
476
476
"specialization is unstable"
@@ -548,7 +548,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
548
548
gate_all ! ( return_type_notation, "return type notation is experimental" ) ;
549
549
gate_all ! ( pin_ergonomics, "pinned reference syntax is experimental" ) ;
550
550
551
- if !visitor. features . never_patterns {
551
+ if !visitor. features . never_patterns ( ) {
552
552
if let Some ( spans) = spans. get ( & sym:: never_patterns) {
553
553
for & span in spans {
554
554
if span. allows_unstable ( sym:: never_patterns) {
@@ -572,7 +572,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
572
572
}
573
573
}
574
574
575
- if !visitor. features . negative_bounds {
575
+ if !visitor. features . negative_bounds ( ) {
576
576
for & span in spans. get ( & sym:: negative_bounds) . iter ( ) . copied ( ) . flatten ( ) {
577
577
sess. dcx ( ) . emit_err ( errors:: NegativeBoundUnsupported { span } ) ;
578
578
}
0 commit comments