aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-04-04 15:34:03 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:28:45 +0100
commit3a360b9481fe5a09053872e99a5c18de15e3968f (patch)
tree9756fa65ecef66285caab1981b7b916e32a6b0f0 /gcc/rust/backend/rust-compile-resolve-path.cc
parent0997c419a4885c2898259b5dc060037b9afae8d0 (diff)
downloadgcc-3a360b9481fe5a09053872e99a5c18de15e3968f.zip
gcc-3a360b9481fe5a09053872e99a5c18de15e3968f.tar.gz
gcc-3a360b9481fe5a09053872e99a5c18de15e3968f.tar.bz2
gccrs: cleanup query_compile to reuse destructure call
gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure 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.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 382a30c..f9c509d 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -248,12 +248,7 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
ok = ctx->get_tyctx ()->lookup_receiver (mappings.get_hirid (),
&receiver);
rust_assert (ok);
-
- if (receiver->get_kind () == TyTy::TypeKind::PARAM)
- {
- TyTy::ParamType *p = static_cast<TyTy::ParamType *> (receiver);
- receiver = p->resolve ();
- }
+ receiver = receiver->destructure ();
// the type resolver can only resolve type bounds to their trait
// item so its up to us to figure out if this path should resolve