-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
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
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team