diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-06 00:05:39 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-06 00:05:39 +0800 |
commit | b439fff0adca76dbe1f9b3d3218d8f710f282fc2 (patch) | |
tree | fb8d404dfc9e5d7ab0013dbbdcb95e91f13d5778 /src | |
parent | d17d5052766c3cec96bb226efcb60c367b7484f7 (diff) | |
download | mrust-b439fff0adca76dbe1f9b3d3218d8f710f282fc2.tar.gz |
HIR Typecheck CS - Type possibility from src->dst of borrow
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index c304654b..7bbfb847 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2030,6 +2030,14 @@ namespace { return false; ) + TU_IFLET(::HIR::TypeRef::Data, ty_dst.m_data, Infer, l_e, + if( l_e.ty_class == ::HIR::InferClass::None ) { + context.possible_equate_type(l_e.index, ty_src); + return false; + } + // - Otherwise, it could be a deref? + ) + // Deref coercions { ::HIR::TypeRef tmp_ty; @@ -2064,7 +2072,7 @@ namespace { } // Either ran out of deref, or hit a _ } - + // - If `right`: ::core::marker::Unsize<`left`> // - If left can be dereferenced to right // - If left is a slice, right can unsize/deref (Defunct?) |