diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-08-20 12:34:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 12:34:35 +0000 |
commit | 79754bd20bdfa64a4ce91e5b4a65154c313b2d83 (patch) | |
tree | 47dc551f706c4015c017a299a4054cb7db460857 /gcc/rust/resolve/rust-ast-resolve-expr.h | |
parent | 387f73626ae0e04c3f81d71d4de6780a4caad052 (diff) | |
parent | 048261647afd1a08f681b78c90c58a9baaeef76d (diff) | |
download | gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.zip gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.tar.gz gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.tar.bz2 |
Merge #626
626: Optional trait items r=philberty a=philberty
Optional trait items like function may contain associated types. These
are dependant on the associated impl block for this type in order to
correctly propagate the correct types for the associated trait item during
type checking and compilation.
Fixes #542
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-expr.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index e7e37d4..c5f88f9 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -39,10 +39,22 @@ public: resolver.resolve_path (expr); } + static void go (AST::QualifiedPathInExpression *expr, NodeId parent) + { + ResolvePath resolver (parent); + resolver.resolve_path (expr); + } + private: ResolvePath (NodeId parent) : ResolverBase (parent) {} void resolve_path (AST::PathInExpression *expr); + + void resolve_path (AST::QualifiedPathInExpression *expr); + + void resolve_segments (CanonicalPath prefix, size_t offs, + std::vector<AST::PathExprSegment> &segs, + NodeId expr_node_id, Location expr_locus); }; class ResolveExpr : public ResolverBase @@ -75,6 +87,11 @@ public: ResolvePath::go (&expr, parent); } + void visit (AST::QualifiedPathInExpression &expr) override + { + ResolvePath::go (&expr, parent); + } + void visit (AST::ReturnExpr &expr) override { if (expr.has_returned_expr ()) |