Warn for type parameter defaults on impl blocks
This commit is contained in:
parent
470ca1c3ff
commit
7c73b9eaae
2 changed files with 27 additions and 14 deletions
|
|
@ -14,4 +14,10 @@
|
|||
fn avg<T=i32>(_: T) {}
|
||||
//~^ ERROR defaults for type parameters are only allowed
|
||||
//~| WARNING hard error
|
||||
|
||||
struct S<T>(T);
|
||||
impl<T=i32> S<T> {}
|
||||
//~^ ERROR defaults for type parameters are only allowed
|
||||
//~| WARNING hard error
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue