fix #2673: avoid visiting the same crate twice