aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/tree/rust-hir.h
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2023-07-10 20:24:56 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:35 +0100
commitc12f4bc804aea07f0e9cb510c90b6cde1f0738ac (patch)
treed9778a64ba1ae04895e68ab3ae53a352769221a7 /gcc/rust/hir/tree/rust-hir.h
parent9c99d52d00a941f48d93ae116cd425440bdfa5b2 (diff)
downloadgcc-c12f4bc804aea07f0e9cb510c90b6cde1f0738ac.zip
gcc-c12f4bc804aea07f0e9cb510c90b6cde1f0738ac.tar.gz
gcc-c12f4bc804aea07f0e9cb510c90b6cde1f0738ac.tar.bz2
gccrs: minor HIR cleanup
Add one more accessor and remove some rust_assert() in accessors for unique_ptr&. gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h (TypeCastExpr::get_casted_expr): Remove assert in accessor. (TypeCastExpr::get_type_to_convert_to): Likewise. (CompoundAssignmentExpr::get_left_expr): Likewise. (CompoundAssignmentExpr::get_right_expr): Likewise. (GroupedExpr::get_expr_in_parens): Likewise. (TupleIndexExpr::get_tuple_expr): Likewise. (FieldAccessExpr::get_receiver_expr): Likewise. (ClosureParam::get_pattern): Likewise. (ClosureParam::get_type): Likewise. (ExprType::get_return_type): Likewise. (IfLetExpr::get_scrutinee_expr): Likewise. (MatchArm::get_guard_expr): Likewise. (MatchExpr::get_scrutinee_expr): Likewise. * hir/tree/rust-hir-item.h (TypeParam::get_type): Likewise. (SelfParam::get_type): Likewise. (Function::get_return_type): Likewise. (TypeAlias::get_type_aliased): Likewise. (StructField::get_field_type): Likewise. (TraitFunctionDecl::get_block_expr): Likewise. (ImplBlock::get_trait_ref): Likewise. * hir/tree/rust-hir-path.h (ConstGenericArg::get_expression): New. (TypePathFunction::get_return_type): Remove assert in accessor. (QualifiedPathType::get_trait): Likewise. * hir/tree/rust-hir-pattern.h (PatternType::get_lower_bound): Likewise. (PatternType::get_upper_bound): Likewise. (ReferencePattern::get_referenced_pattern): Likewise. * hir/tree/rust-hir.h (ConstGenericParam::get_default_expression): Likewise. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir.h')
-rw-r--r--gcc/rust/hir/tree/rust-hir.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h
index 4e00385..578e126 100644
--- a/gcc/rust/hir/tree/rust-hir.h
+++ b/gcc/rust/hir/tree/rust-hir.h
@@ -754,8 +754,6 @@ public:
std::unique_ptr<Type> &get_type () { return type; }
std::unique_ptr<Expr> &get_default_expression ()
{
- rust_assert (has_default_expression ());
-
return default_expression;
}