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
committerPhilip Herron <philip.herron@embecosm.com>2023-04-05 09:24:55 +0000
commitde9adfef3d008230ef165b1a3bf8c12bb0f7b6d5 (patch)
treeb281495bc1aa7f78df9fab6b26a0609cf3455368 /gcc/rust/backend/rust-compile-resolve-path.cc
parentb9fc7b51a46192a30f445bbca7b1dd857fa0c856 (diff)
downloadgcc-de9adfef3d008230ef165b1a3bf8c12bb0f7b6d5.zip
gcc-de9adfef3d008230ef165b1a3bf8c12bb0f7b6d5.tar.gz
gcc-de9adfef3d008230ef165b1a3bf8c12bb0f7b6d5.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 8857df2..ceea4f6 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