rust/tests/ui/half-open-range-patterns
Esteban Küber 7f5548fa8b On function and method calls in patterns, link to the book
```
error: expected a pattern, found an expression
 --> f889.rs:3:13
  |
3 |     let (x, y.drop()) = (1, 2); //~ ERROR
  |             ^^^^^^^^ not a pattern
  |
  = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html>

error[E0532]: expected a pattern, found a function call
 --> f889.rs:2:13
  |
2 |     let (x, drop(y)) = (1, 2); //~ ERROR
  |             ^^^^ not a tuple struct or tuple variant
  |
  = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html>
```

Fix #97200.
2024-10-06 01:44:59 +00:00
..
exclusive_range_pattern_syntax_collision2.rs
exclusive_range_pattern_syntax_collision2.stderr
exclusive_range_pattern_syntax_collision3.rs
exclusive_range_pattern_syntax_collision3.stderr
exclusive_range_pattern_syntax_collision.rs
exclusive_range_pattern_syntax_collision.stderr
feature-gate-half-open-range-patterns-in-slices.rs
feature-gate-half-open-range-patterns-in-slices.stderr
half-open-range-pats-bad-types.rs
half-open-range-pats-bad-types.stderr
half-open-range-pats-exhaustive-fail.rs
half-open-range-pats-exhaustive-fail.stderr
half-open-range-pats-exhaustive-pass.rs
half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs
half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr
half-open-range-pats-inclusive-match-arrow.rs
half-open-range-pats-inclusive-match-arrow.stderr
half-open-range-pats-inclusive-no-end.rs
half-open-range-pats-inclusive-no-end.stderr
half-open-range-pats-ref-ambiguous-interp.rs
half-open-range-pats-ref-ambiguous-interp.stderr
half-open-range-pats-semantics.rs
half-open-range-pats-syntactic-pass.rs
half-open-range-pats-thir-lower-empty.rs
half-open-range-pats-thir-lower-empty.stderr
pat-tuple-4.rs
pat-tuple-5.rs
pat-tuple-5.stderr
range_pat_interactions0.rs
range_pat_interactions1.rs
range_pat_interactions1.stderr On function and method calls in patterns, link to the book 2024-10-06 01:44:59 +00:00
range_pat_interactions2.rs
range_pat_interactions2.stderr On function and method calls in patterns, link to the book 2024-10-06 01:44:59 +00:00
range_pat_interactions3.rs
range_pat_interactions3.stderr
slice_pattern_syntax_problem0.rs
slice_pattern_syntax_problem0.stderr
slice_pattern_syntax_problem1.rs
slice_pattern_syntax_problem1.stderr
slice_pattern_syntax_problem2.rs