-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.T-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
struct Animal;
impl &Animal {}
error[E0118]: no base type found for inherent implementation
--> src/lib.rs:3:6
|
3 | impl &Animal {}
| ^^^^^^^ impl requires a base type
|
= note: either implement a trait on it or create a newtype to wrap it instead
To quote GIGAOTSOS:
impl requeres a base type error screams about presence of sybtyping
This should probably use the covered/local terminology from re-rebalancing coherence instead of "base type" to avoid the problematic overlap with subtyping/inheritance terminology.
jumbatm and tema3210
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.T-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.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
CAD97 commentedon Feb 23, 2020
jumbatm commentedon Feb 23, 2020
rustbot commentedon Feb 23, 2020
jumbatm commentedon Feb 23, 2020
jumbatm commentedon Feb 23, 2020
Havvy commentedon Jun 18, 2020
In the reference, we use the term "nominal type". The error code explanation should also mention unions and trait objects (
impl dyn Send {}
is valid). If the person use&NominalType
or&mut NominalType
, it should also hint at removing the reference and putting them onSelf
in the associated items. Not sure if I should open a new issue for that one or not though.Auto merge of rust-lang#76028 - aticu:improve_e0118, r=estebank,jyn51…