aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-finalize-imports-2.0.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/resolve/rust-finalize-imports-2.0.h')
-rw-r--r--gcc/rust/resolve/rust-finalize-imports-2.0.h57
1 files changed, 0 insertions, 57 deletions
diff --git a/gcc/rust/resolve/rust-finalize-imports-2.0.h b/gcc/rust/resolve/rust-finalize-imports-2.0.h
index 0fba5a5..d587a5e 100644
--- a/gcc/rust/resolve/rust-finalize-imports-2.0.h
+++ b/gcc/rust/resolve/rust-finalize-imports-2.0.h
@@ -49,62 +49,5 @@ private:
NameResolutionContext &ctx;
};
-// TODO: Fix documentation
-// How do we do that?
-//
-// We want to resolve in the EarlyNameResolver, but we want to declare in the
-// TopLevel Should the TopLevel declare stubs? How does rustc do it? How to do
-// that for globbing? Should we do globbing afterwards once we've declared all
-// the Uses*?
-//
-// Basically, for each use declare it in a separate map - in the
-// EarlyNameResolver resolve and fix the ForeverStack? Emptying the maps each
-// time?
-//
-// e.g. TopLevel builds a std::vector<NodeId, SimplePath> use_trees_to_resolve;
-// Early goes through and resolves the SimplePath, then replaces the NodeId with
-// the resolved one? Do we even need to do that?
-//
-// rustc just creates an empty definition for the use tree.
-//
-// What about globbing? std::vector<GlobbulesPath> globules;
-// Early goes through and visits the module's path and calls the
-// GlobbingVisitor?
-//
-// the file `imports.rs` goes through and *finalizes* imports. So we can
-// probably add a FinalizeImport pass after the TopLevel and the Early.
-// - TopLevel takes care of declaring these use trees
-// - Early takes care of resolving them to definition points
-// - Finalize takes care of mapping the use's definition point to the actual
-// definition point
-// - We need to work more on that last bit to know exactly what is being
-// inserted, but probably it's going to mutate the ForeverStack - is that okay?
-// - Oh actually maybe no!
-// - TopLevel creates a map of UseTrees with paths to resolve. This should
-// probably be an ImportKind enum or whatever
-// - Early resolves them, creates a map of SimplePath with the associated
-// definition: Map<ImportKind, ImportData>
-// - Finalizes visits all UseTrees and inserts the Definitions found for
-// each ImportKind - easy!
-// - yay!
-
-class FinalizeImports : DefaultResolver
-{
-public:
- FinalizeImports (Early::ImportMappings &&data, TopLevel &toplevel,
- NameResolutionContext &ctx);
-
- void go (AST::Crate &crate);
-
-private:
- using AST::DefaultASTVisitor::visit;
-
- void visit (AST::UseDeclaration &) override;
-
- Early::ImportMappings data;
- TopLevel &toplevel;
- NameResolutionContext &ctx;
-};
-
} // namespace Resolver2_0
} // namespace Rust