aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/tests.rs36
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 c856d6afd..a3cc5cf95 100644
--- a/crates/ra_hir_ty/src/tests.rs
+++ b/crates/ra_hir_ty/src/tests.rs
@@ -3694,6 +3694,42 @@ fn main() {
3694} 3694}
3695 3695
3696#[test] 3696#[test]
3697fn not_shadowing_primitive_by_module() {
3698 let t = type_at(
3699 r#"
3700//- /str.rs
3701fn foo() {}
3702
3703//- /main.rs
3704mod str;
3705fn foo() -> &'static str { "" }
3706
3707fn main() {
3708 foo()<|>;
3709}"#,
3710 );
3711 assert_eq!(t, "&str");
3712}
3713
3714#[test]
3715fn not_shadowing_module_by_primitive() {
3716 let t = type_at(
3717 r#"
3718//- /str.rs
3719fn foo() -> u32 {0}
3720
3721//- /main.rs
3722mod str;
3723fn foo() -> &'static str { "" }
3724
3725fn main() {
3726 str::foo()<|>;
3727}"#,
3728 );
3729 assert_eq!(t, "u32");
3730}
3731
3732#[test]
3697fn deref_trait() { 3733fn deref_trait() {
3698 let t = type_at( 3734 let t = type_at(
3699 r#" 3735 r#"