fix #2673: avoid visiting the same crate twice
Merge pull request #4668 from ILyoan/i2673

fix #2673: avoid visiting the same crate twice