-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #44186
Rollup of 8 pull requests #44186
Conversation
This commit fixes procedural macro attributes being attached to trait methods, ensuring that they get resolved and expanded as other procedural macro attributes. The bug here was that `current_module` on the resolver was accidentally set to be a trait when it's otherwise only ever expecting a `mod`/block module. The actual fix here came from @jseyfried, I'm just helping to land it in the compiler! Closes rust-lang#42493
This commit introduces the ability to create and emit `Diagnostic` structures from proc-macros, allowing for proc-macro authors to emit warning, error, note, and help messages just like the compiler does.
Brings in a few fixes for wasm/asmjs
This commit removes the `specialization_cache` field of `TyCtxt` by moving it to a dedicated query, which it turned out was already quite easily structured to do so!
…ion Checklist.
This map is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
This map, like `trait_map`, is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
…lnay Remove Splice struct return value from String::splice The implementation is now almost identical to the one in the RFC. Fixes rust-lang#44038 cc rust-lang#32310
rustc: Fix proc_macro expansions on trait methods This commit fixes procedural macro attributes being attached to trait methods, ensuring that they get resolved and expanded as other procedural macro attributes. The bug here was that `current_module` on the resolver was accidentally set to be a trait when it's otherwise only ever expecting a `mod`/block module. The actual fix here came from @jseyfried, I'm just helping to land it in the compiler! Closes rust-lang#42493
…mulacrum Update the libc submodule Brings in a few fixes for wasm/asmjs
Initial diagnostic API for proc-macros. This commit introduces the ability to create and emit `Diagnostic` structures from proc-macros, allowing for proc-macro authors to emit warning, error, note, and help messages just like the compiler does. The API is somewhat based on the diagnostic API already present in `rustc` with several changes that improve usability. The entry point into the diagnostic API is a new `Diagnostic` type which is primarily created through new `error`, `warning`, `help`, and `note` methods on `Span`. The `Diagnostic` type records the diagnostic level, message, and optional `Span` for the top-level diagnostic and contains a `Vec` of all of the child diagnostics. Child diagnostics can be added through builder methods on `Diagnostic`. A typical use of the API may look like: ```rust let token = parse_token(); let val = parse_val(); val.span .error(format!("expected A but found {}", val)) .span_note(token.span, "because of this token") .help("consider using a different token") .emit(); ``` cc @jseyfried @nrc @dtolnay @alexcrichton
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ p=100 |
📌 Commit fcd60bd has been approved by |
⌛ Testing commit fcd60bd9601a30e46e5fb35bc8f4500e95a9117f with merge 93b9eb1abf984b8d2b91dc3e24914e0c711f0438... |
💔 Test failed - status-appveyor |
@bors: r+ |
📌 Commit c08f583 has been approved by |
⌛ Testing commit c08f583d49bb894c769e23ced27c3dbb5ea681fc with merge d964b9c070ef7e11e2d36b4482fbdce542cdab2e... |
💔 Test failed - status-appveyor |
…r=eddyb rustc: Remove `specialization_cache` in favor of a query This commit removes the `specialization_cache` field of `TyCtxt` by moving it to a dedicated query, which it turned out was already quite easily structured to do so! cc rust-lang#44137
…labnik API docs: macros. Standard Documentation Checklist Fixes rust-lang#29381 r? @steveklabnik
Fix link in unstable book entry for Generators
@bors: r+ |
📌 Commit 5c279a4 has been approved by |
⌛ Testing commit 5c279a4 with merge e7152994517f9e0b123937d65338218b326b6550... |
💔 Test failed - status-travis |
@bors: r+ |
📌 Commit b9fea42 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
specialization_cache
in favor of a query #44157, API docs: macros. Standard Documentation Checklist #44160, Fix link in unstable book entry for Generators #44172trait_map
of TyCtxt private #44162