Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
-rw-r--r--crates/ide/src/goto_definition.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index bdafb701ff..60a904233a 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -3290,4 +3290,38 @@ fn main() {
"#,
);
}
+
+ #[test]
+ fn shadow_builtin_type_by_module() {
+ check(
+ r#"
+mod Foo{
+pub mod str {
+ // ^^^
+ pub fn foo() {}
+}
+}
+
+fn main() {
+ use Foo::str;
+ let s = st$0r::foo();
+}
+"#,
+ );
+ }
+
+ #[test]
+ fn not_goto_module_because_str_is_builtin_type() {
+ check(
+ r#"
+mod str {
+pub fn foo() {}
+}
+
+fn main() {
+ let s = st$0r::f();
+}
+"#,
+ );
+ }
}