Skip to content

Commit

Permalink
Add ConstraintLocator docs
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 23, 2021
1 parent d714107 commit c79df85
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion compiler/rustc_typeck/src/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,15 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {

struct ConstraintLocator<'tcx> {
tcx: TyCtxt<'tcx>,

/// def_id of the opaque type whose defining uses are being checked
def_id: DefId,
// (first found type span, actual type)

/// as we walk the defining uses, we are checking that all of them
/// define the same hidden type. This variable is set to `Some`
/// with the first type that we find, and then later types are
/// checked against it (we also carry the span of that first
/// type).
found: Option<(Span, Ty<'tcx>)>,
}

Expand Down

0 comments on commit c79df85

Please sign in to comment.