diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2023-07-12 09:48:31 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-07-12 09:07:30 +0000 |
commit | 4bbf156f3300590d9867b9e72ff9bb39e8a6f67a (patch) | |
tree | ca75040bc991338f7cfc0f65cf320a9931547e9f /gcc | |
parent | a8d9f91114b0c1fae9ac3e921925113e2a218a1f (diff) | |
download | gcc-4bbf156f3300590d9867b9e72ff9bb39e8a6f67a.zip gcc-4bbf156f3300590d9867b9e72ff9bb39e8a6f67a.tar.gz gcc-4bbf156f3300590d9867b9e72ff9bb39e8a6f67a.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>
Diffstat (limited to 'gcc')
-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 afeef40..efdaae9 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 |