-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 8 pull requests #49696
Rollup of 8 pull requests #49696
Commits on Mar 24, 2018
-
Make queries thread safe. Remove the query stack and make queries poi…
…nt to their parents instead.
Configuration menu - View commit details
-
Copy full SHA for 29a4ec0 - Browse repository at this point
Copy the full SHA 29a4ec0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f7d0fd - Browse repository at this point
Copy the full SHA 4f7d0fdView commit details
Commits on Mar 30, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 71dc162 - Browse repository at this point
Copy the full SHA 71dc162View commit details
Commits on Apr 2, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 1074a22 - Browse repository at this point
Copy the full SHA 1074a22View commit details -
proc_macro: Reorganize public API
This commit is a reorganization of the `proc_macro` crate's public user-facing API. This is the result of a number of discussions at the recent Rust All-Hands where we're hoping to get the `proc_macro` crate into ship shape for stabilization of a subset of its functionality in the Rust 2018 release. The reorganization here is motivated by experiences from the `proc-macro2`, `quote`, and `syn` crates on crates.io (and other crates which depend on them). The main focus is future flexibility along with making a few more operations consistent and/or fixing bugs. A summary of the changes made from today's `proc_macro` API is: * The `TokenNode` enum has been removed and the public fields of `TokenTree` have also been removed. Instead the `TokenTree` type is now a public enum (what `TokenNode` was) and each variant is an opaque struct which internally contains `Span` information. This makes the various tokens a bit more consistent, require fewer wrappers, and otherwise provides good future-compatibility as opaque structs are easy to modify later on. * `Literal` integer constructors have been expanded to be unambiguous as to what they're doing and also allow for more future flexibility. Previously constructors like `Literal::float` and `Literal::integer` were used to create unsuffixed literals and the concrete methods like `Literal::i32` would create a suffixed token. This wasn't immediately clear to all users (the suffixed/unsuffixed aspect) and having *one* constructor for unsuffixed literals required us to pick a largest type which may not always be true. To fix these issues all constructors are now of the form `Literal::i32_unsuffixed` or `Literal::i32_suffixed` (for all integral types). This should allow future compatibility as well as being immediately clear what's suffixed and what isn't. * Each variant of `TokenTree` internally contains a `Span` which can also be configured via `set_span`. For example `Literal` and `Term` now both internally contain a `Span` rather than having it stored in an auxiliary location. * Constructors of all tokens are called `new` now (aka `Term::intern` is gone) and most do not take spans. Manufactured tokens typically don't have a fresh span to go with them and the span is purely used for error-reporting **except** the span for `Term`, which currently affects hygiene. The default spans for all these constructed tokens is `Span::call_site()` for now. The `Term` type's constructor explicitly requires passing in a `Span` to provide future-proofing against possible hygiene changes. It's intended that a first pass of stabilization will likely only stabilize `Span::call_site()` which is an explicit opt-in for "I would like no hygiene here please". The intention here is to make this explicit in procedural macros to be forwards-compatible with a hygiene-specifying solution. * Some of the conversions for `TokenStream` have been simplified a little. * The `TokenTreeIter` iterator was renamed to `token_stream::IntoIter`. Overall the hope is that this is the "final pass" at the API of `TokenStream` and most of `TokenTree` before stabilization. Explicitly left out here is any changes to `Span`'s API which will likely need to be re-evaluated before stabilization. All changes in this PR have already been reflected to the [`proc-macro2`], `quote`, and `syn` crates. New versions of all these crates have also been published to crates.io. Once this lands in nightly I plan on making an internals post again summarizing the changes made here and also calling on all macro authors to give the APIs a spin and see how they work. Hopefully pending no major issues we can then have an FCP to stabilize later this cycle! [`proc-macro2`]: https://docs.rs/proc-macro2/0.3.1/proc_macro2/
Configuration menu - View commit details
-
Copy full SHA for 553c04d - Browse repository at this point
Copy the full SHA 553c04dView commit details
Commits on Apr 3, 2018
-
Configuration menu - View commit details
-
Copy full SHA for c4c5214 - Browse repository at this point
Copy the full SHA c4c5214View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d74990 - Browse repository at this point
Copy the full SHA 5d74990View commit details
Commits on Apr 4, 2018
-
* Expand `!` tokens for inner doc comments * Trim leading doc comment decoration in the string literal Both of these should help bring the expansion inline with what `macro_rules!` already does. Closes rust-lang#49655 Closes rust-lang#49656
Configuration menu - View commit details
-
Copy full SHA for a57b1fb - Browse repository at this point
Copy the full SHA a57b1fbView commit details
Commits on Apr 5, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 64ddb39 - Browse repository at this point
Copy the full SHA 64ddb39View commit details -
Rollup merge of rust-lang#49045 - Zoxc:tls, r=michaelwoerister
Make queries thread safe This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack. This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606). cc @rust-lang/compiler r? @michaelwoerister
Configuration menu - View commit details
-
Copy full SHA for b0bd9a7 - Browse repository at this point
Copy the full SHA b0bd9a7View commit details -
Rollup merge of rust-lang#49350 - abonander:macros-in-extern, r=petro…
…chenkov Expand macros in `extern {}` blocks This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature. A tracking issue is now open at rust-lang#49476 closes rust-lang#48747
Configuration menu - View commit details
-
Copy full SHA for 46492ff - Browse repository at this point
Copy the full SHA 46492ffView commit details -
Bots that read the log can simply look for `[CI_JOB_NAME=...]` to find out the job's name.
Configuration menu - View commit details
-
Copy full SHA for 649f431 - Browse repository at this point
Copy the full SHA 649f431View commit details -
Configuration menu - View commit details
-
Copy full SHA for a29d4d9 - Browse repository at this point
Copy the full SHA a29d4d9View commit details -
Rollup merge of rust-lang#49497 - scalexm:hrtb, r=nikomatsakis
Chalkify - Tweak `Clause` definition and HRTBs r? @nikomatsakis
Configuration menu - View commit details
-
Copy full SHA for 72ac3eb - Browse repository at this point
Copy the full SHA 72ac3ebView commit details -
Rollup merge of rust-lang#49597 - alexcrichton:proc-macro-v2, r=petro…
…chenkov proc_macro: Reorganize public API This commit is a reorganization of the `proc_macro` crate's public user-facing API. This is the result of a number of discussions at the recent Rust All-Hands where we're hoping to get the `proc_macro` crate into ship shape for stabilization of a subset of its functionality in the Rust 2018 release. The reorganization here is motivated by experiences from the `proc-macro2`, `quote`, and `syn` crates on crates.io (and other crates which depend on them). The main focus is future flexibility along with making a few more operations consistent and/or fixing bugs. A summary of the changes made from today's `proc_macro` API is: * The `TokenNode` enum has been removed and the public fields of `TokenTree` have also been removed. Instead the `TokenTree` type is now a public enum (what `TokenNode` was) and each variant is an opaque struct which internally contains `Span` information. This makes the various tokens a bit more consistent, require fewer wrappers, and otherwise provides good future-compatibility as opaque structs are easy to modify later on. * `Literal` integer constructors have been expanded to be unambiguous as to what they're doing and also allow for more future flexibility. Previously constructors like `Literal::float` and `Literal::integer` were used to create unsuffixed literals and the concrete methods like `Literal::i32` would create a suffixed token. This wasn't immediately clear to all users (the suffixed/unsuffixed aspect) and having *one* constructor for unsuffixed literals required us to pick a largest type which may not always be true. To fix these issues all constructors are now of the form `Literal::i32_unsuffixed` or `Literal::i32_suffixed` (for all integral types). This should allow future compatibility as well as being immediately clear what's suffixed and what isn't. * Each variant of `TokenTree` internally contains a `Span` which can also be configured via `set_span`. For example `Literal` and `Term` now both internally contain a `Span` rather than having it stored in an auxiliary location. * Constructors of all tokens are called `new` now (aka `Term::intern` is gone) and most do not take spans. Manufactured tokens typically don't have a fresh span to go with them and the span is purely used for error-reporting **except** the span for `Term`, which currently affects hygiene. The default spans for all these constructed tokens is `Span::call_site()` for now. The `Term` type's constructor explicitly requires passing in a `Span` to provide future-proofing against possible hygiene changes. It's intended that a first pass of stabilization will likely only stabilize `Span::call_site()` which is an explicit opt-in for "I would like no hygiene here please". The intention here is to make this explicit in procedural macros to be forwards-compatible with a hygiene-specifying solution. * Some of the conversions for `TokenStream` have been simplified a little. * The `TokenTreeIter` iterator was renamed to `token_stream::IntoIter`. Overall the hope is that this is the "final pass" at the API of `TokenStream` and most of `TokenTree` before stabilization. Explicitly left out here is any changes to `Span`'s API which will likely need to be re-evaluated before stabilization. All changes in this PR have already been reflected to the [`proc-macro2`], `quote`, and `syn` crates. New versions of all these crates have also been published to crates.io. Once this lands in nightly I plan on making an internals post again summarizing the changes made here and also calling on all macro authors to give the APIs a spin and see how they work. Hopefully pending no major issues we can then have an FCP to stabilize later this cycle! [`proc-macro2`]: https://docs.rs/proc-macro2/0.3.1/proc_macro2/ Closes rust-lang#49596
Configuration menu - View commit details
-
Copy full SHA for e6947ec - Browse repository at this point
Copy the full SHA e6947ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 71bf15c - Browse repository at this point
Copy the full SHA 71bf15cView commit details -
Filter out missing components from manifests
This commit updates our manifest generation for rustup to filter out any components/extensions which are actually missing. This is intended to help mitigate rust-lang#49462 by making the manifests reflect reality, that many targets now are missing a `rust-docs` component rather than requiring it exists.
Configuration menu - View commit details
-
Copy full SHA for 59059f2 - Browse repository at this point
Copy the full SHA 59059f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83669ec - Browse repository at this point
Copy the full SHA 83669ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d239ab - Browse repository at this point
Copy the full SHA 4d239abView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd615e9 - Browse repository at this point
Copy the full SHA cd615e9View commit details