diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-23 22:32:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-23 22:32:47 +0000 |
commit | aa38fa1c72673cb2470651025782fb0fcfad738c (patch) | |
tree | 7cd0ee2dfd328dd31db7ef7c25ebf3f4a8361e5f /crates/ide/src | |
parent | a307e4f31f3a66797628cee0645a38216398d9bd (diff) | |
parent | 9e8f4d31a40eca605a047ed95a98aac43a3e327f (diff) |
Merge #7772
7772: Pickup ConstReference patterns in FindUsages r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/references.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 55f95ebae..5d0449e56 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -1224,4 +1224,29 @@ fn test() {} | |||
1224 | "#]], | 1224 | "#]], |
1225 | ); | 1225 | ); |
1226 | } | 1226 | } |
1227 | |||
1228 | #[test] | ||
1229 | fn test_const_in_pattern() { | ||
1230 | check( | ||
1231 | r#" | ||
1232 | const A$0: i32 = 42; | ||
1233 | |||
1234 | fn main() { | ||
1235 | match A { | ||
1236 | A => (), | ||
1237 | _ => (), | ||
1238 | } | ||
1239 | if let A = A {} | ||
1240 | } | ||
1241 | "#, | ||
1242 | expect![[r#" | ||
1243 | A Const FileId(0) 0..18 6..7 | ||
1244 | |||
1245 | FileId(0) 42..43 | ||
1246 | FileId(0) 54..55 | ||
1247 | FileId(0) 97..98 | ||
1248 | FileId(0) 101..102 | ||
1249 | "#]], | ||
1250 | ); | ||
1251 | } | ||
1227 | } | 1252 | } |