Skip to content

Commit

Permalink
Rollup merge of rust-lang#68454 - GuillaumeGomez:clean-up-e0214, r=Dy…
Browse files Browse the repository at this point in the history
…lan-DPC

clean up E0214 explanation

r? @Dylan-DPC
  • Loading branch information
JohnTitor authored Jan 28, 2020
2 parents dc33cd3 + 94fcda0 commit 39407c9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/librustc_error_codes/error_codes/E0214.md
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"];
```

0 comments on commit 39407c9

Please sign in to comment.