Skip to content

Commit e7d01cf

Browse files
author
Ryan Senior
committed
Add an error explaination for E0230
1 parent 5402271 commit e7d01cf

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,30 @@ fn main() {
27912791
```
27922792
"##,
27932793

2794+
E0230: r##"
2795+
The trait has more type parameters specified than appear in its definition.
2796+
2797+
Erroneous example code:
2798+
2799+
```compile_fail,E0230
2800+
#![feature(on_unimplemented)]
2801+
#[rustc_on_unimplemented = "Trait error on `{Self}` with `<{A},{B},{C}>`"]
2802+
// error: there is no type parameter C on trait TraitWithThreeParams
2803+
trait TraitWithThreeParams<A,B>
2804+
{}
2805+
```
2806+
2807+
Include the correct number of type parameters and the compilation should
2808+
proceed:
2809+
2810+
```
2811+
#![feature(on_unimplemented)]
2812+
#[rustc_on_unimplemented = "Trait error on `{Self}` with `<{A},{B},{C}>`"]
2813+
trait TraitWithThreeParams<A,B,C> // ok!
2814+
{}
2815+
```
2816+
"##,
2817+
27942818
E0232: r##"
27952819
The attribute must have a value. Erroneous code example:
27962820
@@ -4116,7 +4140,6 @@ register_diagnostics! {
41164140
E0226, // only a single explicit lifetime bound is permitted
41174141
E0227, // ambiguous lifetime bound, explicit lifetime bound required
41184142
E0228, // explicit lifetime bound required
4119-
E0230, // there is no type parameter on trait
41204143
E0231, // only named substitution parameters are allowed
41214144
// E0233,
41224145
// E0234,

0 commit comments

Comments
 (0)