@@ -41,16 +41,13 @@ bitflags::bitflags! {
41
41
// Constant containing an ADT that implements Drop.
42
42
const NEEDS_DROP = 1 << 1 ;
43
43
44
- // Function argument.
45
- const FN_ARGUMENT = 1 << 2 ;
46
-
47
44
// Not constant at all - non-`const fn` calls, asm!,
48
45
// pointer comparisons, ptr-to-int casts, etc.
49
- const NOT_CONST = 1 << 3 ;
46
+ const NOT_CONST = 1 << 2 ;
50
47
51
48
// Refers to temporaries which cannot be promoted as
52
49
// promote_consts decided they weren't simple enough.
53
- const NOT_PROMOTABLE = 1 << 4 ;
50
+ const NOT_PROMOTABLE = 1 << 3 ;
54
51
55
52
// Const items can only have MUTABLE_INTERIOR
56
53
// and NOT_PROMOTABLE without producing an error.
@@ -136,10 +133,6 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx> {
136
133
let mut qualif = self . local_qualif [ local]
137
134
. unwrap_or ( Qualif :: NOT_CONST ) ;
138
135
139
- if let LocalKind :: Arg = kind {
140
- qualif = qualif | Qualif :: FN_ARGUMENT ;
141
- }
142
-
143
136
if !self . temp_promotion_state [ local] . is_promotable ( ) {
144
137
qualif = qualif | Qualif :: NOT_PROMOTABLE ;
145
138
}
@@ -498,9 +491,8 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
498
491
499
492
let mut local_qualif = IndexVec :: from_elem ( None , & mir. local_decls ) ;
500
493
for arg in mir. args_iter ( ) {
501
- let mut qualif = Qualif :: NEEDS_DROP ;
502
- qualif. restrict ( mir. local_decls [ arg] . ty , tcx, param_env) ;
503
- local_qualif[ arg] = Some ( qualif) ;
494
+ let qualif = Qualif :: for_ty ( mir. local_decls [ arg] . ty , tcx, param_env) ;
495
+ local_qualif[ arg] = Some ( Qualif :: NOT_PROMOTABLE | qualif) ;
504
496
}
505
497
506
498
Checker {
0 commit comments