3fb76f4027
Our implementation ends up changing the `PatKind::Range` variant in the AST to take a `Spanned<RangeEnd>` instead of just a `RangeEnd`, because the alternative would be to try to infer the span of the range operator from the spans of the start and end subexpressions, which is both hideous and nontrivial to get right (whereas getting the change to the AST right was a simple game of type tennis). This is concerning #51043.
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
error: the range pattern here has ambiguous interpretation
|
|
--> $DIR/range-inclusive-pattern-precedence.rs:27:10
|
|
|
|
|
LL | &10..=15 => {}
|
|
| ^^^^^^^ help: add parentheses to clarify the precedence: `(10 ..=15)`
|
|
|
|
error: the range pattern here has ambiguous interpretation
|
|
--> $DIR/range-inclusive-pattern-precedence.rs:38:13
|
|
|
|
|
LL | box 10..=15 => {}
|
|
| ^^^^^^^ help: add parentheses to clarify the precedence: `(10 ..=15)`
|
|
|
|
warning: `...` range patterns are deprecated
|
|
--> $DIR/range-inclusive-pattern-precedence.rs:24:11
|
|
|
|
|
LL | &0...9 => {}
|
|
| ^^^ help: use `..=` for an inclusive range
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/range-inclusive-pattern-precedence.rs:19:9
|
|
|
|
|
LL | #![warn(ellipsis_inclusive_range_patterns)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: `...` range patterns are deprecated
|
|
--> $DIR/range-inclusive-pattern-precedence.rs:35:14
|
|
|
|
|
LL | box 0...9 => {}
|
|
| ^^^ help: use `..=` for an inclusive range
|
|
|
|
error: aborting due to 2 previous errors
|
|
|