You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustc recommends specialization for type parameters inside an extern block #45092
error[E0044]: foreign items may not have type parameters
--> src/main.rs:2:5
|
2 | fn sqrt<T>(f: T) -> T;
| ^^^^^^^^^^^^^^^^^^^^^^ can't have type parameters
|
= help: use specialization instead of type parameters by replacing them with concrete types like `u32`
Activity
MaikKlein commentedon Oct 7, 2017
I just realized that rustc doesn't refer to the feature specialization but to 'manual' specialization.
rustc --explain E0044
You can't use type parameters on foreign items. Example of erroneous code:
To fix this, replace the type parameter with the specializations that you
need:
oli-obk commentedon May 24, 2019
Diagnostics triage: just needs changing the wording to something that gives a clearer message.
iluuu1994 commentedon Jul 25, 2019
E0044 has been reworded in #48138.
This can be closed.