Auto merge of #14551 - lowr:patch/no-unstable-item-compl-on-stable, r=Veykril

Fix faulty variable extraction

Followup to #14549

Fixes https://github.com/rust-lang/rust-analyzer/pull/14549#discussion_r1163128814 and https://github.com/rust-lang/rust-analyzer/pull/14549#discussion_r1163132104
This commit is contained in:
bors 2023-04-11 17:43:15 +00:00
commit 7501d3b721

View File

@ -267,10 +267,10 @@ fn import_on_the_fly(
.into_iter()
.filter(ns_filter)
.filter(|import| {
let item = &import.item_to_import;
!ctx.is_item_hidden(item)
&& !ctx.is_item_hidden(item)
&& ctx.check_stability(item.attrs(ctx.db).as_deref())
let original_item = &import.original_item;
!ctx.is_item_hidden(&import.item_to_import)
&& !ctx.is_item_hidden(original_item)
&& ctx.check_stability(original_item.attrs(ctx.db).as_deref())
})
.sorted_by_key(|located_import| {
compute_fuzzy_completion_order_key(
@ -317,10 +317,10 @@ fn import_on_the_fly_pat_(
.into_iter()
.filter(ns_filter)
.filter(|import| {
let item = &import.item_to_import;
!ctx.is_item_hidden(item)
&& !ctx.is_item_hidden(item)
&& ctx.check_stability(item.attrs(ctx.db).as_deref())
let original_item = &import.original_item;
!ctx.is_item_hidden(&import.item_to_import)
&& !ctx.is_item_hidden(original_item)
&& ctx.check_stability(original_item.attrs(ctx.db).as_deref())
})
.sorted_by_key(|located_import| {
compute_fuzzy_completion_order_key(