From: Marc Poulhiès Date: Wed, 12 Jul 2023 07:48:31 +0000 (+0200) Subject: gccrs: minor HIR cleanup X-Git-Tag: basepoints/gcc-15~2357 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ded9de82c10f8783a4f2ec52d2930bad07b32468;p=thirdparty%2Fgcc.git gccrs: minor HIR cleanup 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 --- diff --git a/gcc/rust/hir/tree/rust-hir-type.h b/gcc/rust/hir/tree/rust-hir-type.h index 3d1f8de7d634..f6d5ab24f354 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