diff options
| author | bors <bors@rust-lang.org> | 2016-09-25 22:03:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-25 22:03:28 -0700 |
| commit | 0a0215ddcd888a847a2e14007a357b94bfe004fd (patch) | |
| tree | 95192e9f3104f22fc313e0801c1e62c73ccb3dc5 | |
| parent | 9966397b61d5e065b692c59f4f721e31d038f1fc (diff) | |
| parent | 63a58929b9df88bfad183609a26f5829e18b2cde (diff) | |
| download | rust-0a0215ddcd888a847a2e14007a357b94bfe004fd.tar.gz rust-0a0215ddcd888a847a2e14007a357b94bfe004fd.zip | |
Auto merge of #36652 - giannicic:issue-36553, r=nrc
this commit corrects E0520 error text. See referenced issue for further info r? @nrc
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/E0520.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index e406807b51c..8c5b607f94c 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -903,7 +903,7 @@ 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)); @@ -911,8 +911,7 @@ fn report_forbidden_specialization<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, 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) => { diff --git a/src/test/compile-fail/E0520.rs b/src/test/compile-fail/E0520.rs index 0bb8faea62e..ff6152d377f 100644 --- a/src/test/compile-fail/E0520.rs +++ b/src/test/compile-fail/E0520.rs @@ -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() { |
