mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
parent
ddf92ffae4
commit
03dc48488e
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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() {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user