// Ensure that we emit the deny-by-default lint `invalid_type_param_default` in locations where // type parameter defaults were accidentally allowed but don't have any effect whatsoever. // // Tracked in . // FIXME(default_type_parameter_fallback): Consider reallowing them once they work properly. fn avg(_: T) {} //~^ ERROR defaults for generic parameters are not allowed here [invalid_type_param_default] //~| WARN this was previously accepted // issue: fn mdn(_: T) {} //~^ ERROR generic parameter defaults cannot reference parameters before they are declared //~| ERROR defaults for generic parameters are not allowed here [invalid_type_param_default] //~| WARN this was previously accepted struct S(T); impl S {} //~^ ERROR defaults for generic parameters are not allowed here [invalid_type_param_default] //~| WARN this was previously accepted fn main() {}