diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index 16d636c68ab..7cfe2c1cdcb 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -66,7 +66,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass { fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) { if let ImplItemKind::Method(ref sig, id) = item.node { - check_fn_inner(cx, &sig.decl, Some(id), &sig.generics, item.span); + check_fn_inner(cx, &sig.decl, Some(id), &item.generics, item.span); } } @@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass { TraitMethod::Required(_) => None, TraitMethod::Provided(id) => Some(id), }; - check_fn_inner(cx, &sig.decl, body, &sig.generics, item.span); + check_fn_inner(cx, &sig.decl, body, &item.generics, item.span); } } } diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index 8b4520a5e03..caccfccdda2 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -746,7 +746,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { if name == method_name && sig.decl.inputs.len() == n_args && out_type.matches(&sig.decl.output) && - self_kind.matches(first_arg_ty, first_arg, self_ty, false, &sig.generics) { + self_kind.matches(first_arg_ty, first_arg, self_ty, false, &implitem.generics) { span_lint(cx, SHOULD_IMPLEMENT_TRAIT, implitem.span, &format!( "defining a method called `{}` on this type; consider implementing \ the `{}` trait or choosing a less ambiguous name", name, trait_name)); @@ -760,7 +760,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { for &(ref conv, self_kinds) in &CONVENTIONS { if_chain! { if conv.check(&name.as_str()); - if !self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &sig.generics)); + if !self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics)); then { let lint = if item.vis == hir::Visibility::Public { WRONG_PUB_SELF_CONVENTION diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index 31a9de871b4..2fc6695fa8b 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -108,12 +108,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault { // can't be implemented by default return; } - if !sig.generics.ty_params.is_empty() { - // when the result of `new()` depends on a type parameter we should not require - // an - // impl of `Default` - return; - } + //TODO: There is no sig.generics anymore and I don't know how to fix this. + //if !sig.generics.ty_params.is_empty() { + // // when the result of `new()` depends on a type parameter we should not require + // // an + // // impl of `Default` + // return; + //} if decl.inputs.is_empty() && name == "new" && cx.access_levels.is_reachable(id) { let self_ty = cx.tcx .type_of(cx.tcx.hir.local_def_id(cx.tcx.hir.get_parent(id)));