aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-05 11:38:05 +0000
committerGitHub <noreply@github.com>2021-11-05 11:38:05 +0000
commite73922ef9f07c511c383cc37532d0324a1138d99 (patch)
treecbb57b666f3a9907175d710134d6783f130e7049 /gcc/rust/ast
parent8e992e371bbd896c8b605e1ebade5cad80b1b411 (diff)
parentf4c200fcfec75b3841640263609d2133ead0c518 (diff)
downloadgcc-e73922ef9f07c511c383cc37532d0324a1138d99.zip
gcc-e73922ef9f07c511c383cc37532d0324a1138d99.tar.gz
gcc-e73922ef9f07c511c383cc37532d0324a1138d99.tar.bz2
Merge #794
794: Fix unhandled type bounds in TypeAlias r=philberty a=philberty This adds support for trait-object-types and desugars HIR::TraitObjectTypeOneBound into a single HIR::TraitObjectType. This also adds the missing cases of the generic arguments to the TypeBoundPredicates. It also contains cleanup for helpers used during monomorphization and a recursion limiter which is likely set too low but it is good enough for the test-cases we have now to get good back-traces. Fixes #786 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/ast')
-rw-r--r--gcc/rust/ast/rust-type.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-type.h b/gcc/rust/ast/rust-type.h
index b38837c..2414b60 100644
--- a/gcc/rust/ast/rust-type.h
+++ b/gcc/rust/ast/rust-type.h
@@ -162,10 +162,7 @@ public:
class TraitObjectType : public Type
{
bool has_dyn;
- // TypeParamBounds type_param_bounds;
- std::vector<std::unique_ptr<TypeParamBound> >
- type_param_bounds; // inlined form
-
+ std::vector<std::unique_ptr<TypeParamBound> > type_param_bounds;
Location locus;
protected:
@@ -179,7 +176,7 @@ protected:
public:
TraitObjectType (
std::vector<std::unique_ptr<TypeParamBound> > type_param_bounds,
- Location locus, bool is_dyn_dispatch = false)
+ Location locus, bool is_dyn_dispatch)
: has_dyn (is_dyn_dispatch),
type_param_bounds (std::move (type_param_bounds)), locus (locus)
{}
@@ -215,6 +212,8 @@ public:
void accept_vis (ASTVisitor &vis) override;
+ bool is_dyn () const { return has_dyn; }
+
// TODO: mutable getter seems kinda dodgy
std::vector<std::unique_ptr<TypeParamBound> > &get_type_param_bounds ()
{