From 94fcda0e1346f284c44a27c5c07c2b0999e5bc29 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 22 Jan 2020 14:25:35 +0100 Subject: [PATCH] clean up E0214 explanation --- src/librustc_error_codes/error_codes/E0214.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0214.md b/src/librustc_error_codes/error_codes/E0214.md index f78c1c0cd0137..b64ee80e284d5 100644 --- a/src/librustc_error_codes/error_codes/E0214.md +++ b/src/librustc_error_codes/error_codes/E0214.md @@ -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"]; +```