rune icon indicating copy to clipboard operation
rune copied to clipboard

Nested import spins forever if name is same as module

Open udoprog opened this issue 3 years ago • 0 comments

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.

udoprog avatar Dec 16 '21 15:12 udoprog