#36553 specialisation error 502 is misleading
this commit correct E0502 error text. See referenced issue for further info
This commit is contained in:
parent
2c2552b712
commit
a35275c89b
2 changed files with 3 additions and 3 deletions
|
@ -904,7 +904,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));
|
||||
|
@ -912,7 +912,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 `{}` \
|
||||
err.note(&format!("to specialize, `{}` \
|
||||
in the parent `impl` must be marked `default`",
|
||||
impl_item.name));
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue