Rollup merge of #68454 - GuillaumeGomez:clean-up-e0214, r=Dylan-DPC

clean up E0214 explanation

r? @Dylan-DPC
This commit is contained in:
Yuki Okushi 2020-01-28 10:48:12 +09:00 committed by GitHub
commit 39407c9ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -1,12 +1,17 @@
A generic type was described using parentheses rather than angle brackets. A generic type was described using parentheses rather than angle brackets.
For example:
Erroneous code example:
```compile_fail,E0214 ```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>`. This is not currently supported: `v` should be defined as `Vec<&str>`.
Parentheses are currently only used with generic types when defining parameters Parentheses are currently only used with generic types when defining parameters
for `Fn`-family traits. for `Fn`-family traits.
The previous code example fixed:
```
let v: Vec<&str> = vec!["foo"];
```