]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
gccrs: destructure parameter names.
authorPhilip Herron <herron.philip@googlemail.com>
Fri, 3 Mar 2023 16:12:46 +0000 (16:12 +0000)
committerPhilip Herron <philip.herron@embecosm.com>
Fri, 3 Mar 2023 19:27:24 +0000 (19:27 +0000)
When we have complex generic code you can end up with situations where we
compile types:

  Maybe<<S as Foo>::A>

Into

  Maybe<<placeholder:<Projection=::()>>>

This calls destructure to cleanup the naming here and avoid making non
canonical TREE_TYPES hitting the verify_gimple code triggering non-trival
constructors.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

* typecheck/rust-tyty.cc (ParamType::get_name): call destructure

gcc/rust/typecheck/rust-tyty.cc

index 110f59266f363337f96f235d64b7313d573403df..e6dfc561fbf24fd51003fbc3d653be91387767cd 100644 (file)
 
 #include "rust-tyty.h"
 
-#include "rust-hir-type-check-expr.h"
-#include "rust-hir-type-check-type.h"
 #include "rust-tyty-visitor.h"
-#include "rust-tyty-call.h"
 #include "rust-hir-map.h"
 #include "rust-location.h"
 #include "rust-linemap.h"
@@ -2961,7 +2958,7 @@ ParamType::get_name () const
   if (!can_resolve ())
     return get_symbol ();
 
-  return resolve ()->get_name ();
+  return destructure ()->get_name ();
 }
 
 bool