diff options
author | Jonas Schievink <[email protected]> | 2021-02-10 17:42:35 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-02-10 17:42:35 +0000 |
commit | 925c51aef3468df180dce76cbc68bcea87d8a798 (patch) | |
tree | a66764b7ea57775f4241ad4f89577c293a0abf15 /crates/hir_ty/src | |
parent | 612e6843f1724a136e4482bb8497709ccde86013 (diff) |
Add test for #1165
Closes #1165
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/tests/simple.rs | 29 |
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] | ||
2467 | fn 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 | } | ||