Fixes ICEs using associated types cross crate

r? @nick29581