use lint;
use util::common::{block_query, ErrorReported, indenter, loop_query};
use util::nodemap::{DefIdMap, FnvHashMap, NodeMap};
-use util::lev_distance::lev_distance;
use std::cell::{Cell, Ref, RefCell};
use std::collections::{HashSet};
use syntax::owned_slice::OwnedSlice;
use syntax::parse::token::{self, InternedString};
use syntax::ptr::P;
+use syntax::util::lev_distance::lev_distance;
use rustc_front::intravisit::{self, Visitor};
use rustc_front::hir;
hir::ItemStruct(..) => {
check_struct(ccx, it.id, it.span);
}
- hir::ItemTy(ref t, ref generics) => {
+ hir::ItemTy(_, ref generics) => {
let pty_ty = ccx.tcx.node_id_to_type(it.id);
- check_bounds_are_used(ccx, t.span, &generics.ty_params, pty_ty);
+ check_bounds_are_used(ccx, &generics.ty_params, pty_ty);
}
hir::ItemForeignMod(ref m) => {
if m.abi == abi::RustIntrinsic {
for item in &m.items {
- intrinsic::check_intrinsic_type(ccx, &**item);
+ intrinsic::check_intrinsic_type(ccx, item);
}
} else if m.abi == abi::PlatformIntrinsic {
for item in &m.items {
- intrinsic::check_platform_intrinsic_type(ccx, &**item);
+ intrinsic::check_platform_intrinsic_type(ccx, item);
}
} else {
for item in &m.items {
fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
impl_span: Span,
impl_trait_ref: &ty::TraitRef<'tcx>,
- impl_items: &[P<hir::ImplItem>]) {
+ impl_items: &[hir::ImplItem]) {
// Locate trait methods
let tcx = ccx.tcx;
let trait_items = tcx.trait_items(impl_trait_ref.def_id);
-> Option<(ty::AdtDef<'tcx>, ty::VariantDef<'tcx>)>
{
let (adt, variant) = match def {
- def::DefVariant(enum_id, variant_id, true) => {
+ def::DefVariant(enum_id, variant_id, _) => {
let adt = self.tcx().lookup_adt_def(enum_id);
(adt, adt.variant_with_id(variant_id))
}
let mut any_diverges = false;
let mut any_err = false;
for s in &blk.stmts {
- check_stmt(fcx, &**s);
- let s_id = ::rustc_front::util::stmt_id(&**s);
+ check_stmt(fcx, s);
+ let s_id = ::rustc_front::util::stmt_id(s);
let s_ty = fcx.node_ty(s_id);
if any_diverges && !warned && match s.node {
hir::StmtDecl(ref decl, _) => {
pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
sp: Span,
- vs: &'tcx [P<hir::Variant>],
+ vs: &'tcx [hir::Variant],
id: ast::NodeId) {
fn disr_in_range(ccx: &CrateCtxt,
}
fn do_check<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
- vs: &'tcx [P<hir::Variant>],
+ vs: &'tcx [hir::Variant],
id: ast::NodeId,
hint: attr::ReprAttr) {
#![allow(trivial_numeric_casts)]
}
pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
- span: Span,
tps: &OwnedSlice<hir::TyParam>,
ty: Ty<'tcx>) {
debug!("check_bounds_are_used(n_tps={}, ty={:?})",
for (i, b) in tps_used.iter().enumerate() {
if !*b {
- span_err!(ccx.tcx.sess, span, E0091,
+ span_err!(ccx.tcx.sess, tps[i].span, E0091,
"type parameter `{}` is unused",
tps[i].name);
}