Vec<Type1,Type2> should suggest a tuple if Type2 is not an allocator. #91540
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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:
The current output is:
Ideally the output should look like:
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.
The text was updated successfully, but these errors were encountered: