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:
Pietro Albini 2018-11-15 11:04:40 +01:00 committed by GitHub
commit 3c7acc7878
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 71 additions and 20 deletions

View file

@ -20,4 +20,10 @@ fn main() {
//~^ WARN `...` range patterns are deprecated
_ => {}
}
match &despondency {
&(1..=2) => {}
//~^ WARN `...` range patterns are deprecated
_ => {}
}
}

View file

@ -20,4 +20,10 @@ fn main() {
//~^ WARN `...` range patterns are deprecated
_ => {}
}
match &despondency {
&1...2 => {}
//~^ WARN `...` range patterns are deprecated
_ => {}
}
}

View file

@ -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)`

View file

@ -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