File tree 2 files changed +9
-4
lines changed
librustc_typeck/coherence
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> {
33
33
impl < ' cx , ' tcx > OrphanChecker < ' cx , ' tcx > {
34
34
fn check_def_id ( & self , item : & hir:: Item , def_id : DefId ) {
35
35
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 ,
37
37
"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 ( ) ;
40
42
}
41
43
}
42
44
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
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
12
15
13
16
fn main ( ) {
14
17
}
You can’t perform that action at this time.
0 commit comments