@@ -243,7 +243,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
243
243
return ;
244
244
}
245
245
246
- if self . const_let_allowed ( ) {
246
+ if self . tcx . features ( ) . const_let {
247
247
let mut dest = dest;
248
248
let index = loop {
249
249
match dest {
@@ -320,10 +320,6 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
320
320
}
321
321
}
322
322
323
- fn const_let_allowed ( & self ) -> bool {
324
- self . tcx . features ( ) . const_let
325
- }
326
-
327
323
/// Qualify a whole const, static initializer or const fn.
328
324
fn qualify_const ( & mut self ) -> ( Qualif , Lrc < BitSet < Local > > ) {
329
325
debug ! ( "qualifying {} {:?}" , self . mode, self . def_id) ;
@@ -361,7 +357,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
361
357
TerminatorKind :: FalseUnwind { .. } => None ,
362
358
363
359
TerminatorKind :: Return => {
364
- if !self . const_let_allowed ( ) {
360
+ if !self . tcx . features ( ) . const_let {
365
361
// Check for unused values. This usually means
366
362
// there are extra statements in the AST.
367
363
for temp in mir. temps_iter ( ) {
@@ -468,7 +464,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
468
464
LocalKind :: ReturnPointer => {
469
465
self . not_const ( ) ;
470
466
}
471
- LocalKind :: Var if !self . const_let_allowed ( ) => {
467
+ LocalKind :: Var if !self . tcx . features ( ) . const_let => {
472
468
if self . mode != Mode :: Fn {
473
469
emit_feature_err ( & self . tcx . sess . parse_sess , "const_let" ,
474
470
self . span , GateIssue :: Language ,
@@ -561,7 +557,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
561
557
this. not_const ( )
562
558
} else {
563
559
// just make sure this doesn't get promoted
564
- this. qualif . add ( Qualif :: NOT_CONST ) ;
560
+ this. add ( Qualif :: NOT_CONST ) ;
565
561
}
566
562
let base_ty = proj. base . ty ( this. mir , this. tcx ) . to_ty ( this. tcx ) ;
567
563
match this. mode {
@@ -1168,7 +1164,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
1168
1164
if let ( Mode :: ConstFn , & Place :: Local ( index) ) = ( self . mode , dest) {
1169
1165
if self . mir . local_kind ( index) == LocalKind :: Var &&
1170
1166
self . const_fn_arg_vars . insert ( index) &&
1171
- !self . const_let_allowed ( ) {
1167
+ !self . tcx . features ( ) . const_let {
1172
1168
// Direct use of an argument is permitted.
1173
1169
match * rvalue {
1174
1170
Rvalue :: Use ( Operand :: Copy ( Place :: Local ( local) ) ) |
0 commit comments