Skip to content

Commit feff4f3

Browse files
bors[bot]bjorn3
andauthored
Merge #6953
6953: Add test_rename_bind_pat r=bjorn3 a=bjorn3 Fixes #2976 Co-authored-by: bjorn3 <[email protected]>
2 parents 052e722 + 9fe85e1 commit feff4f3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

crates/ide/src/references/rename.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,4 +1488,39 @@ impl<'yeeee> Foo<'yeeee> for &'yeeee () {
14881488
"#,
14891489
)
14901490
}
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+
}
14911526
}

0 commit comments

Comments
 (0)