Skip to content

Commit

Permalink
Rollup merge of rust-lang#35467 - terrynsun:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0116 to new error code format.

Fixes rust-lang#35249 as part of rust-lang#35233.

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 7, 2016
2 parents cfebba5 + 03dc484 commit 8bd8cef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/librustc_typeck/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ struct OrphanChecker<'cx, 'tcx:'cx> {
impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
fn check_def_id(&self, item: &hir::Item, def_id: DefId) {
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 \
crate where the type is defined; define and implement \
a trait or new type instead");
crate where the type is defined")
.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();
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0116.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
// option. This file may not be copied, modified, or distributed
// 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() {
}

0 comments on commit 8bd8cef

Please sign in to comment.