@@ -134,8 +134,8 @@ impl<'tcx> CheckConstVisitor<'tcx> {
134
134
/// Emits an error when an unsupported expression is found in a const context.
135
135
fn const_check_violated ( & self , expr : NonConstExpr , span : Span ) {
136
136
let features = self . tcx . features ( ) ;
137
- let gates = expr. required_feature_gates ( ) ;
138
- match gates {
137
+ let required_gates = expr. required_feature_gates ( ) ;
138
+ match required_gates {
139
139
// Don't emit an error if the user has enabled the requisite feature gates.
140
140
Some ( gates) if gates. iter ( ) . all ( |& g| features. enabled ( g) ) => return ,
141
141
@@ -154,8 +154,8 @@ impl<'tcx> CheckConstVisitor<'tcx> {
154
154
. expect ( "`const_check_violated` may only be called inside a const context" ) ;
155
155
let msg = format ! ( "`{}` is not allowed in a `{}`" , expr. name( ) , const_kind) ;
156
156
157
- let gates = gates . unwrap_or ( & [ ] ) ;
158
- let missing_gates: Vec < _ > = gates
157
+ let required_gates = required_gates . unwrap_or ( & [ ] ) ;
158
+ let missing_gates: Vec < _ > = required_gates
159
159
. iter ( )
160
160
. copied ( )
161
161
. filter ( |& g| !features. enabled ( g) )
@@ -166,7 +166,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
166
166
167
167
// If the user enabled `#![feature(const_loop)]` but not `#![feature(const_if_match)]`,
168
168
// explain why their `while` loop is being rejected.
169
- & [ gate @ sym:: const_if_match] if gates . contains ( & sym:: const_loop) => {
169
+ & [ gate @ sym:: const_if_match] if required_gates . contains ( & sym:: const_loop) => {
170
170
feature_err ( & self . tcx . sess . parse_sess , gate, span, & msg)
171
171
. note ( "`#![feature(const_loop)]` alone is not sufficient, \
172
172
since this loop expression contains an implicit conditional")
0 commit comments