From 3a360b9481fe5a09053872e99a5c18de15e3968f Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 4 Apr 2023 15:34:03 +0100 Subject: 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 --- gcc/rust/backend/rust-compile-resolve-path.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gcc/rust/backend') 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 (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 -- cgit v1.1