From a3a8ad8bc45d87607493d3c07d7e89e54f7b8c11 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Oct 2020 17:38:21 +0200 Subject: Don't rely on display names in inlay_hints --- crates/assists/src/handlers/fill_match_arms.rs | 2 +- crates/assists/src/handlers/generate_from_impl_for_enum.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/assists/src/handlers') diff --git a/crates/assists/src/handlers/fill_match_arms.rs b/crates/assists/src/handlers/fill_match_arms.rs index 676f5ad92..eda45f5b3 100644 --- a/crates/assists/src/handlers/fill_match_arms.rs +++ b/crates/assists/src/handlers/fill_match_arms.rs @@ -59,7 +59,7 @@ pub(crate) fn fill_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option< .filter(|variant_pat| is_variant_missing(&mut arms, variant_pat)) .map(|pat| make::match_arm(iter::once(pat), make::expr_empty_block())) .collect::>(); - if Some(enum_def) == FamousDefs(&ctx.sema, module.krate()).core_option_Option() { + if Some(enum_def) == FamousDefs(&ctx.sema, Some(module.krate())).core_option_Option() { // Match `Some` variant first. mark::hit!(option_order); variants.reverse() diff --git a/crates/assists/src/handlers/generate_from_impl_for_enum.rs b/crates/assists/src/handlers/generate_from_impl_for_enum.rs index 7f04b9572..674e5a175 100644 --- a/crates/assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/assists/src/handlers/generate_from_impl_for_enum.rs @@ -75,7 +75,7 @@ fn existing_from_impl( let enum_ = variant.parent_enum(sema.db); let krate = enum_.module(sema.db).krate(); - let from_trait = FamousDefs(sema, krate).core_convert_From()?; + let from_trait = FamousDefs(sema, Some(krate)).core_convert_From()?; let enum_type = enum_.ty(sema.db); -- cgit v1.2.3