Multiple local variables were not read beyond their assignments.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
unused assignment.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
Likewise.
* typecheck/rust-tyty.cc (ParamType::handle_substitions): Likewise.
* typecheck/rust-unify.cc (UnifyRules::go): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
if (s->is_unit_check_needed () && !resolved->is_unit ())
{
auto unit = TyTy::TupleType::get_unit_type ();
- resolved
- = unify_site (s->get_mappings ().get_hirid (),
- TyTy::TyWithLocation (unit),
- TyTy::TyWithLocation (resolved), s->get_locus ());
+ unify_site (s->get_mappings ().get_hirid (),
+ TyTy::TyWithLocation (unit),
+ TyTy::TyWithLocation (resolved), s->get_locus ());
}
}
const auto &predicate
= impl_block_ty->lookup_predicate (trait_ref.get_defid ());
if (!predicate.is_error ())
- impl_block_ty
- = associated->setup_associated_types (prev_segment, predicate,
- nullptr, false);
+ associated->setup_associated_types (prev_segment, predicate,
+ nullptr, false);
}
}
{
const ParamType &pp = *static_cast<const ParamType *> (resolved);
if (pp.can_resolve ())
- resolved = pp.resolve ();
+ pp.resolve ();
}
// this is the new subst that this needs to pass
TyTy::BaseType *
UnifyRules::go ()
{
- TyTy::BaseType *ltype = lhs.get_ty ();
- TyTy::BaseType *rtype = rhs.get_ty ();
-
- ltype = lhs.get_ty ()->destructure ();
- rtype = rhs.get_ty ()->destructure ();
+ TyTy::BaseType *ltype = lhs.get_ty ()->destructure ();
+ TyTy::BaseType *rtype = rhs.get_ty ()->destructure ();
rust_debug ("unify::go ltype={%s} rtype={%s}", ltype->debug_str ().c_str (),
rtype->debug_str ().c_str ());