diff options
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index abbc1546c..3766ab981 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -3642,6 +3642,42 @@ fn main() { | |||
3642 | } | 3642 | } |
3643 | 3643 | ||
3644 | #[test] | 3644 | #[test] |
3645 | fn not_shadowing_primitive_by_module() { | ||
3646 | let t = type_at( | ||
3647 | r#" | ||
3648 | //- /str.rs | ||
3649 | fn foo() {} | ||
3650 | |||
3651 | //- /main.rs | ||
3652 | mod str; | ||
3653 | fn foo() -> &'static str { "" } | ||
3654 | |||
3655 | fn main() { | ||
3656 | foo()<|>; | ||
3657 | }"#, | ||
3658 | ); | ||
3659 | assert_eq!(t, "&str"); | ||
3660 | } | ||
3661 | |||
3662 | #[test] | ||
3663 | fn not_shadowing_module_by_primitive() { | ||
3664 | let t = type_at( | ||
3665 | r#" | ||
3666 | //- /str.rs | ||
3667 | fn foo() -> u32 {0} | ||
3668 | |||
3669 | //- /main.rs | ||
3670 | mod str; | ||
3671 | fn foo() -> &'static str { "" } | ||
3672 | |||
3673 | fn main() { | ||
3674 | str::foo()<|>; | ||
3675 | }"#, | ||
3676 | ); | ||
3677 | assert_eq!(t, "u32"); | ||
3678 | } | ||
3679 | |||
3680 | #[test] | ||
3645 | fn deref_trait() { | 3681 | fn deref_trait() { |
3646 | let t = type_at( | 3682 | let t = type_at( |
3647 | r#" | 3683 | r#" |