From 41f470fea84998af65292f3c297c3e2b1d897848 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 8 May 2021 22:34:55 +0200 Subject: Correctly support SelfType when searching for usages --- crates/ide/src/references/rename.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ide/src/references') 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 { "error: Cannot rename `Self`", ); } + + #[test] + fn test_rename_ignores_self_ty() { + check( + "Fo0", + r#" +struct $0Foo; + +impl Foo where Self: {} +"#, + r#" +struct Fo0; + +impl Fo0 where Self: {} +"#, + ); + } } -- cgit v1.2.3