diff options
author | Lukas Wirth <[email protected]> | 2021-05-08 21:34:55 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-05-08 21:34:55 +0100 |
commit | 41f470fea84998af65292f3c297c3e2b1d897848 (patch) | |
tree | 2dee702ff58dd614a559e9f4ef3080419cabd2c4 /crates/ide/src/references | |
parent | 96c5df9b171730ad69e130e074584684cee35014 (diff) |
Correctly support SelfType when searching for usages
Diffstat (limited to 'crates/ide/src/references')
-rw-r--r-- | crates/ide/src/references/rename.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 175e7a31d..2bf953305 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
@@ -1888,4 +1888,21 @@ impl Foo { | |||
1888 | "error: Cannot rename `Self`", | 1888 | "error: Cannot rename `Self`", |
1889 | ); | 1889 | ); |
1890 | } | 1890 | } |
1891 | |||
1892 | #[test] | ||
1893 | fn test_rename_ignores_self_ty() { | ||
1894 | check( | ||
1895 | "Fo0", | ||
1896 | r#" | ||
1897 | struct $0Foo; | ||
1898 | |||
1899 | impl Foo where Self: {} | ||
1900 | "#, | ||
1901 | r#" | ||
1902 | struct Fo0; | ||
1903 | |||
1904 | impl Fo0 where Self: {} | ||
1905 | "#, | ||
1906 | ); | ||
1907 | } | ||
1891 | } | 1908 | } |