Sometimes names of type parameters leak into error messages, e.g.:
fn main() {
(0..1000).sum() as f32;
}
(0..1000).sum() as f32;
^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
I haven't written S. It isn't anywhere in my source code, and it's a cryptic name. For the sake of error messages where the type parameter appears, would it be better to use descriptive types names, e.g. fn sum<SumAccumulatorType>?
(0..1000).sum() as f32;
^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `SumAccumulatorType`
Looks to me more like the error message shouldn’t quote local names used in another library, at least not without any context. (So, I agree with @CAD97 and @mark-i-m ).