Uh oh!
There was an error while loading. Please reload this page.
macros: improve reexports - #37463
Conversation
670dde0 to
6a83458Comparecc @eddyb@alexcrichton |
6a83458 to
70eca75CompareThere was a problem hiding this comment.
We should just encode the raw tokens - which would get us proper spans from the original source.
There was a problem hiding this comment.
Agreed, but I'd rather change that in a separate PR.
9399bd2 to
ea80c32Comparebors
commented
Oct 30, 2016
☔ The latest upstream changes (presumably #37431) made this pull request unmergeable. Please resolve the merge conflicts. |
ea80c32 to
b0babc8Compareb3bb0a7 to
bac13dcCompareThere was a problem hiding this comment.
This would be clearer using else if !macros_only { callback(exp) } and/or using a match rather than if let
There was a problem hiding this comment.
I'd prefer to use a qualified name rather than have this NS suffix on each variant, but not essential to landing
There was a problem hiding this comment.
Why do we record macros in the HIR and start with HIR to make the metadata? I'd have thought the HIR should be totally ignorant of macros and we could generate metadata from the AST.
There was a problem hiding this comment.
The AST is no longer around when we generate metadata.
If we don't want to include exported macros in the HIR, I think the best alternative would be to move the AST's exported macros into a local in driver::compile_input and pass them directly to the metadata encoder.
There was a problem hiding this comment.
Don't see any improvement from that. OTOH, HIR is nicer for incremental recompilation.
bors
commented
Nov 7, 2016
☔ The latest upstream changes (presumably #37506) made this pull request unmergeable. Please resolve the merge conflicts. |
ed42dfc to
57d781dComparejseyfried
commented
Nov 7, 2016
@bors r=nrc |
bors
commented
Nov 7, 2016
📌 Commit 57d781d has been approved by |
bors
commented
Nov 7, 2016
⌛ Testing commit 57d781d with merge 8840d92... |
bors
commented
Nov 7, 2016
💔 Test failed - auto-linux-cross-opt |
57d781d to
f967566Comparejseyfried
commented
Nov 8, 2016
@bors r=nrc |
bors
commented
Nov 8, 2016
📌 Commit f967566 has been approved by |
f967566 to
3d760d7Comparethat is referenced by multiple `extern crate` items.
3d760d7 to
b2fa1b6Comparejseyfried
commented
Nov 10, 2016
@bors r=nrc |
bors
commented
Nov 10, 2016
📌 Commit b2fa1b6 has been approved by |
bors
commented
Nov 10, 2016
⌛ Testing commit b2fa1b6 with merge 8510b2e... |
bors
commented
Nov 10, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
b2fa1b6 to
a0a9f8cComparejseyfried
commented
Nov 10, 2016
@bors r=nrc |
bors
commented
Nov 10, 2016
📌 Commit a0a9f8c has been approved by |
bors
commented
Nov 10, 2016
⌛ Testing commit a0a9f8c with merge ab03f85... |
macros: improve reexports This PR - avoids building multiple module graphs for a crate that is referenced by multiple `extern crate` items, - registers `#[no_link] extern crate`s to avoid loading the same crate metadata twice, - stability checks `#[no_link] extern crate`s, - [breaking-chage]: `#[no_link] #[macro_use] extern crate syntax;` is allowed on stable today - fixes `$crate` in `#[macro_reexport]`ed macros, - [breaking-change] for `#[feature(macro_reexport)]` (technically) - allows selective macro importing (i.e. `#[macro_use(foo, bar)]`) from custom derive crates, and - refactors the crate metadata to support re-exported macros in arbitrary modules (not yet needed). r? @nrc
bors
commented
Nov 10, 2016
rustc_metadata: don't break the version check when CrateRoot changes. In #36551 I made `rustc_version` a field of `CrateRoot`, but despite it being the first field, one could still break the version check by changing `CrateRoot` so older compilers couldn't fully decode it (e.g. #37463). This PR fixes#37803 by moving the version string back at the beginning of metadata, right after the 32-bit big-endian absolute position of `CrateRoot`, and by incrementing `METADATA_VERSION`.
This PR
$cratein#[macro_reexport]ed macros,#[feature(macro_reexport)](technically)#[no_link] extern crates,#[no_link] #[macro_use] extern crate syntax;is allowed on stable today#[macro_use(foo, bar)]) from custom derive crates,extern crateitems,#[no_link] extern crates to avoid loading the same crate metadata twice, andr? @nrc