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

syntax: Remove Nt(Impl,Trait,Foreign)Item #69423

Merged
merged 1 commit into from
Feb 26, 2020
Merged

Conversation

petrochenkov
Copy link
Contributor

Follow-up to #69366.
r? @Centril

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2020
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I wonder whether we have a test for trait items specifically that exercises the interaction with NtTraitItem and parameter names on Rust 2015. It doesn't seem like this would cause any problems re. that as Annotatable::TraitItems would still cause us to parse using parse_trait_item. But could you double check? r=me with that and these comments considered.

src/libsyntax/token.rs Show resolved Hide resolved
src/librustc_parse/parser/item.rs Outdated Show resolved Hide resolved
src/librustc_expand/expand.rs Outdated Show resolved Hide resolved
@petrochenkov
Copy link
Contributor Author

I wonder whether we have a test for trait items specifically that exercises the interaction with NtTraitItem and parameter names on Rust 2015.

These nonterminals shouldn't be observable during parsing, they are an implementation details of, well, not even expansion, but pretty-printing.
If tokens in a TokenStream are packed into a nonterminal with an AST piece inside, then they are printed more nicely using the AST pretty-printer.

After #62667 tokens streams themselves are printed pretty nicely, so I want to try removing this piece of code in expand.rs entirely in a follow-up PR.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2020
@petrochenkov
Copy link
Contributor Author

Updated.

@petrochenkov
Copy link
Contributor Author

@bors r=Centril

@bors
Copy link
Contributor

bors commented Feb 24, 2020

📌 Commit d134385 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 24, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 25, 2020
syntax: Remove `Nt(Impl,Trait,Foreign)Item`

Follow-up to rust-lang#69366.
r? @Centril
bors added a commit that referenced this pull request Feb 26, 2020
Rollup of 7 pull requests

Successful merges:

 - #67637 (Add primitive module to libcore)
 - #69387 (Deduplicate identifier printing a bit)
 - #69412 (Mark attributes consumed by `check_mod_attrs` as normal)
 - #69423 (syntax: Remove `Nt(Impl,Trait,Foreign)Item`)
 - #69429 (remove redundant clones and import)
 - #69457 (Clean up e0370 e0371)
 - #69468 ([master] Backport release notes of 1.41.1)

Failed merges:

r? @ghost
@bors bors merged commit 7603c2c into rust-lang:master Feb 26, 2020
bors added a commit that referenced this pull request Feb 29, 2020
[experiment] expand: Stop using nonterminals when passing items to proc macro attributes

Implement the suggestion from #69423 (comment).
r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants