@@ -704,9 +704,9 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) {
704
704
hir:: ItemStruct ( ..) => {
705
705
check_struct ( ccx, it. id , it. span ) ;
706
706
}
707
- hir:: ItemTy ( ref t , ref generics) => {
707
+ hir:: ItemTy ( _ , ref generics) => {
708
708
let pty_ty = ccx. tcx . node_id_to_type ( it. id ) ;
709
- check_bounds_are_used ( ccx, t . span , & generics. ty_params , pty_ty) ;
709
+ check_bounds_are_used ( ccx, & generics. ty_params , pty_ty) ;
710
710
}
711
711
hir:: ItemForeignMod ( ref m) => {
712
712
if m. abi == abi:: RustIntrinsic {
@@ -4904,7 +4904,6 @@ pub fn may_break(cx: &ty::ctxt, id: ast::NodeId, b: &hir::Block) -> bool {
4904
4904
}
4905
4905
4906
4906
pub fn check_bounds_are_used < ' a , ' tcx > ( ccx : & CrateCtxt < ' a , ' tcx > ,
4907
- span : Span ,
4908
4907
tps : & OwnedSlice < hir:: TyParam > ,
4909
4908
ty : Ty < ' tcx > ) {
4910
4909
debug ! ( "check_bounds_are_used(n_tps={}, ty={:?})" ,
@@ -4923,7 +4922,7 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
4923
4922
4924
4923
for ( i, b) in tps_used. iter ( ) . enumerate ( ) {
4925
4924
if !* b {
4926
- span_err ! ( ccx. tcx. sess, span, E0091 ,
4925
+ span_err ! ( ccx. tcx. sess, tps [ i ] . span, E0091 ,
4927
4926
"type parameter `{}` is unused" ,
4928
4927
tps[ i] . name) ;
4929
4928
}
0 commit comments