trait A{
fn foo(&self){}
}
impl<T> A for T{
}
fn main(){
.. . foo();
}
The compiler says
error: expected one of
;
or}
, found.
However, according to the syntax in Method call expressions - The Rust Reference
MethodCallExpression
Expression
.
PathExprSegment(
CallParams?)
The first Expression can be a RangeExpression that is a RangeFullExpr, which matches ..
and the single dot matches the dot in MethodCallExpression, and foo
is the PathExprSegment
No rules mentioned in the Referenced prohibit this usage. What's the wrong here?