Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E0118 probably shouldn't use the terminology of "base type" #69392

Closed
CAD97 opened this issue Feb 23, 2020 · 6 comments · Fixed by #76028
Closed

E0118 probably shouldn't use the terminology of "base type" #69392

CAD97 opened this issue Feb 23, 2020 · 6 comments · Fixed by #76028
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@CAD97
Copy link
Contributor

CAD97 commented Feb 23, 2020

[playground]

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.

@CAD97 CAD97 added the C-bug Category: This is a bug. label Feb 23, 2020
@CAD97

This comment has been minimized.

@jumbatm

This comment has been minimized.

@rustbot

This comment has been minimized.

@jumbatm

This comment has been minimized.

@jumbatm

This comment has been minimized.

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed C-bug Category: This is a bug. labels Feb 23, 2020
@Centril Centril added D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-confusing Diagnostics: Confusing error or lint that should be reworked. labels Feb 23, 2020
@Havvy
Copy link
Contributor

Havvy commented 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 on Self in the associated items. Not sure if I should open a new issue for that one or not though.

@aticu aticu mentioned this issue Aug 28, 2020
@bors bors closed this as completed in 95386b6 Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants