Static rustc_ap_rustc_lint_defs::builtin::INVALID_TYPE_PARAM_DEFAULT [−][src]
pub static INVALID_TYPE_PARAM_DEFAULT: &Lint
The invalid_type_param_default
lint detects type parameter defaults
erroneously allowed in an invalid location.
Example
ⓘ
fn foo<T=i32>(t: T) {}
{{produces}}
Explanation
Default type parameters were only intended to be allowed in certain situations, but historically the compiler allowed them everywhere. This is a future-incompatible lint to transition this to a hard error in the future. See issue #36887 for more details.