Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E0116 to new error code format. #35467

Merged
merged 1 commit into from
Aug 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {
}