clean up E0214 explanation
This commit is contained in:
parent
bf84eb538f
commit
94fcda0e13
1 changed files with 9 additions and 4 deletions
|
@ -1,12 +1,17 @@
|
|||
A generic type was described using parentheses rather than angle brackets.
|
||||
For example:
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0214
|
||||
fn main() {
|
||||
let v: Vec(&str) = vec!["foo"];
|
||||
}
|
||||
let v: Vec(&str) = vec!["foo"];
|
||||
```
|
||||
|
||||
This is not currently supported: `v` should be defined as `Vec<&str>`.
|
||||
Parentheses are currently only used with generic types when defining parameters
|
||||
for `Fn`-family traits.
|
||||
|
||||
The previous code example fixed:
|
||||
|
||||
```
|
||||
let v: Vec<&str> = vec!["foo"];
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue