File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
compiler/rustc_typeck/src/check/generator_interior Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,15 @@ use crate::expr_use_visitor;
34
34
/// record the parent expression, which is the point where the drop actually takes place.
35
35
pub struct ExprUseDelegate < ' tcx > {
36
36
hir : Map < ' tcx > ,
37
- /// Maps a HirId to a set of HirIds that are dropped by that node.
37
+ /// Records the point at which an expression or local variable is dropped.
38
+ ///
39
+ /// The key is the hir-id of the expression, and the value is a set or hir-ids for variables
40
+ /// or values that are consumed by that expression.
41
+ ///
42
+ /// Note that this set excludes "partial drops" -- for example, a statement like `drop(x.y)` is
43
+ /// not considered a drop of `x`.
38
44
consumed_places : HirIdMap < HirIdSet > ,
45
+ /// A set of hir-ids of values or variables that are borrowed at some point within the body.
39
46
borrowed_places : HirIdSet ,
40
47
}
41
48
@@ -114,6 +121,8 @@ fn place_hir_id(place: &Place<'_>) -> Option<HirId> {
114
121
pub struct DropRangeVisitor < ' tcx > {
115
122
hir : Map < ' tcx > ,
116
123
/// Maps a HirId to a set of HirIds that are dropped by that node.
124
+ ///
125
+ /// See also the more detailed comment on `ExprUseDelegate.consumed_places`.
117
126
consumed_places : HirIdMap < HirIdSet > ,
118
127
borrowed_places : HirIdSet ,
119
128
drop_ranges : DropRanges ,
You can’t perform that action at this time.
0 commit comments