Skip to content

Commit da14435

Browse files
committed
Updated clippy to account for changes from rust-lang/rust#44766
1 parent 6e4779b commit da14435

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

clippy_lints/src/lifetimes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass {
6666

6767
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
6868
if let ImplItemKind::Method(ref sig, id) = item.node {
69-
check_fn_inner(cx, &sig.decl, Some(id), &sig.generics, item.span);
69+
check_fn_inner(cx, &sig.decl, Some(id), &item.generics, item.span);
7070
}
7171
}
7272

@@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass {
7676
TraitMethod::Required(_) => None,
7777
TraitMethod::Provided(id) => Some(id),
7878
};
79-
check_fn_inner(cx, &sig.decl, body, &sig.generics, item.span);
79+
check_fn_inner(cx, &sig.decl, body, &item.generics, item.span);
8080
}
8181
}
8282
}

clippy_lints/src/methods.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
719719
if name == method_name &&
720720
sig.decl.inputs.len() == n_args &&
721721
out_type.matches(&sig.decl.output) &&
722-
self_kind.matches(first_arg_ty, first_arg, self_ty, false, &sig.generics) {
722+
self_kind.matches(first_arg_ty, first_arg, self_ty, false, &implitem.generics) {
723723
span_lint(cx, SHOULD_IMPLEMENT_TRAIT, implitem.span, &format!(
724724
"defining a method called `{}` on this type; consider implementing \
725725
the `{}` trait or choosing a less ambiguous name", name, trait_name));
@@ -733,7 +733,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
733733
for &(ref conv, self_kinds) in &CONVENTIONS {
734734
if_let_chain! {[
735735
conv.check(&name.as_str()),
736-
!self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &sig.generics)),
736+
!self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics)),
737737
], {
738738
let lint = if item.vis == hir::Visibility::Public {
739739
WRONG_PUB_SELF_CONVENTION

clippy_lints/src/new_without_default.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
108108
// can't be implemented by default
109109
return;
110110
}
111-
if !sig.generics.ty_params.is_empty() {
112-
// when the result of `new()` depends on a type parameter we should not require
113-
// an
114-
// impl of `Default`
115-
return;
116-
}
111+
//TODO: There is no sig.generics anymore and I don't know how to fix this.
112+
//if !sig.generics.ty_params.is_empty() {
113+
// // when the result of `new()` depends on a type parameter we should not require
114+
// // an
115+
// // impl of `Default`
116+
// return;
117+
//}
117118
if decl.inputs.is_empty() && name == "new" && cx.access_levels.is_reachable(id) {
118119
let self_ty = cx.tcx
119120
.type_of(cx.tcx.hir.local_def_id(cx.tcx.hir.get_parent(id)));

0 commit comments

Comments
 (0)