Skip to content

Commit 59f634b

Browse files
committed
Update comments
1 parent 81b062a commit 59f634b

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

compiler/rustc_typeck/src/check/upvar.rs

+15-11
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
616616
reasons
617617
}
618618

619-
/// Returns true if migration is needed for trait for the provided var_hir_id
619+
/// Returns a tuple that contains the hir_id pointing to the use that resulted in the
620+
/// corresponding place being captured and a String which contains the captured value's name
621+
/// (i.e: a.b.c) if migration is needed for trait for the provided var_hir_id, otherwise returns None
620622
fn need_2229_migrations_for_trait(
621623
&self,
622624
min_captures: Option<&ty::RootVariableMinCaptureList<'tcx>>,
@@ -693,12 +695,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
693695
/// captured by the closure when `capture_disjoint_fields` is enabled and auto-traits
694696
/// differ between the root variable and the captured paths.
695697
///
696-
/// The output list would include a root variable if:
697-
/// - It would have been captured into the closure when `capture_disjoint_fields` wasn't
698-
/// enabled, **and**
699-
/// - It wasn't completely captured by the closure, **and**
700-
/// - One of the paths captured does not implement all the auto-traits its root variable
701-
/// implements.
698+
/// Returns a tuple containing a HashSet of traits that not implemented by the captured fields
699+
/// of a root variables that has the provided var_hir_id and a HashSet of tuples that contains
700+
/// the hir_id pointing to the use that resulted in the corresponding place being captured and
701+
/// a String which contains the captured value's name (i.e: a.b.c) if migration is needed for
702+
/// trait for the provided var_hir_id, otherwise returns None
702703
fn compute_2229_migrations_for_trait(
703704
&self,
704705
min_captures: Option<&ty::RootVariableMinCaptureList<'tcx>>,
@@ -788,8 +789,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
788789
/// - It wasn't completely captured by the closure, **and**
789790
/// - One of the paths starting at this root variable, that is not captured needs Drop.
790791
///
791-
/// This function only returns true for significant drops. A type is considerent to have a
792-
/// significant drop if it's Drop implementation is not annotated by `rustc_insignificant_dtor`.
792+
/// This function only returns a HashSet of tuples for significant drops. The returned HashSet
793+
/// of tuples contains the hir_id pointing to the use that resulted in the corresponding place
794+
/// being captured anda String which contains the captured value's name (i.e: a.b.c)
793795
fn compute_2229_migrations_for_drop(
794796
&self,
795797
closure_def_id: DefId,
@@ -871,8 +873,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
871873
/// - One of the paths captured does not implement all the auto-traits its root variable
872874
/// implements.
873875
///
874-
/// Returns a tuple containing a vector of HirIds as well as a String containing the reason
875-
/// why root variables whose HirId is contained in the vector should be fully captured.
876+
/// Returns a tuple containing a vector of tuples of HirIds and a HashSet of tuples that contains
877+
/// the hir_id pointing to the use that resulted in the corresponding place being captured and
878+
/// a String which contains the captured value's name (i.e: a.b.c), as well as a String
879+
/// containing the reason why root variables whose HirId is contained in the vector should
876880
fn compute_2229_migrations(
877881
&self,
878882
closure_def_id: DefId,

0 commit comments

Comments
 (0)