]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: cleanup query_compile to reuse destructure call
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 4 Apr 2023 14:34:03 +0000 (15:34 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:45 +0000 (18:28 +0100)
gcc/rust/ChangeLog:

* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-resolve-path.cc

index 382a30caa1b57449cc9c68dcec6697bfeb33207d..f9c509df2c39b5a02c5ddcee936fe613e3b83ddd 100644 (file)
@@ -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