diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-01-22 14:09:08 +0000 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-24 13:06:54 +0100 |
commit | 379b69c149dbbd3c6b3b3b341c58de0b39795be1 (patch) | |
tree | 2fe772eb5e5bb34b765a577a5d2938d47cecc599 /gcc/rust/expand/rust-expand-visitor.cc | |
parent | d9a02b1f6164428772a2eb8612cffb2eff9829d7 (diff) | |
download | gcc-379b69c149dbbd3c6b3b3b341c58de0b39795be1.zip gcc-379b69c149dbbd3c6b3b3b341c58de0b39795be1.tar.gz gcc-379b69c149dbbd3c6b3b3b341c58de0b39795be1.tar.bz2 |
gccrs: ast: More visitors to allow lang item paths in expressions
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Adapt visitor to lang item
PathInExpressions.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
* hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): Likewise.
(ASTLowerPathInExpression::visit): Likewise.
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
* resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
Diffstat (limited to 'gcc/rust/expand/rust-expand-visitor.cc')
-rw-r--r-- | gcc/rust/expand/rust-expand-visitor.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc index 38399d0d..6e06fa5 100644 --- a/gcc/rust/expand/rust-expand-visitor.cc +++ b/gcc/rust/expand/rust-expand-visitor.cc @@ -477,9 +477,10 @@ ExpandVisitor::visit (AST::MacroInvocation ¯o_invoc) void ExpandVisitor::visit (AST::PathInExpression &path) { - for (auto &segment : path.get_segments ()) - if (segment.has_generic_args ()) - expand_generic_args (segment.get_generic_args ()); + if (!path.is_lang_item ()) + for (auto &segment : path.get_segments ()) + if (segment.has_generic_args ()) + expand_generic_args (segment.get_generic_args ()); } void |