Skip to content

Commit

Permalink
Auto merge of #36652 - giannicic:issue-36553, r=nrc
Browse files Browse the repository at this point in the history
this commit corrects E0520 error text.
See referenced issue for further info

r? @nrc
  • Loading branch information
bors authored Sep 26, 2016
2 parents 9966397 + 63a5892 commit 0a0215d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,16 +903,15 @@ fn report_forbidden_specialization<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let mut err = struct_span_err!(
tcx.sess, impl_item.span, E0520,
"`{}` specializes an item from a parent `impl`, but \
neither that item nor the `impl` are marked `default`",
that item is not marked `default`",
impl_item.name);
err.span_label(impl_item.span, &format!("cannot specialize default item `{}`",
impl_item.name));

match tcx.span_of_impl(parent_impl) {
Ok(span) => {
err.span_label(span, &"parent `impl` is here");
err.note(&format!("to specialize, either the parent `impl` or `{}` \
in the parent `impl` must be marked `default`",
err.note(&format!("to specialize, `{}` in the parent `impl` must be marked `default`",
impl_item.name));
}
Err(cname) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0520.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl SpaceLlama for i32 {
default fn fly(&self) {}
//~^ ERROR E0520
//~| NOTE cannot specialize default item `fly`
//~| NOTE either the parent `impl` or `fly` in the parent `impl` must be marked `default`
//~| NOTE `fly` in the parent `impl` must be marked `default`
}

fn main() {
Expand Down

0 comments on commit 0a0215d

Please sign in to comment.