From de28f30d815216d2a20cb84687b0ccab2911f727 Mon Sep 17 00:00:00 2001 From: Slanterns Date: Thu, 15 Aug 2024 01:22:42 +0800 Subject: [PATCH 1/2] fix r-a --- crates/hir-ty/src/display.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/hir-ty/src/display.rs b/crates/hir-ty/src/display.rs index a433ecfd77..f6f90faa4e 100644 --- a/crates/hir-ty/src/display.rs +++ b/crates/hir-ty/src/display.rs @@ -1462,7 +1462,7 @@ fn generic_args_sans_defaults<'ga>( // otherwise, if the arg is equal to the param default, hide it (unless the // default is an error which can happen for the trait Self type) #[allow(unstable_name_collisions)] - default_parameters.get(i).is_none_or(|default_parameter| { + IsNoneOr::is_none_or(default_parameters.get(i), |default_parameter| { // !is_err(default_parameter.skip_binders()) // && arg != &default_parameter.clone().substitute(Interner, ¶meters) From 40731f4bd6980a885807b067a832c432f572a916 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 10 Aug 2024 14:49:26 +0200 Subject: [PATCH 2/2] rust-analyzer: use in-tree pattern_analysis crate --- crates/hir-ty/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/hir-ty/src/lib.rs b/crates/hir-ty/src/lib.rs index 4c9e0a1e11..21c84511dc 100644 --- a/crates/hir-ty/src/lib.rs +++ b/crates/hir-ty/src/lib.rs @@ -15,8 +15,10 @@ extern crate rustc_abi; #[cfg(not(feature = "in-rust-tree"))] extern crate ra_ap_rustc_abi as rustc_abi; -// Use the crates.io version unconditionally until the API settles enough that we can switch to -// using the in-tree one. +#[cfg(feature = "in-rust-tree")] +extern crate rustc_pattern_analysis; + +#[cfg(not(feature = "in-rust-tree"))] extern crate ra_ap_rustc_pattern_analysis as rustc_pattern_analysis; mod builder;