Skip to content

Commit 0770f66

Browse files
Add E0044 error code explanation
1 parent d54ab41 commit 0770f66

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,19 @@ fn main() {
380380
```
381381
"##,
382382

383+
E0044: r##"
384+
You can't use type parameters on foreign items. Example of erroneous code:
385+
386+
```
387+
extern { fn some_func<T>(); }
388+
```
389+
390+
Just remove the type parameter to make this code works:
391+
392+
```
393+
extern { fn some_func(); }
394+
```
395+
383396
E0045: r##"
384397
Rust only supports variadic parameters for interoperability with C code in its
385398
FFI. As such, variadic parameters can only be used with functions which are
@@ -1488,7 +1501,9 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
14881501
}
14891502

14901503
register_diagnostics! {
1491-
E0044, // foreign items may not have type parameters
1504+
E0034, // multiple applicable methods in scope
1505+
E0035, // does not take type parameters
1506+
E0036, // incorrect number of type parameters given for this method
14921507
E0068,
14931508
E0071,
14941509
E0074,

0 commit comments

Comments
 (0)