Test generic arg suggestion inside nested item
This commit is contained in:
parent
55067c539a
commit
3bbbe3cf64
@ -15,4 +15,13 @@ fn main() {
|
|||||||
let _x = (1..10).collect::<HashMap>();
|
let _x = (1..10).collect::<HashMap>();
|
||||||
//~^ ERROR missing generics for struct `HashMap`
|
//~^ ERROR missing generics for struct `HashMap`
|
||||||
//~| SUGGESTION <_, _>
|
//~| SUGGESTION <_, _>
|
||||||
|
|
||||||
|
().extend::<[(); 0]>({
|
||||||
|
fn not_the_extend() {
|
||||||
|
let _: Vec;
|
||||||
|
//~^ ERROR missing generics for struct `Vec`
|
||||||
|
//~| SUGGESTION <T>
|
||||||
|
}
|
||||||
|
[]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,22 @@ help: add missing generic arguments
|
|||||||
LL | let _x = (1..10).collect::<HashMap<_, _>>();
|
LL | let _x = (1..10).collect::<HashMap<_, _>>();
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error[E0107]: missing generics for struct `Vec`
|
||||||
|
--> $DIR/generic-type-less-params-with-defaults.rs:21:20
|
||||||
|
|
|
||||||
|
LL | let _: Vec;
|
||||||
|
| ^^^ expected at least 1 generic argument
|
||||||
|
|
|
||||||
|
note: struct defined here, with at least 1 generic parameter: `T`
|
||||||
|
--> $DIR/generic-type-less-params-with-defaults.rs:5:8
|
||||||
|
|
|
||||||
|
LL | struct Vec<T, A = Heap>(
|
||||||
|
| ^^^ -
|
||||||
|
help: add missing generic argument
|
||||||
|
|
|
||||||
|
LL | let _: Vec<T>;
|
||||||
|
| +++
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0107`.
|
For more information about this error, try `rustc --explain E0107`.
|
||||||
|
Loading…
Reference in New Issue
Block a user