about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-02-24 15:52:11 -0800
committerGitHub <noreply@github.com>2018-02-24 15:52:11 -0800
commit43d1d6e885fcdc6f87a6921d9e968023dab9798b (patch)
tree250303e0895590dc4b38c406a94ae82f8e36420b /src/test/incremental/thinlto
parent9901befe06c7ffe7eda163c08e180de45808f82a (diff)
parent8872e7b593e0e7a6c5fdf519beb878b74be994e8 (diff)
downloadrust-43d1d6e885fcdc6f87a6921d9e968023dab9798b.tar.gz
rust-43d1d6e885fcdc6f87a6921d9e968023dab9798b.zip
Rollup merge of #48415 - QuietMisdreavus:traits-on-traits-on-traits, r=Manishearth
rustdoc: don't crash when an external trait's docs needs to import another trait

Fixes https://github.com/rust-lang/rust/issues/48414

When resolving intra-paths for an item, rustdoc needs to have information about their items on hand, for proper bookkeeping. When loading a path for an external item, it needs to load these items from their host crate, since their information isn't otherwise available. This includes resolving paths for those docs. which can cause this process to recurse. Rustdoc keeps a map of external traits in a `RefCell<HashMap<DefId, Trait>>`, and it keeps a borrow of this active when importing an external trait. In the linked crash, this led to a RefCell borrow error, panic, and ICE.

This PR manually releases the borrow while importing the trait, and also keeps a list of traits being imported at the given moment. The latter keeps rustdoc from infinitely recursing as it tries to import the same trait repeatedly.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions