From: bors Date: Sat, 1 Dec 2018 12:45:52 +0000 (+0000) Subject: Auto merge of #55275 - petrochenkov:extself, r=eddyb X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=d311571906bd2b22e206b9a84ccb888e248820df;p=rust.git Auto merge of #55275 - petrochenkov:extself, r=eddyb experiment: Support aliasing local crate root in extern prelude This PR provides some minimally invasive solution for the 2018 edition migration issue described in https://github.com/rust-lang/rust/issues/54647 and affecting proc macro crates. `extern crate NAME as RENAME;` now accepts `NAME`=`self` and interprets it as referring to the local crate. As with other `extern crate` items, `RENAME` in this case gets into extern prelude in accordance with https://github.com/rust-lang/rust/pull/54658, thus resolving https://github.com/rust-lang/rust/issues/54647. ```rust extern crate self as serde; // Adds local crate to extern prelude as `serde` ``` This solution doesn't introduce any new syntax and has minimal maintenance cost, so it can be easily deprecated if something better is found in the future. Closes https://github.com/rust-lang/rust/issues/54647 --- d311571906bd2b22e206b9a84ccb888e248820df