Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/rename.rs')
-rw-r--r--crates/ide/src/rename.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/crates/ide/src/rename.rs b/crates/ide/src/rename.rs
index 3d7ff5f76a..3e8295e3f0 100644
--- a/crates/ide/src/rename.rs
+++ b/crates/ide/src/rename.rs
@@ -2001,13 +2001,11 @@ impl Foo {
"foo",
r#"
fn f($0self) -> i32 {
- use self as _;
self.i
}
"#,
r#"
fn f(foo: _) -> i32 {
- use self as _;
foo.i
}
"#,
@@ -2015,6 +2013,26 @@ fn f(foo: _) -> i32 {
}
#[test]
+ fn no_type_value_ns_confuse() {
+ // Test that we don't rename items from different namespaces.
+ check(
+ "bar",
+ r#"
+struct foo {}
+fn f(foo$0: i32) -> i32 {
+ use foo as _;
+}
+"#,
+ r#"
+struct foo {}
+fn f(bar: i32) -> i32 {
+ use foo as _;
+}
+"#,
+ );
+ }
+
+ #[test]
fn test_self_in_path_to_parameter() {
check(
"foo",