-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"X...
range patterns are not supported" occurring in today's nightly
#63115
Comments
Regression introduced in #62550. |
More specifically the bug is in: fn is_pat_range_end_start(&self) -> bool {
self.token.is_path_start() // e.g. `MY_CONST`;
|| self.token == token::Dot // e.g. `.5` for recovery;
|| self.token.can_begin_literal_or_bool() // e.g. `42`.
} which is called to see whether what follows This is strange tho... in the case of e.g.: fn bar() {
macro_rules! foo {
($e1:expr, $e2:expr) => {
match 0 {
$e1...A => {}
_ => {}
}
}
}
foo!(0, 1);
} the call to |
Similarly, with: fn bar() {
macro_rules! foo {
($e1:expr, $e2:expr) => {
match 0 {
..$e2 => {}
_ => {}
}
}
}
foo!(0, 1);
} this does not trigger "error: |
Account for `maybe_whole_expr` in range patterns Fixes rust-lang#63115 (fallout from rust-lang#62550). r? @petrochenkov
Account for `maybe_whole_expr` in range patterns Fixes rust-lang#63115 (fallout from rust-lang#62550). r? @petrochenkov
Account for `maybe_whole_expr` in range patterns Fixes rust-lang#63115 (fallout from rust-lang#62550). r? @petrochenkov
Account for `maybe_whole_expr` in range patterns Fixes rust-lang#63115 (fallout from rust-lang#62550). r? @petrochenkov
The CI for
libssh2-sys
started to fail today with this error:It appears as though the compiler doesn't see
1 ... $e
and only sees1...
as the range expression and then generates this error.The expression is inside a
macro_rules!
expansion.You can reproduce this by cloning the
extprim
repo and building it:The build succeeds on the stable channel and much older releases, so this appears to be a regression in the nightly.
Here's the version on my windows system, but note that this also fails on linux and macos too:
The text was updated successfully, but these errors were encountered: