Hi all,
I seem to to be able to find the correct syntax for doing the following: in a submodule I want to import the root module as a single namespace. So I want to do something like this (non-working code):
mod submodule {
use super as root_module;
}
Now, I know that paths in use statements are relative to the root module so using super
doesn't make sense and compiler understandably says no super in the root
. But I can't find what should be used there to reference to the root module as a whole. I've tried:
use super as root_module
use self as root_module
use :: as root_module
use ::self as root_module
use ::{self} as root_module
So the only two options I see is either use *
which is not exactly what I want or always prepend references to modules inside root module with ::
.
Does anyone have an idea how to import root module as a single named namespace in the submodule?