File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
librustc_typeck/coherence Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ struct OrphanChecker<'cx, 'tcx:'cx> {
3333impl < ' cx , ' tcx > OrphanChecker < ' cx , ' tcx > {
3434 fn check_def_id ( & self , item : & hir:: Item , def_id : DefId ) {
3535 if def_id. krate != LOCAL_CRATE {
36- span_err ! ( self . tcx. sess, item. span, E0116 ,
36+ struct_span_err ! ( self . tcx. sess, item. span, E0116 ,
3737 "cannot define inherent `impl` for a type outside of the \
38- crate where the type is defined; define and implement \
39- a trait or new type instead") ;
38+ crate where the type is defined")
39+ . span_label ( item. span , & format ! ( "impl for type defined outside of crate." ) )
40+ . span_note ( item. span , & format ! ( "define and implement a trait or new type instead" ) )
41+ . emit ( ) ;
4042 }
4143 }
4244
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- impl Vec < u8 > { } //~ ERROR E0116
11+ impl Vec < u8 > { }
12+ //~^ ERROR E0116
13+ //~| NOTE impl for type defined outside of crate.
14+ //~| NOTE define and implement a trait or new type instead
1215
1316fn main ( ) {
1417}
You can’t perform that action at this time.
0 commit comments