You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#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 rust-lang#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 rust-lang#54658, thus resolving rust-lang#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.
Closesrust-lang#54647
0 commit comments