Skip to content

Commit b54903f

Browse files
Rollup merge of rust-lang#40723 - SamWhited:e0090_error_explanation, r=estebank
E0090: Add explanation for error message See rust-lang#32777 $ rustc --explain E0090 The wrong number of lifetimes were supplied. For example: ``` fn foo<'a: 'b, 'b: 'a>() {} fn main() { foo::<'static>(); // error, expected 2 lifetime parameters } ```
2 parents e6fcb16 + 8ea0f18 commit b54903f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/librustc_typeck/diagnostics.rs

+22-1
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,28 @@ fn main() {
12231223
```
12241224
"##,
12251225

1226+
E0090: r##"
1227+
You gave too few lifetime parameters. Example:
1228+
1229+
```compile_fail,E0090
1230+
fn foo<'a: 'b, 'b: 'a>() {}
1231+
1232+
fn main() {
1233+
foo::<'static>(); // error, expected 2 lifetime parameters
1234+
}
1235+
```
1236+
1237+
Please check you give the right number of lifetime parameters. Example:
1238+
1239+
```
1240+
fn foo<'a: 'b, 'b: 'a>() {}
1241+
1242+
fn main() {
1243+
foo::<'static, 'static>();
1244+
}
1245+
```
1246+
"##,
1247+
12261248
E0091: r##"
12271249
You gave an unnecessary type parameter in a type alias. Erroneous code
12281250
example:
@@ -4120,7 +4142,6 @@ register_diagnostics! {
41204142
// E0068,
41214143
// E0085,
41224144
// E0086,
4123-
E0090,
41244145
E0103, // @GuillaumeGomez: I was unable to get this error, try your best!
41254146
E0104,
41264147
// E0123,

0 commit comments

Comments
 (0)