aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/tree/rust-hir-path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-path.cc')
-rw-r--r--gcc/rust/hir/tree/rust-hir-path.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-path.cc b/gcc/rust/hir/tree/rust-hir-path.cc
index 7db2b25..ee4a572 100644
--- a/gcc/rust/hir/tree/rust-hir-path.cc
+++ b/gcc/rust/hir/tree/rust-hir-path.cc
@@ -133,6 +133,8 @@ PathExprSegment::operator= (PathExprSegment const &other)
void
PathPattern::iterate_path_segments (std::function<bool (PathExprSegment &)> cb)
{
+ rust_assert (kind == Kind::Segmented);
+
for (auto it = segments.begin (); it != segments.end (); it++)
{
if (!cb (*it))
@@ -150,6 +152,15 @@ PathInExpression::PathInExpression (Analysis::NodeMapping mappings,
has_opening_scope_resolution (has_opening_scope_resolution), locus (locus)
{}
+PathInExpression::PathInExpression (Analysis::NodeMapping mappings,
+ LangItem::Kind lang_item, location_t locus,
+ bool has_opening_scope_resolution,
+ std::vector<AST::Attribute> outer_attrs)
+ : PathPattern (lang_item),
+ PathExpr (std::move (mappings), std::move (outer_attrs)),
+ has_opening_scope_resolution (has_opening_scope_resolution), locus (locus)
+{}
+
bool
PathInExpression::is_self () const
@@ -358,6 +369,15 @@ QualifiedPathInExpression::QualifiedPathInExpression (
path_type (std::move (qual_path_type)), locus (locus)
{}
+QualifiedPathInExpression::QualifiedPathInExpression (
+ Analysis::NodeMapping mappings, QualifiedPathType qual_path_type,
+ LangItem::Kind lang_item, location_t locus,
+ std::vector<AST::Attribute> outer_attrs)
+ : PathPattern (lang_item),
+ PathExpr (std::move (mappings), std::move (outer_attrs)),
+ path_type (std::move (qual_path_type)), locus (locus)
+{}
+
QualifiedPathInType::QualifiedPathInType (
Analysis::NodeMapping mappings, QualifiedPathType qual_path_type,
std::unique_ptr<TypePathSegment> associated_segment,