Make parse error suggestions verbose and fix spans
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
This commit is contained in:
parent
5e311f933d
commit
692bc344d5
175 changed files with 3197 additions and 786 deletions
|
@ -2,36 +2,60 @@ error: range-to patterns with `...` are not allowed
|
|||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
|
||||
|
|
||||
LL | ...X => {}
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
|
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | ..=X => {}
|
||||
| ~~~
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
|
||||
|
|
||||
LL | ...0 => {}
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
|
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | ..=0 => {}
|
||||
| ~~~
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
|
||||
|
|
||||
LL | ...'a' => {}
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
|
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | ..='a' => {}
|
||||
| ~~~
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
|
||||
|
|
||||
LL | ...0.0f32 => {}
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
|
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | ..=0.0f32 => {}
|
||||
| ~~~
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
||||
|
|
||||
LL | let ...$e;
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
...
|
||||
LL | mac!(0);
|
||||
| ------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | let ..=$e;
|
||||
| ~~~
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
||||
|
|
|
@ -2,57 +2,87 @@ error[E0586]: inclusive range with no end
|
|||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:8:13
|
||||
|
|
||||
LL | if let 0... = 1 {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - if let 0... = 1 {}
|
||||
LL + if let 0.. = 1 {}
|
||||
|
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:9:13
|
||||
|
|
||||
LL | if let 0..= = 1 {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - if let 0..= = 1 {}
|
||||
LL + if let 0.. = 1 {}
|
||||
|
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
|
||||
|
|
||||
LL | if let X... = 1 {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - if let X... = 1 {}
|
||||
LL + if let X.. = 1 {}
|
||||
|
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:12:13
|
||||
|
|
||||
LL | if let X..= = 1 {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - if let X..= = 1 {}
|
||||
LL + if let X.. = 1 {}
|
||||
|
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
|
||||
|
|
||||
LL | let $e...;
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
...
|
||||
LL | mac!(0);
|
||||
| ------- in this macro invocation
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - let $e...;
|
||||
LL + let $e..;
|
||||
|
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
|
||||
|
|
||||
LL | let $e..=;
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
...
|
||||
LL | mac!(0);
|
||||
| ------- in this macro invocation
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - let $e..=;
|
||||
LL + let $e..;
|
||||
|
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:17
|
||||
|
|
|
@ -2,53 +2,93 @@ error: the range pattern here has ambiguous interpretation
|
|||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:6:10
|
||||
|
|
||||
LL | &0.. | _ => {}
|
||||
| ^^^ help: add parentheses to clarify the precedence: `(0..)`
|
||||
| ^^^
|
||||
|
|
||||
help: add parentheses to clarify the precedence
|
||||
|
|
||||
LL | &(0..) | _ => {}
|
||||
| + +
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:11
|
||||
|
|
||||
LL | &0..= | _ => {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - &0..= | _ => {}
|
||||
LL + &0.. | _ => {}
|
||||
|
|
||||
|
||||
error: the range pattern here has ambiguous interpretation
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
|
||||
|
|
||||
LL | &0..= | _ => {}
|
||||
| ^^^^ help: add parentheses to clarify the precedence: `(0..=)`
|
||||
| ^^^^
|
||||
|
|
||||
help: add parentheses to clarify the precedence
|
||||
|
|
||||
LL | &(0..=) | _ => {}
|
||||
| + +
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:11:11
|
||||
|
|
||||
LL | &0... | _ => {}
|
||||
| ^^^ help: use `..` instead
|
||||
| ^^^
|
||||
|
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
help: use `..` instead
|
||||
|
|
||||
LL - &0... | _ => {}
|
||||
LL + &0.. | _ => {}
|
||||
|
|
||||
|
||||
error: the range pattern here has ambiguous interpretation
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:16:10
|
||||
|
|
||||
LL | &..0 | _ => {}
|
||||
| ^^^ help: add parentheses to clarify the precedence: `(..0)`
|
||||
| ^^^
|
||||
|
|
||||
help: add parentheses to clarify the precedence
|
||||
|
|
||||
LL | &(..0) | _ => {}
|
||||
| + +
|
||||
|
||||
error: the range pattern here has ambiguous interpretation
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
|
||||
|
|
||||
LL | &..=0 | _ => {}
|
||||
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
|
||||
| ^^^^
|
||||
|
|
||||
help: add parentheses to clarify the precedence
|
||||
|
|
||||
LL | &(..=0) | _ => {}
|
||||
| + +
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
||||
|
|
||||
LL | &...0 | _ => {}
|
||||
| ^^^ help: use `..=` instead
|
||||
| ^^^
|
||||
|
|
||||
help: use `..=` instead
|
||||
|
|
||||
LL | &..=0 | _ => {}
|
||||
| ~~~
|
||||
|
||||
error: the range pattern here has ambiguous interpretation
|
||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
||||
|
|
||||
LL | &...0 | _ => {}
|
||||
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
|
||||
| ^^^^
|
||||
|
|
||||
help: add parentheses to clarify the precedence
|
||||
|
|
||||
LL | &(...0) | _ => {}
|
||||
| + +
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue