@@ -66,7 +66,7 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
6666 fn check_item ( & self , item : & hir:: Item ) {
6767 let def_id = self . tcx . map . local_def_id ( item. id ) ;
6868 match item. node {
69- hir:: ItemImpl ( _, _, _, None , _ , _) => {
69+ hir:: ItemImpl ( _, _, _, None , ref ty , _) => {
7070 // For inherent impls, self type must be a nominal type
7171 // defined in this crate.
7272 debug ! ( "coherence2::orphan check: inherent impl {}" ,
@@ -209,11 +209,11 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
209209 return ;
210210 }
211211 _ => {
212- struct_span_err ! ( self . tcx. sess, item . span, E0118 ,
212+ struct_span_err ! ( self . tcx. sess, ty . span, E0118 ,
213213 "no base type found for inherent implementation" )
214- . span_help ( item . span ,
215- "either implement a trait on it or create a newtype to wrap it \
216- instead")
214+ . span_label ( ty . span , & format ! ( "impl requires a base type" ) )
215+ . note ( & format ! ( "either implement a trait on it or create a newtype \
216+ to wrap it instead") )
217217 . emit ( ) ;
218218 return ;
219219 }
0 commit comments