},
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;
// 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();