]> git.lizzy.rs Git - rust.git/commit
Auto merge of #89239 - petrochenkov:modcache, r=cjgillot
authorbors <bors@rust-lang.org>
Sat, 2 Oct 2021 16:17:13 +0000 (16:17 +0000)
committerbors <bors@rust-lang.org>
Sat, 2 Oct 2021 16:17:13 +0000 (16:17 +0000)
commitd14731cb3ced8318d7fc83cbe838f0e7f2fb3b40
tree9cc833c2e77c8c933b44eb8ef6baafe9bcb77b16
parentedebf77e0090195bf80c0d8cda821e1bf9d03053
parentd7d07657cd45a71f753a6a613d34dc8323ec3943
Auto merge of #89239 - petrochenkov:modcache, r=cjgillot

resolve: Cache module loading for all foreign modules

It was previously cached for modules loaded from `fn get_module`, but not for modules loaded from `fn build_reduced_graph_for_external_crate_res`.
This also makes all foreign modules use their real parent, span and expansion instead of possibly a parent/span/expansion of their reexport.
Modules are also often compared using referential equality (`ptr::eq`), this change makes such comparisons correct in all cases.

An ICE happening on attempt to decode expansions for foreign enums and traits is avoided.

Also local enums and traits are now added to the module map.

Follow up to https://github.com/rust-lang/rust/pull/88872.
r? `@cjgillot`