E1054: type argument does not meet its constraint
A type parameter may carry a constraint.
A type parameter may carry a constraint. A bound such as T: Reader needs the
argument type to have a perform Reader for that type (ADR-0014). The bound
Numeric needs an integer or float type. A const parameter such as
N: Usize needs a positive compile-time integer or another const parameter
(ADR-0072), so 0 is rejected. The message says which parameter, which
constraint and which argument. The error points at the type
argument that does not meet the constraint.
Example
Fix
Pass an argument that meets the constraint. Use a positive size for a const
parameter. For a role bound, pick a type that has the performance, or write
the missing perform.
Run actus explain E1054 in your terminal to read this entry offline. Browse Ownership & types or all error codes.