diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-01-22 14:09:08 +0000 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2025-01-28 17:35:37 +0000 |
commit | 38bee03f98cdf12e891035a3345832a97042c8a8 (patch) | |
tree | 2215f016508dd6f8ce3106465aa58ded85d289fc /gcc/rust/resolve/rust-ast-resolve-path.cc | |
parent | 52ffcb82ec4699bc18027be37f31c614389c34b7 (diff) | |
download | gcc-38bee03f98cdf12e891035a3345832a97042c8a8.zip gcc-38bee03f98cdf12e891035a3345832a97042c8a8.tar.gz gcc-38bee03f98cdf12e891035a3345832a97042c8a8.tar.bz2 |
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/resolve/rust-ast-resolve-path.cc')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-path.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc index b50f94f..9fefc0f 100644 --- a/gcc/rust/resolve/rust-ast-resolve-path.cc +++ b/gcc/rust/resolve/rust-ast-resolve-path.cc @@ -18,6 +18,7 @@ #include "rust-ast-resolve-path.h" #include "rust-ast-resolve-type.h" +#include "rust-hir-map.h" #include "rust-path.h" namespace Rust { @@ -49,6 +50,10 @@ ResolvePath::go (AST::SimplePath &expr) NodeId ResolvePath::resolve_path (AST::PathInExpression &expr) { + if (expr.is_lang_item ()) + return Analysis::Mappings::get ().get_lang_item_node ( + expr.get_lang_item ()); + NodeId resolved_node_id = UNKNOWN_NODEID; NodeId module_scope_id = resolver->peek_current_module_scope (); NodeId previous_resolved_node_id = module_scope_id; |