[][src]Static rustc_ap_rustc_session::lint::builtin::INVALID_TYPE_PARAM_DEFAULT

pub static  INVALID_TYPE_PARAM_DEFAULT: &Lint

The invalid_type_param_default lint detects type parameter defaults erroneously allowed in an invalid location.

Example

This example deliberately fails to compile
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.