mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix stable iteration ordering for Map<Name, ...>
usages
This commit is contained in:
parent
f2d51073d2
commit
cde0f69cae
11 changed files with 55 additions and 29 deletions
|
@ -259,7 +259,7 @@ pub(super) fn add_call_parens<'b>(
|
|||
|
||||
fn ref_of_param(ctx: &CompletionContext<'_>, arg: &str, ty: &hir::Type) -> &'static str {
|
||||
if let Some(derefed_ty) = ty.remove_ref() {
|
||||
for (name, local) in ctx.locals.iter() {
|
||||
for (name, local) in ctx.locals.iter().sorted_by_key(|&(k, _)| k.clone()) {
|
||||
if name.as_str() == arg {
|
||||
return if local.ty(ctx.db) == derefed_ty {
|
||||
if ty.is_mutable_reference() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue