-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The Int
trait has a very similar name to the int
primitive type, so if someone accidentally uses Int
(e.g. forgetting that primitive types have special names/if they come from Haskell or some such) they can get confusing messages, especially now that DST allows for bare traits to be used more often, e.g.
struct Foo { x: Int }
fn main() {}
gives
<anon>:1:17: 1:20 error: explicit lifetime bound required
<anon>:1 struct Foo { x: Int }
^~~
which is really confusing.
I'm not really sure how we fix this, but mentioning "trait" somewhere in the message would be helpful.
Metadata
Metadata
Assignees
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.