Auto merge of #46550 - jseyfried:cleanup_builtin_hygiene, r=nrc
macros: hygienize use of `core`/`std` in builtin macros Today, if a builtin macro wants to access an item from `core` or `std` (depending `#![no_std]`), it generates `::core::path::to::item` or `::std::path::to::item` respectively (c.f. `fn std_path()` in `libsyntax/ext/base.rs`). This PR refactors the builtin macros to instead always emit `$crate::path::to::item` here. That is, the def site of builtin macros is taken to be in `extern crate core;` or `extern crate std;`. Since builtin macros are macros 1.0 (i.e. mostly unhygienic), changing the def site can only effect the resolution of `$crate`. r? @nrc
This commit is contained in:
commit
3dfbc88a62
30 changed files with 174 additions and 140 deletions
|
|
@ -175,7 +175,7 @@ pub fn lower_crate(sess: &Session,
|
|||
let _ignore = dep_graph.in_ignore();
|
||||
|
||||
LoweringContext {
|
||||
crate_root: std_inject::injected_crate_name(krate),
|
||||
crate_root: std_inject::injected_crate_name(),
|
||||
sess,
|
||||
cstore,
|
||||
parent_def: None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue