fix #2673: avoid visiting the same crate twice

fix #2673