Skip to content

E0520 needs to be updated to new format #36112

Closed

Description

@sophiajt

From: src/test/compile-fail/E0520.rs

E0520 needs a span_label, a span_note converted to a span_label, a note, and a new title, updating it from:

error[E0520]: item `fly` is provided by an `impl` that specializes another, but the item in the parent `impl` is not marked `default` and so it cannot be specialized.
  --> src/test/compile-fail/E0520.rs:26:5
   |
26 |     default fn fly(&self) {} //~ ERROR E0520
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: parent implementation is here:
  --> src/test/compile-fail/E0520.rs:21:1
   |
21 | impl<T: Clone> SpaceLlama for T {
   | ^

To:

error[E0520]:  `fly` specializes an item from a parent impl, but neither that item nor the impl are marked default 
  --> src/test/compile-fail/E0520.rs:26:5
   |
21 | impl<T: Clone> SpaceLlama for T {
   | - parent `impl` is here
...
26 |     default fn fly(&self) {} //~ ERROR E0520
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
   |
   = note: to specialize, either the parent `impl` or `fly` in the parent `impl` must be marked `default`

Activity

  1. nikomatsakis commented on Aug 29, 2016

    @nikomatsakis
    Contributor

    The new form of the message is not quite accurate. You can either default on the impl or the item -- putting it on the impl implies both that all items are specializable and also that the impl trait is not implemented (yet).

    Maybe the message we want is more like one of these:

    • fly specializes a non-default item from a parent impl
    • fly specializes an item from a parent impl, but neither that item nor the impl are marked default
    • fly specializes an item from a parent impl, but that item is not specializable
      • then the note(s) can explain the details
  2. changed the title [-][WIP] E0520 needs to be updated to new format[/-] [+]E0520 needs to be updated to new format[/+] on Aug 29, 2016
  3. sophiajt commented on Aug 29, 2016

    @sophiajt
    ContributorAuthor

    @nikomatsakis - I updated it based on your suggestions. Could probably stand another pass, but maybe good for now?

  4. nikomatsakis commented on Aug 29, 2016

    @nikomatsakis
    Contributor

    @jonathandturner agreed good enough for now; I think I would maybe adopt something shorter in the header (like "not specializable") given that the note at the bottom spells out what that means

  5. nikomatsakis commented on Aug 29, 2016

    @nikomatsakis
    Contributor

    but I could go either way

  6. added 5 commits that reference this issue on Aug 30, 2016
    fb574b2
    0ce3724
    7b40ad2
    f3ce9fd
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions