diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-05-23 14:35:17 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-05-26 16:28:04 +0000 |
commit | e656f08b6f7794c0c04a808fec50ea9a079577c7 (patch) | |
tree | fc2cc85773dabf7b4e9b4184bc7980f09b15280a /gcc/rust/backend/rust-compile-resolve-path.cc | |
parent | 9e2ecdf3b9d4c4216d67c24ab6e65a48290c08df (diff) | |
download | gcc-e656f08b6f7794c0c04a808fec50ea9a079577c7.zip gcc-e656f08b6f7794c0c04a808fec50ea9a079577c7.tar.gz gcc-e656f08b6f7794c0c04a808fec50ea9a079577c7.tar.bz2 |
gccrs: refactor resolve_method_address to be more generic
We can reuse the DefId to lookup the mappings to Items or Trait Items
instead of the HirId this is more generic and can then be reused for the
deref operator overload during autoderef cycles.
Addresses #2190
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): refactor
* backend/rust-compile-base.h: likewise
* backend/rust-compile-expr.cc (CompileExpr::visit): likewise
* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): likewise
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-resolve-path.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index d4e3780..5989499 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -213,8 +213,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup, receiver = fn->get_self_type (); receiver = receiver->destructure (); - return resolve_method_address (fn, ref, receiver, final_segment, - mappings, expr_locus); + return resolve_method_address (fn, receiver, expr_locus); } } |