diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-04-17 21:01:25 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-04-26 15:02:40 +0000 |
commit | b0f0ed0097416c249c453e0208179f3c438ab685 (patch) | |
tree | 4d8d49c60a51a271b0b99b30a5ea93412f24702f | |
parent | 04fad308c62f619b6002f290dc72bcd9747a911c (diff) | |
download | gcc-b0f0ed0097416c249c453e0208179f3c438ab685.tar.gz |
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 <herron.philip@googlemail.com>
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index f205a49e707..29afad69b0c 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) |