From 3dccdb1d6c57e983bed7135b4bc9ba7e1ae20fab Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 2 Nov 2021 17:10:24 +0000 Subject: Desugar AST::TraitObjectTypeOneBound We have two ways to represent TraitObjectType's: - AST::TraitObjectType - AST::TraitObjectTypeOneBound This desugars this within HIR into a single HIR::TraitObjectType which contains a list of bounds. Addresses #786 --- gcc/rust/ast/rust-type.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gcc/rust/ast') 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 > - type_param_bounds; // inlined form - + std::vector > type_param_bounds; Location locus; protected: @@ -179,7 +176,7 @@ protected: public: TraitObjectType ( std::vector > 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 > &get_type_param_bounds () { -- cgit v1.1