From 71cd67fe4708a83632a370f85a023d5938b586a4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Aug 2021 14:24:34 +0300 Subject: [PATCH] failing test --- .../src/completions/unqualified_path.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index 5d0eee08ee1..905ea648877 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs @@ -306,4 +306,25 @@ pub mod prelude { "#]], ); } + + #[test] + fn local_variable_shadowing() { + // FIXME: this isn't actually correct, should emit `x` only once. + check( + r#" +fn main() { + let x = 92; + { + let x = 92; + x$0; + } +} +"#, + expect![[r#" + lc x i32 + lc x i32 + fn main() fn() + "#]], + ); + } }