diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-02-16 15:40:28 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-01 10:35:07 +0000 |
commit | 9af2ae0ff91535da104db0d3828d863770439fad (patch) | |
tree | 57b375ba818f22c70066c87a4d9c2a1c1b78f69e /gcc/rust/hir/rust-ast-lower-expr.h | |
parent | 06bb1d6542a9d07f4d866613a5b039be7bcb5f95 (diff) | |
download | gcc-9af2ae0ff91535da104db0d3828d863770439fad.zip gcc-9af2ae0ff91535da104db0d3828d863770439fad.tar.gz gcc-9af2ae0ff91535da104db0d3828d863770439fad.tar.bz2 |
Support Generic arguments to Structs
This removes StructFieldType from the TyTy base as it is not a type that
can be unified against.
It adds in a substition mapper implementation which will likely change
over time when this this support is extended over to Functions and
TupleStructs.
Note generic argument binding is not supported as part of this yet.
Fixes #235
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-expr.h')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-expr.h | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lower-expr.h index ea07f73..b46861e 100644 --- a/gcc/rust/hir/rust-ast-lower-expr.h +++ b/gcc/rust/hir/rust-ast-lower-expr.h @@ -74,27 +74,7 @@ public: return compiler.translated; } - void visit (AST::PathInExpression &expr) - { - std::vector<HIR::PathExprSegment> path_segments; - expr.iterate_path_segments ([&] (AST::PathExprSegment &s) mutable -> bool { - rust_assert (s.has_generic_args () == false); // TODO - - HIR::PathIdentSegment is (s.get_ident_segment ().as_string ()); - HIR::PathExprSegment seg (is, s.get_locus ()); - path_segments.push_back (seg); - return true; - }); - - auto crate_num = mappings->get_current_crate (); - Analysis::NodeMapping mapping (crate_num, expr.get_node_id (), - mappings->get_next_hir_id (crate_num), - UNKNOWN_LOCAL_DEFID); - - translated = new HIR::PathInExpression (mapping, std::move (path_segments), - expr.get_locus (), - expr.opening_scope_resolution ()); - } + void visit (AST::PathInExpression &expr) override; private: ASTLowerPathInExpression () : translated (nullptr) {} |