Skip to content

Commit 0a0215d

Browse files
authored
Auto merge of #36652 - giannicic:issue-36553, r=nrc
this commit corrects E0520 error text. See referenced issue for further info r? @nrc
2 parents 9966397 + 63a5892 commit 0a0215d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustc_typeck/check/mod.rs

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

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

src/test/compile-fail/E0520.rs

+1-1
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)