Skip to content

specialisation error 502 is misleading #36553

Closed
@nrc

Description

@nrc
Member
error[E0520]: `Foo` specializes an item from a parent `impl`, but neither that item nor the `impl` are marked `default`

Because the impl itself cannot be marked default, only the individual item.

Activity

added
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
A-diagnosticsArea: Messages for errors, warnings, and lints
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
on Sep 17, 2016
giannicic

giannicic commented on Sep 20, 2016

@giannicic
Contributor

Hi, I'm very new to rust and I'm trying to learn more about this language.
I would like to make the change. Seems that I have to change the error text (e.g. ..., but the item of the parent impl is not marked default), Is it right?
However searching about specialization documents I found this issue rust/issues/31844 where seems that a default implwill be possible.
Am i missing something?

nrc

nrc commented on Sep 20, 2016

@nrc
MemberAuthor

The text should suggest that the item could be default, but not that the parent impl could be, because it can't. It might be in the future (as suggested by #31844) but that is not certain.

added 2 commits that reference this issue on Sep 22, 2016

rust-lang#36553 specialisation error 502 is misleading

rust-lang#36553 specialisation error 520 is misleading

giannicic

giannicic commented on Sep 30, 2016

@giannicic
Contributor

Hi @nrc ,
I'm seeing a bit more deep the specialization feature. I'm wondering if I can try to implement the default impl.
I have in mind to do what is described in the following quotes taken from the RFC

we could easily add a shorthand later on in which default impl Trait for Type is sugar for adding default to all items in the impl.

For the moment, with this implementation, the default impl must define all items of the trait (not a part of them) and, therefore, they will be all treated as default items.
Would you accept a PR for this?

nrc

nrc commented on Oct 2, 2016

@nrc
MemberAuthor

@giannicic there is some debate at the moment about some of the details of specialisation. It would probably be best to open a thread on internals.rust-lang.org before starting to work on this.

kyrias

kyrias commented on Oct 18, 2016

@kyrias
Contributor

PR #36652 was merged, so this can be closed now.

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 lintsA-specializationArea: Trait impl specializationE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nrc@kyrias@giannicic

        Issue actions

          specialisation error 502 is misleading · Issue #36553 · rust-lang/rust