Skip to content

Conversation

@matklad
Copy link
Contributor

@matklad matklad commented Sep 5, 2021

internal: remove accidental code re-use
FragmentKind played two roles:

  • entry point to the parser
  • syntactic category of a macro call

These are different use-cases, and warrant different types. For example,
macro can't expand to visibility, but we have such fragment today.

This PR introduces ExpandsTo enum to separate this two use-cases.

I suspect we might further split FragmentKind into $x:specifier enum
specific to MBE, and a general parser entry point, but that's for
another PR!

bors r+
🤖

FragmentKind played two roles:

* entry point to the parser
* syntactic category of a macro call

These are different use-cases, and warrant different types. For example,
macro can't expand to visibility, but we have such fragment today.

This PR introduces `ExpandsTo` enum to separate this two use-cases.

I suspect we might further split `FragmentKind` into `$x:specifier` enum
specific to MBE, and a general parser entry point, but that's for
another PR!
@matklad matklad changed the title Don't dump DefMaps to build the panic context internal: remove accidental code re-use Sep 5, 2021
@bors
Copy link
Contributor

bors bot commented Sep 5, 2021

@bors bors bot merged commit b73b321 into rust-lang:master Sep 5, 2021
@jonas-schievink
Copy link
Contributor

huh, looks like bors messed up the commit message in b73b321

@matklad
Copy link
Contributor Author

matklad commented Sep 5, 2021

It’s not bors, it’s me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants