mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
docs: update the comment and add a test to half_open_range_pat
This commit is contained in:
parent
6a295fcd3b
commit
258e532434
3 changed files with 55 additions and 0 deletions
|
@ -126,6 +126,8 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) {
|
|||
// ^
|
||||
// `[0..]`
|
||||
// ^
|
||||
// `0 .. if`
|
||||
// ^
|
||||
if matches!(
|
||||
p.current(),
|
||||
T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']'] | T![if]
|
||||
|
@ -134,6 +136,11 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) {
|
|||
// fn f() {
|
||||
// let 0 .. = 1u32;
|
||||
// let 0..: _ = 1u32;
|
||||
//
|
||||
// match 42 {
|
||||
// 0 .. if true => (),
|
||||
// _ => (),
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
atom_pat(p, recovery_set);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue