Skip to content

Commit a35275c

Browse files
committed
rust-lang#36553 specialisation error 502 is misleading
this commit correct E0502 error text. See referenced issue for further info
1 parent 2c2552b commit a35275c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,15 +904,15 @@ fn report_forbidden_specialization<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
904904
let mut err = struct_span_err!(
905905
tcx.sess, impl_item.span, E0520,
906906
"`{}` specializes an item from a parent `impl`, but \
907-
neither that item nor the `impl` are marked `default`",
907+
that item is not marked `default`",
908908
impl_item.name);
909909
err.span_label(impl_item.span, &format!("cannot specialize default item `{}`",
910910
impl_item.name));
911911

912912
match tcx.span_of_impl(parent_impl) {
913913
Ok(span) => {
914914
err.span_label(span, &"parent `impl` is here");
915-
err.note(&format!("to specialize, either the parent `impl` or `{}` \
915+
err.note(&format!("to specialize, `{}` \
916916
in the parent `impl` must be marked `default`",
917917
impl_item.name));
918918
}

src/test/compile-fail/E0520.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl SpaceLlama for i32 {
2727
default fn fly(&self) {}
2828
//~^ ERROR E0520
2929
//~| NOTE cannot specialize default item `fly`
30-
//~| NOTE either the parent `impl` or `fly` in the parent `impl` must be marked `default`
30+
//~| NOTE `fly` in the parent `impl` must be marked `default`
3131
}
3232

3333
fn main() {

0 commit comments

Comments
 (0)