From: Philip Herron Date: Mon, 17 Apr 2023 20:01:25 +0000 (+0100) Subject: gccrs: minor refactor to reuse a variable instead of recreating it later X-Git-Tag: basepoints/gcc-15~2625 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e8c56392edb2cdf7d61672dda609bbb6b5941e2;p=thirdparty%2Fgcc.git gccrs: minor refactor to reuse a variable instead of recreating it later gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc: refactor Signed-off-by: Philip Herron --- diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index ce215e35322e..4e4fdbaec1e8 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -1595,8 +1595,7 @@ TypeCheckExpr::resolve_operator_overload ( return false; auto segment = HIR::PathIdentSegment (associated_item_name); - auto candidates - = MethodResolver::Probe (lhs, HIR::PathIdentSegment (associated_item_name)); + auto candidates = MethodResolver::Probe (lhs, segment); bool have_implementation_for_lang_item = candidates.size () > 0; if (!have_implementation_for_lang_item)