Update E0116 to new error code format.

Fixes #35249 as part of #35233.
This commit is contained in:
Terry Sun 2016-08-07 00:31:13 -04:00
parent ddf92ffae4
commit 03dc48488e
2 changed files with 9 additions and 4 deletions

View File

@ -33,10 +33,12 @@ struct OrphanChecker<'cx, 'tcx:'cx> {
impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> { impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
fn check_def_id(&self, item: &hir::Item, def_id: DefId) { fn check_def_id(&self, item: &hir::Item, def_id: DefId) {
if def_id.krate != LOCAL_CRATE { if def_id.krate != LOCAL_CRATE {
span_err!(self.tcx.sess, item.span, E0116, struct_span_err!(self.tcx.sess, item.span, E0116,
"cannot define inherent `impl` for a type outside of the \ "cannot define inherent `impl` for a type outside of the \
crate where the type is defined; define and implement \ crate where the type is defined")
a trait or new type instead"); .span_label(item.span, &format!("impl for type defined outside of crate."))
.span_note(item.span, &format!("define and implement a trait or new type instead"))
.emit();
} }
} }

View File

@ -8,7 +8,10 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
impl Vec<u8> {} //~ ERROR E0116 impl Vec<u8> {}
//~^ ERROR E0116
//~| NOTE impl for type defined outside of crate.
//~| NOTE define and implement a trait or new type instead
fn main() { fn main() {
} }