@@ -39,7 +39,7 @@ type QualifResults<'mir, 'tcx, Q> =
39
39
#[ derive( Default ) ]
40
40
pub struct Qualifs < ' mir , ' tcx > {
41
41
has_mut_interior : Option < QualifResults < ' mir , ' tcx , HasMutInterior > > ,
42
- needs_drop : Option < QualifResults < ' mir , ' tcx , NeedsNonConstDrop > > ,
42
+ needs_non_const_drop : Option < QualifResults < ' mir , ' tcx , NeedsNonConstDrop > > ,
43
43
indirectly_mutable : Option < IndirectlyMutableResults < ' mir , ' tcx > > ,
44
44
}
45
45
@@ -70,10 +70,10 @@ impl Qualifs<'mir, 'tcx> {
70
70
indirectly_mutable. get ( ) . contains ( local)
71
71
}
72
72
73
- /// Returns `true` if `local` is `NeedsDrop ` at the given `Location`.
73
+ /// Returns `true` if `local` is `NeedsNonConstDrop ` at the given `Location`.
74
74
///
75
75
/// Only updates the cursor if absolutely necessary
76
- pub fn needs_drop (
76
+ pub fn needs_non_const_drop (
77
77
& mut self ,
78
78
ccx : & ' mir ConstCx < ' mir , ' tcx > ,
79
79
local : Local ,
@@ -84,7 +84,7 @@ impl Qualifs<'mir, 'tcx> {
84
84
return false ;
85
85
}
86
86
87
- let needs_drop = self . needs_drop . get_or_insert_with ( || {
87
+ let needs_non_const_drop = self . needs_non_const_drop . get_or_insert_with ( || {
88
88
let ConstCx { tcx, body, .. } = * ccx;
89
89
90
90
FlowSensitiveAnalysis :: new ( NeedsNonConstDrop , ccx)
@@ -93,8 +93,8 @@ impl Qualifs<'mir, 'tcx> {
93
93
. into_results_cursor ( & body)
94
94
} ) ;
95
95
96
- needs_drop . seek_before_primary_effect ( location) ;
97
- needs_drop . get ( ) . contains ( local) || self . indirectly_mutable ( ccx, local, location)
96
+ needs_non_const_drop . seek_before_primary_effect ( location) ;
97
+ needs_non_const_drop . get ( ) . contains ( local) || self . indirectly_mutable ( ccx, local, location)
98
98
}
99
99
100
100
/// Returns `true` if `local` is `HasMutInterior` at the given `Location`.
@@ -172,7 +172,7 @@ impl Qualifs<'mir, 'tcx> {
172
172
} ;
173
173
174
174
ConstQualifs {
175
- needs_drop : self . needs_drop ( ccx, RETURN_PLACE , return_loc) ,
175
+ needs_non_const_drop : self . needs_non_const_drop ( ccx, RETURN_PLACE , return_loc) ,
176
176
has_mut_interior : self . has_mut_interior ( ccx, RETURN_PLACE , return_loc) ,
177
177
custom_eq,
178
178
error_occured,
@@ -999,7 +999,7 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
999
999
}
1000
1000
1001
1001
// Forbid all `Drop` terminators unless the place being dropped is a local with no
1002
- // projections that cannot be `NeedsDrop `.
1002
+ // projections that cannot be `NeedsNonConstDrop `.
1003
1003
TerminatorKind :: Drop { place : dropped_place, .. }
1004
1004
| TerminatorKind :: DropAndReplace { place : dropped_place, .. } => {
1005
1005
// If we are checking live drops after drop-elaboration, don't emit duplicate
@@ -1019,15 +1019,15 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
1019
1019
return ;
1020
1020
}
1021
1021
1022
- let needs_drop = if let Some ( local) = dropped_place. as_local ( ) {
1022
+ let needs_non_const_drop = if let Some ( local) = dropped_place. as_local ( ) {
1023
1023
// Use the span where the local was declared as the span of the drop error.
1024
1024
err_span = self . body . local_decls [ local] . source_info . span ;
1025
- self . qualifs . needs_drop ( self . ccx , local, location)
1025
+ self . qualifs . needs_non_const_drop ( self . ccx , local, location)
1026
1026
} else {
1027
1027
true
1028
1028
} ;
1029
1029
1030
- if needs_drop {
1030
+ if needs_non_const_drop {
1031
1031
self . check_op_spanned (
1032
1032
ops:: LiveDrop { dropped_at : Some ( terminator. source_info . span ) } ,
1033
1033
err_span,
0 commit comments