diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-19 18:56:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-19 18:56:50 +0000 |
commit | feff4f3a045545ea2401e1e5cc16dcfc16ebfde9 (patch) | |
tree | 2bc05d2b4a2e20633f4145cd0e40133410887802 | |
parent | 052e7227b6f7eb8dc4f689a7e14d110b8aff8555 (diff) | |
parent | 9fe85e1fdf0954b4d4c563ab4c40b8823ce5c6c4 (diff) |
Merge #6953
6953: Add test_rename_bind_pat r=bjorn3 a=bjorn3
Fixes #2976
Co-authored-by: bjorn3 <[email protected]>
-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 | } |