about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2018-12-19 02:05:34 +0200
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2018-12-19 02:05:34 +0200
commit5b7443810794aa9f771ea26a5e72ae2b567481b0 (patch)
tree317fedc5a79bbd6d1893ba79b4a11685d51a7b5b
parenteeb8c8d59c1ca43999a6d7bd5f46a0a54971303f (diff)
add comment about subtyping
-rw-r--r--src/librustc_typeck/check/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index a8711d73af8..872c494e633 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -2744,6 +2744,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
         );
         match self_ty.sty {
             ty::Infer(ty::TyVar(found_vid)) => {
+                // FIXME: consider using `sub_root_var` here so we
+                // can see through subtyping.
                 let found_vid = self.root_var(found_vid);
                 debug!("self_type_matches_expected_vid - found_vid={:?}", found_vid);
                 expected_vid == found_vid
@@ -2756,6 +2758,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
         -> impl Iterator<Item=(ty::PolyTraitRef<'tcx>, traits::PredicateObligation<'tcx>)>
            + Captures<'gcx> + 'b
     {
+        // FIXME: consider using `sub_root_var` here so we
+        // can see through subtyping.
         let ty_var_root = self.root_var(self_ty);
         debug!("obligations_for_self_ty: self_ty={:?} ty_var_root={:?} pending_obligations={:?}",
                self_ty, ty_var_root,