There's a #[no_link] attribute that you can put on an extern crate foo; statement to declare that you don't want to link against an extern crate.

This is, according to the notes in the reference, intended so that you can use macros from that crate. However, I wonder if we can expand the attribute so that it also pulls in types from that crate? They're just aliases after all, you're not linking in any actual code by using them.

(Out of interest, is there a reason this is an attribute, and not default behavior?)

other than backward compatibility, you mean? for example, linking a crate can pull in #[no_mangle] symbols or native libraries that other parts of the application need, without that connection being apparent to rustc