Skip to content

Commit c79df85

Browse files
committed
Add ConstraintLocator docs
1 parent d714107 commit c79df85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_typeck/src/collect/type_of.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,15 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
512512

513513
struct ConstraintLocator<'tcx> {
514514
tcx: TyCtxt<'tcx>,
515+
516+
/// def_id of the opaque type whose defining uses are being checked
515517
def_id: DefId,
516-
// (first found type span, actual type)
518+
519+
/// as we walk the defining uses, we are checking that all of them
520+
/// define the same hidden type. This variable is set to `Some`
521+
/// with the first type that we find, and then later types are
522+
/// checked against it (we also carry the span of that first
523+
/// type).
517524
found: Option<(Span, Ty<'tcx>)>,
518525
}
519526

0 commit comments

Comments
 (0)