I wrote this simple program:
trait Command<T> {
fn execute(&self, &mut T);
}
fn main() {
let x = 0;
}
I compiled this with rustc --edition=2018 main.rs
and get the error message:
error: expected one of `:` or `@`, found `)`
--> main.rs:2:29
|
2 | fn execute(&self, &mut T);
| ^ expected one of `:` or `@` here
Compiling via rustc --edition=2015 main.rs
or rustc main.rs
doesn't cause this error, although there are some warnings.
What's the problem with this code?