Rollup merge of #35467 - terrynsun:master, r=jonathandturner
Update E0116 to new error code format. Fixes #35249 as part of #35233. r? @jonathandturner
This commit is contained in:
commit
8bd8cef318
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user