Skip to content

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

@CAD97

Description

@CAD97
Contributor

[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.

Activity

CAD97

CAD97 commented on Feb 23, 2020

@CAD97
Author
jumbatm

jumbatm commented on Feb 23, 2020

@jumbatm
rustbot

rustbot commented on Feb 23, 2020

@rustbot
jumbatm

jumbatm commented on Feb 23, 2020

@jumbatm
jumbatm

jumbatm commented on Feb 23, 2020

@jumbatm
added
A-diagnosticsArea: Messages for errors, warnings, and lints
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
and removed
C-bugCategory: This is a bug.
on Feb 23, 2020
added
D-newcomer-roadblockDiagnostics: 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.
D-confusingDiagnostics: Confusing error or lint that should be reworked.
on Feb 23, 2020
Havvy

Havvy commented on Jun 18, 2020

@Havvy
Contributor

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.

added a commit that references this issue on Sep 17, 2020
95386b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Havvy@Centril@CAD97@jumbatm@rustbot

      Issue actions

        E0118 probably shouldn't use the terminology of "base type" · Issue #69392 · rust-lang/rust