You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`
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
@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
Activity
nikomatsakis commentedon Aug 29, 2016
The new form of the message is not quite accurate. You can either
defaulton 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:
flyspecializes a non-defaultitem from a parent implflyspecializes an item from a parent impl, but neither that item nor the impl are markeddefaultflyspecializes an item from a parent impl, but that item is not specializable[-][WIP] E0520 needs to be updated to new format[/-][+]E0520 needs to be updated to new format[/+]sophiajt commentedon Aug 29, 2016
@nikomatsakis - I updated it based on your suggestions. Could probably stand another pass, but maybe good for now?
nikomatsakis commentedon Aug 29, 2016
@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
nikomatsakis commentedon Aug 29, 2016
but I could go either way
Rollup merge of rust-lang#36135 - 0xmohit:pr/error-code-E0520, r=jona…
Rollup merge of rust-lang#36135 - 0xmohit:pr/error-code-E0520, r=jona…
Rollup merge of rust-lang#36135 - 0xmohit:pr/error-code-E0520, r=jona…
Rollup merge of rust-lang#36135 - 0xmohit:pr/error-code-E0520, r=jona…