From 925c51aef3468df180dce76cbc68bcea87d8a798 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 10 Feb 2021 18:42:35 +0100 Subject: Add test for #1165 Closes #1165 --- crates/hir_ty/src/tests/simple.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index 20ceb7415..12ec4657b 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -2462,3 +2462,32 @@ fn infer_nested_inner_type() { "#]], ); } + +#[test] +fn inner_use_enum_rename() { + check_infer( + r#" + enum Request { + Info + } + + fn f() { + use Request as R; + + let r = R::Info; + match r { + R::Info => {} + } + } + "#, + expect![[r#" + 34..123 '{ ... } }': () + 67..68 'r': Request + 71..78 'R::Info': Request + 84..121 'match ... }': () + 90..91 'r': Request + 102..109 'R::Info': Request + 113..115 '{}': () + "#]], + ) +} -- cgit v1.2.3