forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#68454 - GuillaumeGomez:clean-up-e0214, r=Dy…
…lan-DPC clean up E0214 explanation r? @Dylan-DPC
- Loading branch information
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"]; | ||
``` |