Closed
Description
The CI for libssh2-sys
started to fail today with this error:
error: `X...` range patterns are not supported
--> C:\Users\wez\.cargo\registry\src\github.tiyicn.workers.dev-1ecc6299db9ec823\extprim-1.7.0\src\traits.rs:94:21
|
94 | 1 ... $e => u128::new(mantissa) << exp,
| ^^^^^ help: try using the maximum value for the type: `1...MAX`
...
117 | impl_to_extra_primitive_for_float!(f32, 23, 104, 103);
| ------------------------------------------------------ in this macro invocation
It appears as though the compiler doesn't see 1 ... $e
and only sees 1...
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:
$ git clone git@github.com:kennytm/extprim.git
$ cd extprim
$ cargo +nightly build
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:
rustc 1.38.0-nightly (4560cb830 2019-07-28)
binary: rustc
commit-hash: 4560cb830fce63fcffdc4558f4281aaac6a3a1ba
commit-date: 2019-07-28
host: x86_64-pc-windows-msvc
release: 1.38.0-nightly
LLVM version: 9.0
Activity
Centril commentedon Jul 29, 2019
Regression introduced in #62550.
Centril commentedon Jul 29, 2019
More specifically the bug is in:
which is called to see whether what follows
...
is a valid start of a range pattern end expression.This is strange tho... in the case of e.g.:
the call to
self.token.is_path_start()
in https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs#L3959 is used successfully to parse$e1
but somehow that doesn't work for$e1..$e2
.cc @petrochenkov
Centril commentedon Jul 29, 2019
Similarly, with:
this does not trigger "error:
..X
range patterns are not supported" but it should.maybe_whole_expr
in range patterns #631229 remaining items