From: bors Date: Sat, 22 Sep 2018 11:56:08 +0000 (+0000) Subject: Auto merge of #54265 - arielb1:civilize-proc-macros, r=alexcrichton X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e7b5ba8661aa844a06c37f22d7af0afb1807d347;p=rust.git Auto merge of #54265 - arielb1:civilize-proc-macros, r=alexcrichton avoid leaking host details in proc macro metadata decoding proc macro crates are essentially implemented as dynamic libraries using a dlopen-based ABI. They are also Rust crates, so they have 2 worlds - the "host" world in which they are defined, and the "target" world in which they are used. For all the "target" world knows, the proc macro crate might not even be implemented in Rust, so leaks of details from the host to the target must be avoided for correctness. Because the "host" DefId space is different from the "target" DefId space, any leak involving a DefId will have a nonsensical or out-of-bounds DefKey, and will cause all sorts of crashes. This PR fixes all leaks I have found in `decoder`. In particular, #54059 was caused by host native libraries leaking into the target, which feels like it might even be a correctness issue if it doesn't cause an ICE. Fixes #54059 --- e7b5ba8661aa844a06c37f22d7af0afb1807d347