[committed,018/103] gccrs: rust-ast-resolve-item: Add note about resolving glob uses

Message ID 20230221120230.596966-19-arthur.cohen@embecosm.com
State Unresolved
Headers
Series [committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Arthur Cohen Feb. 21, 2023, 12:01 p.m. UTC
  From: Arthur Cohen <arthur.cohen@embecosm.com>

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for
	glob import resolving.
---
 gcc/rust/resolve/rust-ast-resolve-item.cc | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index e5eb6e491e3..193e6834334 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -968,6 +968,14 @@  ResolveItem::visit (AST::UseDeclaration &use_item)
 {
   auto to_resolve = flatten_use_dec_to_paths (use_item);
 
+  // FIXME: I think this does not actually resolve glob use-decls and is going
+  // the wrong way about it. RFC #1560 specifies the following:
+  //
+  // > When we find a glob import, we have to record a 'back link', so that when
+  // a public name is added for the supplying module, we can add it for the
+  // importing module.
+  //
+  // Which is the opposite of what we're doing if I understand correctly?
   for (auto &path : to_resolve)
     ResolvePath::go (&path);
 }