From ded9de82c10f8783a4f2ec52d2930bad07b32468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Wed, 12 Jul 2023 09:48:31 +0200 Subject: gccrs: minor HIR cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove more rust_assert in accessors. gcc/rust/ChangeLog: * hir/tree/rust-hir-type.h (MaybeNamedParam::get_type): Remove rust_assert. (BareFunctionType::get_return_type): Likewise. Signed-off-by: Marc Poulhiès --- gcc/rust/hir/tree/rust-hir-type.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/hir/tree/rust-hir-type.h b/gcc/rust/hir/tree/rust-hir-type.h index 3d1f8de..f6d5ab2 100644 --- a/gcc/rust/hir/tree/rust-hir-type.h +++ b/gcc/rust/hir/tree/rust-hir-type.h @@ -742,11 +742,7 @@ public: Location get_locus () const { return locus; } - std::unique_ptr &get_type () - { - rust_assert (param_type != nullptr); - return param_type; - } + std::unique_ptr &get_type () { return param_type; } ParamKind get_param_kind () const { return param_kind; } @@ -829,11 +825,7 @@ public: } // TODO: would a "vis_type" be better? - std::unique_ptr &get_return_type () - { - rust_assert (has_return_type ()); - return return_type; - } + std::unique_ptr &get_return_type () { return return_type; } protected: /* Use covariance to implement clone function as returning this object rather -- cgit v1.1