diff options
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-generic-param.h | 4 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-path.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-generic-param.h b/gcc/rust/hir/tree/rust-hir-generic-param.h index 960de56..340b5c6 100644 --- a/gcc/rust/hir/tree/rust-hir-generic-param.h +++ b/gcc/rust/hir/tree/rust-hir-generic-param.h @@ -150,7 +150,7 @@ public: location_t get_locus () const override final { return locus; }; - bool has_default_expression () { return default_expression != nullptr; } + bool has_default_expression () const { return default_expression != nullptr; } std::string get_name () { return name; } Type &get_type () @@ -160,6 +160,8 @@ public: } Expr &get_default_expression () { return *default_expression; } + const Expr &get_default_expression () const { return *default_expression; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h index 5f88c68..4f296d8 100644 --- a/gcc/rust/hir/tree/rust-hir-path.h +++ b/gcc/rust/hir/tree/rust-hir-path.h @@ -132,6 +132,8 @@ public: std::unique_ptr<Expr> &get_expression () { return expression; } + location_t get_locus () const { return locus; } + private: std::unique_ptr<Expr> expression; location_t locus; @@ -150,7 +152,7 @@ public: bool has_generic_args () const { return !(lifetime_args.empty () && type_args.empty () - && binding_args.empty ()); + && binding_args.empty () && const_args.empty ()); } GenericArgs (std::vector<Lifetime> lifetime_args, |