rune
rune copied to clipboard
Nested import spins forever if name is same as module
A nested import where the item imported is the same as the module being imported causes import resolution to spin forever.
For example, like this:
mod foo {}
use foo::foo;
What's probably causing this is that the last component in the import foo::foo is lazily registered in the namespace. And once we try to resolve it as the leading component in foo::foo it just tries to resolve itself.