diff options
Diffstat (limited to 'crates/ra_hir/src/ty/traits/chalk.rs')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index bee35fa62..f36ff2fc6 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -239,15 +239,28 @@ where | |||
239 | impl ToChalk for Arc<super::Environment> { | 239 | impl ToChalk for Arc<super::Environment> { |
240 | type Chalk = Arc<chalk_ir::Environment>; | 240 | type Chalk = Arc<chalk_ir::Environment>; |
241 | 241 | ||
242 | fn to_chalk(self, _db: &impl HirDatabase) -> Arc<chalk_ir::Environment> { | 242 | fn to_chalk(self, db: &impl HirDatabase) -> Arc<chalk_ir::Environment> { |
243 | chalk_ir::Environment::new() | 243 | let mut clauses = Vec::new(); |
244 | for pred in &self.predicates { | ||
245 | if pred.is_error() { | ||
246 | // for env, we just ignore errors | ||
247 | continue; | ||
248 | } | ||
249 | if let GenericPredicate::Implemented(trait_ref) = pred { | ||
250 | if blacklisted_trait(db, trait_ref.trait_) { | ||
251 | continue; | ||
252 | } | ||
253 | } | ||
254 | clauses.push(pred.clone().to_chalk(db).cast()); | ||
255 | } | ||
256 | chalk_ir::Environment::new().add_clauses(clauses) | ||
244 | } | 257 | } |
245 | 258 | ||
246 | fn from_chalk( | 259 | fn from_chalk( |
247 | _db: &impl HirDatabase, | 260 | _db: &impl HirDatabase, |
248 | _env: Arc<chalk_ir::Environment>, | 261 | _env: Arc<chalk_ir::Environment>, |
249 | ) -> Arc<super::Environment> { | 262 | ) -> Arc<super::Environment> { |
250 | Arc::new(super::Environment) | 263 | unimplemented!() |
251 | } | 264 | } |
252 | } | 265 | } |
253 | 266 | ||