false
}
+ /// Would `maybe_whole_expr` in `parser.rs` return `Ok(..)`?
+ /// That is, is this a pre-parsed expression dropped into the token stream
+ /// (which happens while parsing the result ofmacro expansion)?
+ crate fn is_whole_expr(&self) -> bool {
+ if let Interpolated(ref nt) = self.kind {
+ if let NtExpr(_) | NtLiteral(_) | NtPath(_) | NtBlock(_) = **nt {
+ return true;
+ }
+ }
+
+ false
+ }
+
/// Returns `true` if the token is either the `mut` or `const` keyword.
crate fn is_mutability(&self) -> bool {
self.is_keyword(kw::Mut) ||
//~| ERROR `...` range patterns are deprecated
//~| ERROR mismatched types
}
+
+fn with_macro_expr_var() {
+ macro_rules! mac2 {
+ ($e1:expr, $e2:expr) => {
+ let $e1..$e2;
+ let $e1...$e2;
+ //~^ ERROR `...` range patterns are deprecated
+ let $e1..=$e2;
+ }
+ }
+
+ mac2!(0, 1);
+
+ macro_rules! mac {
+ ($e:expr) => {
+ let ..$e; //~ ERROR `..X` range patterns are not supported
+ let ...$e; //~ ERROR `...X` range patterns are not supported
+ //~^ ERROR `...` range patterns are deprecated
+ let ..=$e; //~ ERROR `..=X` range patterns are not supported
+ let $e..; //~ ERROR `X..` range patterns are not supported
+ let $e...; //~ ERROR `X...` range patterns are not supported
+ //~^ ERROR `...` range patterns are deprecated
+ let $e..=; //~ ERROR `X..=` range patterns are not supported
+ }
+ }
+
+ mac!(0);
+}
LL | if let ....3 = 0 {}
| ^^^^^ help: try using the minimum value for the type: `MIN...0.3`
+error: `..X` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:139:17
+ |
+LL | let ..$e;
+ | ^^ help: try using the minimum value for the type: `MIN..0`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `...X` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:140:17
+ |
+LL | let ...$e;
+ | ^^^ help: try using the minimum value for the type: `MIN...0`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `..=X` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:142:17
+ |
+LL | let ..=$e;
+ | ^^^ help: try using the minimum value for the type: `MIN..=0`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `X..` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:143:19
+ |
+LL | let $e..;
+ | ^^ help: try using the maximum value for the type: `0..MAX`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `X...` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:144:19
+ |
+LL | let $e...;
+ | ^^^ help: try using the maximum value for the type: `0...MAX`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `X..=` range patterns are not supported
+ --> $DIR/recover-range-pats.rs:146:19
+ |
+LL | let $e..=;
+ | ^^^ help: try using the maximum value for the type: `0..=MAX`
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:41:13
|
LL | if let ....3 = 0 {}
| ^^^ help: use `..=` for an inclusive range
+error: `...` range patterns are deprecated
+ --> $DIR/recover-range-pats.rs:129:20
+ |
+LL | let $e1...$e2;
+ | ^^^ help: use `..=` for an inclusive range
+...
+LL | mac2!(0, 1);
+ | ------------ in this macro invocation
+
+error: `...` range patterns are deprecated
+ --> $DIR/recover-range-pats.rs:140:17
+ |
+LL | let ...$e;
+ | ^^^ help: use `..=` for an inclusive range
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
+error: `...` range patterns are deprecated
+ --> $DIR/recover-range-pats.rs:144:19
+ |
+LL | let $e...;
+ | ^^^ help: use `..=` for an inclusive range
+...
+LL | mac!(0);
+ | -------- in this macro invocation
+
error[E0029]: only char and numeric types are allowed in range patterns
--> $DIR/recover-range-pats.rs:19:12
|
= note: expected type `{integer}`
found type `{float}`
-error: aborting due to 76 previous errors
+error: aborting due to 85 previous errors
Some errors have detailed explanations: E0029, E0308.
For more information about an error, try `rustc --explain E0029`.