Skip to content

Commit

Permalink
Rollup merge of rust-lang#36079 - acrrd:new_format_E0318, r=Guillaume…
Browse files Browse the repository at this point in the history
…Gomez

Update E0318 to new format

Fixes rust-lang#35322.
Part of rust-lang#35233.

r? @GuillaumeGomez
  • Loading branch information
Jonathan Turner committed Aug 31, 2016
2 parents 051685b + bdfcd78 commit c460228
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/librustc_typeck/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,19 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
return;
}
}
hir::ItemDefaultImpl(..) => {
hir::ItemDefaultImpl(_, ref item_trait_ref) => {
// "Trait" impl
debug!("coherence2::orphan check: default trait impl {}",
self.tcx.map.node_to_string(item.id));
let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap();
if trait_ref.def_id.krate != LOCAL_CRATE {
span_err!(self.tcx.sess, item.span, E0318,
struct_span_err!(self.tcx.sess, item_trait_ref.path.span, E0318,
"cannot create default implementations for traits outside the \
crate they're defined in; define a new trait instead");
crate they're defined in; define a new trait instead")
.span_label(item_trait_ref.path.span,
&format!("`{}` trait not defined in this crate",
item_trait_ref.path))
.emit();
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#![feature(optin_builtin_traits)]

impl Copy for .. {}
//~^ ERROR E0318

impl Copy for .. {} //~ ERROR E0318
//~^ NOTE `Copy` trait not defined in this crate
fn main() {}

0 comments on commit c460228

Please sign in to comment.