about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2021-07-22 18:24:20 -0300
committerSantiago Pastorino <spastorino@gmail.com>2021-07-23 08:55:31 -0300
commitc79df8563b805732d6d04767a7d57384f57fcb0e (patch)
tree99ed2d355f547f412918c0e03a8aa38a0e056b16 /compiler
parentd71410757d1e44dbcfb83ad2cfe75d687c695b91 (diff)
downloadrust-c79df8563b805732d6d04767a7d57384f57fcb0e.tar.gz
rust-c79df8563b805732d6d04767a7d57384f57fcb0e.zip
Add ConstraintLocator docs
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/collect/type_of.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs
index 8029a7dc0e3..50e4ba4fe6c 100644
--- a/compiler/rustc_typeck/src/collect/type_of.rs
+++ b/compiler/rustc_typeck/src/collect/type_of.rs
@@ -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>)>,
     }