aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-01 19:41:06 +0100
committerGitHub <[email protected]>2020-07-01 19:41:06 +0100
commita33eefa3b26000b3018e6bb873f18dbe15ab4ab7 (patch)
treeda55aac24be34db6750e6675673317f52e7db4dc /crates/ra_hir
parentec1d1a1b709a6eafff07077cdf75291d01cda3b6 (diff)
parentd5d485ef9289589332893f2c0ad96cb366afe9d6 (diff)
Merge #5149
5149: Implement Chalk variable kinds r=flodiebold a=flodiebold This means we need to keep track of the kinds (general/int/float) of variables in `Canonical`, which requires some more ceremony. (It also exposes some places where we're not really dealing with canonicalization correctly -- another thing to be cleaned up when we switch to using Chalk's types directly.) Should fix the last remaining issue of #2534. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index cc72964ff..1b3525011 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -1189,7 +1189,7 @@ impl Type {
1189 None => return false, 1189 None => return false,
1190 }; 1190 };
1191 1191
1192 let canonical_ty = Canonical { value: self.ty.value.clone(), num_vars: 0 }; 1192 let canonical_ty = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) };
1193 method_resolution::implements_trait( 1193 method_resolution::implements_trait(
1194 &canonical_ty, 1194 &canonical_ty,
1195 db, 1195 db,
@@ -1213,7 +1213,7 @@ impl Type {
1213 self.ty.environment.clone(), 1213 self.ty.environment.clone(),
1214 hir_ty::Obligation::Trait(trait_ref), 1214 hir_ty::Obligation::Trait(trait_ref),
1215 ), 1215 ),
1216 num_vars: 0, 1216 kinds: Arc::new([]),
1217 }; 1217 };
1218 1218
1219 db.trait_solve(self.krate, goal).is_some() 1219 db.trait_solve(self.krate, goal).is_some()
@@ -1288,7 +1288,7 @@ impl Type {
1288 pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a { 1288 pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a {
1289 // There should be no inference vars in types passed here 1289 // There should be no inference vars in types passed here
1290 // FIXME check that? 1290 // FIXME check that?
1291 let canonical = Canonical { value: self.ty.value.clone(), num_vars: 0 }; 1291 let canonical = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) };
1292 let environment = self.ty.environment.clone(); 1292 let environment = self.ty.environment.clone();
1293 let ty = InEnvironment { value: canonical, environment }; 1293 let ty = InEnvironment { value: canonical, environment };
1294 autoderef(db, Some(self.krate), ty) 1294 autoderef(db, Some(self.krate), ty)
@@ -1329,7 +1329,7 @@ impl Type {
1329 // There should be no inference vars in types passed here 1329 // There should be no inference vars in types passed here
1330 // FIXME check that? 1330 // FIXME check that?
1331 // FIXME replace Unknown by bound vars here 1331 // FIXME replace Unknown by bound vars here
1332 let canonical = Canonical { value: self.ty.value.clone(), num_vars: 0 }; 1332 let canonical = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) };
1333 1333
1334 let env = self.ty.environment.clone(); 1334 let env = self.ty.environment.clone();
1335 let krate = krate.id; 1335 let krate = krate.id;
@@ -1360,7 +1360,7 @@ impl Type {
1360 // There should be no inference vars in types passed here 1360 // There should be no inference vars in types passed here
1361 // FIXME check that? 1361 // FIXME check that?
1362 // FIXME replace Unknown by bound vars here 1362 // FIXME replace Unknown by bound vars here
1363 let canonical = Canonical { value: self.ty.value.clone(), num_vars: 0 }; 1363 let canonical = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) };
1364 1364
1365 let env = self.ty.environment.clone(); 1365 let env = self.ty.environment.clone();
1366 let krate = krate.id; 1366 let krate = krate.id;