]> git.lizzy.rs Git - rust.git/commitdiff
rustup https://github.com/rust-lang/rust/pull/65535
authorLzu Tao <taolzu@gmail.com>
Sat, 19 Oct 2019 05:27:21 +0000 (12:27 +0700)
committerLzu Tao <taolzu@gmail.com>
Sat, 19 Oct 2019 05:27:21 +0000 (12:27 +0700)
clippy_lints/src/functions.rs
clippy_lints/src/methods/mod.rs

index 8e295af234c9a5beb5c5e8bf5dfebaa7c7b4f4fe..59a16c36d9091584a69383b76683b43f5117c274 100644 (file)
@@ -493,7 +493,7 @@ fn is_must_use_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
         },
         Tuple(ref substs) => substs.types().any(|ty| is_must_use_ty(cx, ty)),
         Opaque(ref def_id, _) => {
-            for (predicate, _) in &cx.tcx.predicates_of(*def_id).predicates {
+            for (predicate, _) in cx.tcx.predicates_of(*def_id).predicates {
                 if let ty::Predicate::Trait(ref poly_trait_predicate) = predicate {
                     if must_use_attr(&cx.tcx.get_attrs(poly_trait_predicate.skip_binder().trait_ref.def_id)).is_some() {
                         return true;
index 74538164f8e9250171e84387f713725bc667eb35..e7b07bb1c1b6c488c3defaa8b464187f43567da0 100644 (file)
@@ -1322,7 +1322,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::
             // if return type is impl trait, check the associated types
             if let ty::Opaque(def_id, _) = ret_ty.kind {
                 // one of the associated types must be Self
-                for predicate in &cx.tcx.predicates_of(def_id).predicates {
+                for predicate in cx.tcx.predicates_of(def_id).predicates {
                     match predicate {
                         (Predicate::Projection(poly_projection_predicate), _) => {
                             let binder = poly_projection_predicate.ty();