diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc index cc7c11ccf22c..9c2be4a57160 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.cc +++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc @@ -23,6 +23,7 @@ #include "rust-ast-resolve-pattern.h" #include "rust-ast-resolve-path.h" #include "diagnostic.h" +#include "rust-expr.h" namespace Rust { namespace Resolver { @@ -94,6 +95,12 @@ ResolveExpr::visit (AST::MethodCallExpr &expr) ResolveExpr::go (*param, prefix, canonical_prefix); } +void +ResolveExpr::visit (AST::ErrorPropagationExpr &expr) +{ + ResolveExpr::go (expr.get_propagating_expr (), prefix, canonical_prefix); +} + void ResolveExpr::visit (AST::AssignmentExpr &expr) { diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index 12b4868e31e2..374ffb06fd5a 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -22,6 +22,7 @@ #include "rust-ast-resolve-base.h" #include "rust-ast.h" #include "rust-ast-resolve-pattern.h" +#include "rust-expr.h" namespace Rust { namespace Resolver { @@ -80,6 +81,7 @@ class ResolveExpr : public ResolverBase void visit (AST::RangeFromToInclExpr &expr) override; void visit (AST::ClosureExprInner &expr) override; void visit (AST::ClosureExprInnerTyped &expr) override; + void visit (AST::ErrorPropagationExpr &expr) override; protected: void resolve_closure_param (AST::ClosureParam ¶m,