Skip to content

Commit 0eb7303

Browse files
Add E0403 error explanation
1 parent 90a3692 commit 0eb7303

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/librustc_resolve/diagnostics.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,21 @@ on this topic:
274274
http://doc.rust-lang.org/reference.html#use-declarations
275275
"##
276276

277+
E0403: r##"
278+
Some type parameters have the same name. Example of erroneous code:
279+
280+
```
281+
fn foo<T, T>(s: T, u: T) {} // error: the name `T` is already used for a type
282+
// parameter in this type parameter list
283+
```
284+
285+
Please verify you didn't mispell the type parameters. Example:
286+
287+
```
288+
fn foo<T, Y>(s: T, u: Y) {}
289+
```
290+
"##
291+
277292
}
278293

279294
register_diagnostics! {
@@ -284,7 +299,6 @@ register_diagnostics! {
284299
E0258,
285300
E0401, // can't use type parameters from outer function
286301
E0402, // cannot use an outer type parameter in this context
287-
E0403, // the name `{}` is already used
288302
E0404, // is not a trait
289303
E0405, // use of undeclared trait name
290304
E0406, // undeclared associated type

0 commit comments

Comments
 (0)