Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint Fixes https://github.com/rust-lang/rust/issues/51043.
This commit is contained in:
commit
3c7acc7878
8 changed files with 71 additions and 20 deletions
|
|
@ -20,4 +20,10 @@ fn main() {
|
|||
//~^ WARN `...` range patterns are deprecated
|
||||
_ => {}
|
||||
}
|
||||
|
||||
match &despondency {
|
||||
&(1..=2) => {}
|
||||
//~^ WARN `...` range patterns are deprecated
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,10 @@ fn main() {
|
|||
//~^ WARN `...` range patterns are deprecated
|
||||
_ => {}
|
||||
}
|
||||
|
||||
match &despondency {
|
||||
&1...2 => {}
|
||||
//~^ WARN `...` range patterns are deprecated
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,3 +10,9 @@ note: lint level defined here
|
|||
LL | #![warn(ellipsis_inclusive_range_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: `...` range patterns are deprecated
|
||||
--> $DIR/inclusive-range-pattern-syntax.rs:25:9
|
||||
|
|
||||
LL | &1...2 => {}
|
||||
| ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)`
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ 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
|
||||
--> $DIR/range-inclusive-pattern-precedence.rs:24:9
|
||||
|
|
||||
LL | &0...9 => {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
| ^^^^^^ help: use `..=` for an inclusive range: `&(0..=9)`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/range-inclusive-pattern-precedence.rs:19:9
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue