Closed
Description
struct S;
impl<T> std::ops::Add<T> for S {
type Output = ();
fn add(self, _: T) {}
}
fn main() {
let _ = ..0;
let _ = S + ..0;
let _ = &..0;
let _ = || ..0;
let _ = *..0;
}
With the exception of *..0
, all of the above expressions parse successfully, so ..
is definitely allowed to appear at the beginning of an expression — including an expression with higher precedence such as binary +
and unary &
. I think it is a bug that *..0
does not parse. Same for -..0
and !..0
.
error: expected expression, found `..`
--> src/main.rs:12:14
|
12 | let _ = *..0;
| ^^ expected expression