diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2023-07-12 09:48:31 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:49:36 +0100 |
commit | ded9de82c10f8783a4f2ec52d2930bad07b32468 (patch) | |
tree | 3272c3d61deee68784d0599206772de80a36606e | |
parent | 686653b12201656c5ad2a67833ea01136d555ecc (diff) | |
download | gcc-ded9de82c10f8783a4f2ec52d2930bad07b32468.zip gcc-ded9de82c10f8783a4f2ec52d2930bad07b32468.tar.gz gcc-ded9de82c10f8783a4f2ec52d2930bad07b32468.tar.bz2 |
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 <dkm@kataplop.net>
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-type.h | 12 |
1 files changed, 2 insertions, 10 deletions
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<Type> &get_type () - { - rust_assert (param_type != nullptr); - return param_type; - } + std::unique_ptr<Type> &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<Type> &get_return_type () - { - rust_assert (has_return_type ()); - return return_type; - } + std::unique_ptr<Type> &get_return_type () { return return_type; } protected: /* Use covariance to implement clone function as returning this object rather |