diff options
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/references/rename.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 56e923841..cd721b7eb 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
@@ -1488,4 +1488,39 @@ impl<'yeeee> Foo<'yeeee> for &'yeeee () { | |||
1488 | "#, | 1488 | "#, |
1489 | ) | 1489 | ) |
1490 | } | 1490 | } |
1491 | |||
1492 | #[test] | ||
1493 | fn test_rename_bind_pat() { | ||
1494 | check( | ||
1495 | "new_name", | ||
1496 | r#" | ||
1497 | fn main() { | ||
1498 | enum CustomOption<T> { | ||
1499 | None, | ||
1500 | Some(T), | ||
1501 | } | ||
1502 | |||
1503 | let test_variable = CustomOption::Some(22); | ||
1504 | |||
1505 | match test_variable { | ||
1506 | CustomOption::Some(foo<|>) if foo == 11 => {} | ||
1507 | _ => (), | ||
1508 | } | ||
1509 | }"#, | ||
1510 | r#" | ||
1511 | fn main() { | ||
1512 | enum CustomOption<T> { | ||
1513 | None, | ||
1514 | Some(T), | ||
1515 | } | ||
1516 | |||
1517 | let test_variable = CustomOption::Some(22); | ||
1518 | |||
1519 | match test_variable { | ||
1520 | CustomOption::Some(new_name) if new_name == 11 => {} | ||
1521 | _ => (), | ||
1522 | } | ||
1523 | }"#, | ||
1524 | ); | ||
1525 | } | ||
1491 | } | 1526 | } |