Skip to content
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

Merged
merged 20 commits into from
Aug 31, 2017
Merged

Rollup of 8 pull requests #44186

merged 20 commits into from
Aug 31, 2017

Conversation

alexcrichton and others added 15 commits August 25, 2017 15:57
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!
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
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

@bors: r+ p=100

@bors
Copy link
Contributor

bors commented Aug 30, 2017

📌 Commit fcd60bd has been approved by alexcrichton

@alexcrichton alexcrichton assigned alexcrichton and unassigned aturon Aug 30, 2017
@bors
Copy link
Contributor

bors commented Aug 30, 2017

⌛ Testing commit fcd60bd9601a30e46e5fb35bc8f4500e95a9117f with merge 93b9eb1abf984b8d2b91dc3e24914e0c711f0438...

@bors
Copy link
Contributor

bors commented Aug 30, 2017

💔 Test failed - status-appveyor

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 30, 2017

📌 Commit c08f583 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 30, 2017

⌛ Testing commit c08f583d49bb894c769e23ced27c3dbb5ea681fc with merge d964b9c070ef7e11e2d36b4482fbdce542cdab2e...

@bors
Copy link
Contributor

bors commented Aug 30, 2017

💔 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
@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 30, 2017

📌 Commit 5c279a4 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 30, 2017

⌛ Testing commit 5c279a4 with merge e7152994517f9e0b123937d65338218b326b6550...

@bors
Copy link
Contributor

bors commented Aug 30, 2017

💔 Test failed - status-travis

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 31, 2017

📌 Commit b9fea42 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 31, 2017

⌛ Testing commit b9fea42 with merge 890c87b...

bors added a commit that referenced this pull request Aug 31, 2017
Rollup of 8 pull requests

- Successful merges: #44044, #44089, #44116, #44125, #44154, #44157, #44160, #44172
- Failed merges: #44162
@bors
Copy link
Contributor

bors commented Aug 31, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 890c87b to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants