diff options
author | Lukas Wirth <[email protected]> | 2021-03-01 13:24:00 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-01 13:24:00 +0000 |
commit | 5d121cdb45f5199828ed64a2ca01a74998e023ad (patch) | |
tree | b2a941497dea3cc38adb6c55049668aa31b2554b /crates/hir_ty/src/autoderef.rs | |
parent | cda13d54613006c7985da0489878605300ba05b8 (diff) |
Introduce Ty::Alias
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r-- | crates/hir_ty/src/autoderef.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index 21d1e5446..be1fd1f13 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs | |||
@@ -81,7 +81,7 @@ fn deref_by_trait( | |||
81 | 81 | ||
82 | // Now do the assoc type projection | 82 | // Now do the assoc type projection |
83 | let projection = super::traits::ProjectionPredicate { | 83 | let projection = super::traits::ProjectionPredicate { |
84 | ty: Ty::Bound(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())), | 84 | ty: Ty::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())), |
85 | projection_ty: super::ProjectionTy { associated_ty: target, parameters }, | 85 | projection_ty: super::ProjectionTy { associated_ty: target, parameters }, |
86 | }; | 86 | }; |
87 | 87 | ||
@@ -114,7 +114,8 @@ fn deref_by_trait( | |||
114 | // new variables in that case | 114 | // new variables in that case |
115 | 115 | ||
116 | for i in 1..vars.0.kinds.len() { | 116 | for i in 1..vars.0.kinds.len() { |
117 | if vars.0.value[i - 1] != Ty::Bound(BoundVar::new(DebruijnIndex::INNERMOST, i - 1)) | 117 | if vars.0.value[i - 1] |
118 | != Ty::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, i - 1)) | ||
118 | { | 119 | { |
119 | warn!("complex solution for derefing {:?}: {:?}, ignoring", ty.value, solution); | 120 | warn!("complex solution for derefing {:?}: {:?}, ignoring", ty.value, solution); |
120 | return None; | 121 | return None; |