diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-19 18:56:50 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-19 18:56:50 +0000 |
| commit | feff4f3a045545ea2401e1e5cc16dcfc16ebfde9 (patch) | |
| tree | 2bc05d2b4a2e20633f4145cd0e40133410887802 | |
| parent | 052e7227b6f7eb8dc4f689a7e14d110b8aff8555 (diff) | |
| parent | 9fe85e1fdf0954b4d4c563ab4c40b8823ce5c6c4 (diff) | |
| download | rust-feff4f3a045545ea2401e1e5cc16dcfc16ebfde9.tar.gz rust-feff4f3a045545ea2401e1e5cc16dcfc16ebfde9.zip | |
Merge #6953
6953: Add test_rename_bind_pat r=bjorn3 a=bjorn3 Fixes #2976 Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
| -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 56e9238414d..cd721b7ebcb 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 () { "#, ) } + + #[test] + fn test_rename_bind_pat() { + check( + "new_name", + r#" +fn main() { + enum CustomOption<T> { + None, + Some(T), + } + + let test_variable = CustomOption::Some(22); + + match test_variable { + CustomOption::Some(foo<|>) if foo == 11 => {} + _ => (), + } +}"#, + r#" +fn main() { + enum CustomOption<T> { + None, + Some(T), + } + + let test_variable = CustomOption::Some(22); + + match test_variable { + CustomOption::Some(new_name) if new_name == 11 => {} + _ => (), + } +}"#, + ); + } } |
