aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-10 17:43:06 +0000
committerGitHub <[email protected]>2021-02-10 17:43:06 +0000
commitb0f20a795d6b1f8d36d1cbe294e54ac592b98f5e (patch)
treea66764b7ea57775f4241ad4f89577c293a0abf15 /crates
parent612e6843f1724a136e4482bb8497709ccde86013 (diff)
parent925c51aef3468df180dce76cbc68bcea87d8a798 (diff)
Merge #7631
7631: Add test for #1165 r=jonas-schievink a=jonas-schievink Closes #1165 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_ty/src/tests/simple.rs29
1 files changed, 29 insertions, 0 deletions
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() {
2462 "#]], 2462 "#]],
2463 ); 2463 );
2464} 2464}
2465
2466#[test]
2467fn inner_use_enum_rename() {
2468 check_infer(
2469 r#"
2470 enum Request {
2471 Info
2472 }
2473
2474 fn f() {
2475 use Request as R;
2476
2477 let r = R::Info;
2478 match r {
2479 R::Info => {}
2480 }
2481 }
2482 "#,
2483 expect![[r#"
2484 34..123 '{ ... } }': ()
2485 67..68 'r': Request
2486 71..78 'R::Info': Request
2487 84..121 'match ... }': ()
2488 90..91 'r': Request
2489 102..109 'R::Info': Request
2490 113..115 '{}': ()
2491 "#]],
2492 )
2493}