diff options
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/infer.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index 2b53b8297..9a7785c76 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs | |||
@@ -555,7 +555,7 @@ impl<'a> InferenceContext<'a> { | |||
555 | 555 | ||
556 | fn resolve_lang_item(&self, name: &str) -> Option<LangItemTarget> { | 556 | fn resolve_lang_item(&self, name: &str) -> Option<LangItemTarget> { |
557 | let krate = self.resolver.krate()?; | 557 | let krate = self.resolver.krate()?; |
558 | let name = SmolStr::new_inline_from_ascii(name.len(), name.as_bytes()); | 558 | let name = SmolStr::new_inline(name); |
559 | self.db.lang_item(krate, name) | 559 | self.db.lang_item(krate, name) |
560 | } | 560 | } |
561 | 561 | ||
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 27f0ed628..009b17a7f 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -129,8 +129,12 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
129 | debug!("impls_for_trait returned {} impls", result.len()); | 129 | debug!("impls_for_trait returned {} impls", result.len()); |
130 | result | 130 | result |
131 | } | 131 | } |
132 | fn impl_provided_for(&self, auto_trait_id: TraitId, struct_id: AdtId) -> bool { | 132 | fn impl_provided_for( |
133 | debug!("impl_provided_for {:?}, {:?}", auto_trait_id, struct_id); | 133 | &self, |
134 | auto_trait_id: TraitId, | ||
135 | application_ty: &chalk_ir::ApplicationTy<Interner>, | ||
136 | ) -> bool { | ||
137 | debug!("impl_provided_for {:?}, {:?}", auto_trait_id, application_ty); | ||
134 | false // FIXME | 138 | false // FIXME |
135 | } | 139 | } |
136 | fn associated_ty_value(&self, id: AssociatedTyValueId) -> Arc<AssociatedTyValue> { | 140 | fn associated_ty_value(&self, id: AssociatedTyValueId) -> Arc<AssociatedTyValue> { |
@@ -422,6 +426,7 @@ fn well_known_trait_from_lang_attr(name: &str) -> Option<WellKnownTrait> { | |||
422 | "fn_mut" => WellKnownTrait::FnMut, | 426 | "fn_mut" => WellKnownTrait::FnMut, |
423 | "fn" => WellKnownTrait::Fn, | 427 | "fn" => WellKnownTrait::Fn, |
424 | "unsize" => WellKnownTrait::Unsize, | 428 | "unsize" => WellKnownTrait::Unsize, |
429 | "coerce_unsized" => WellKnownTrait::CoerceUnsized, | ||
425 | _ => return None, | 430 | _ => return None, |
426 | }) | 431 | }) |
427 | } | 432 | } |
@@ -437,6 +442,7 @@ fn lang_attr_from_well_known_trait(attr: WellKnownTrait) -> &'static str { | |||
437 | WellKnownTrait::Fn => "fn", | 442 | WellKnownTrait::Fn => "fn", |
438 | WellKnownTrait::Unsize => "unsize", | 443 | WellKnownTrait::Unsize => "unsize", |
439 | WellKnownTrait::Unpin => "unpin", | 444 | WellKnownTrait::Unpin => "unpin", |
445 | WellKnownTrait::CoerceUnsized => "coerce_unsized", | ||
440 | } | 446 | } |
441 | } | 447 | } |
442 | 448 | ||