Closed
Description
When aliasing a type for a vec of a tuple, it'd be nice to be told something like "You probably meant to use a tuple" instead of getting an error saying you're using unstable library features.
Given the following code:
type MyType = Vec<u32,bool>;
The current output is:
error[E0658]: use of unstable library feature 'allocator_api'
--> advent-of-code-2021\src\day4\mod.rs:14:28
|
14 | type BingoBoard = Vec<u32, bool>;
| ^^^^
|
= note: see issue #32838 <https://github.com/rust-lang/rust/issues/32838> for more information
Ideally the output should look like:
error[E0658]: use of unstable library feature 'allocator_api'
--> advent-of-code-2021\src\day4\mod.rs:14:28
|
14 | type BingoBoard = Vec<u32, bool>;
| ^^^^
|
| Maybe you meant to use a tuple instead?
= note: see issue #32838 <https://github.com/rust-lang/rust/issues/32838> for more information
This would make it easier to identify this typo in the code for those of us who are newer or less experienced rather than having to guess. I'm not sure how the compiler itself works, but the way I imagine this could be checked is if the second type in the Vec declaration does not implement a trait identifying it as an allocator, it should show the friendly message.