]> git.lizzy.rs Git - rust.git/commit
Auto merge of #23085 - goffrie:interpolating-quote, r=huonw
authorbors <bors@rust-lang.org>
Sun, 26 Apr 2015 09:52:28 +0000 (09:52 +0000)
committerbors <bors@rust-lang.org>
Sun, 26 Apr 2015 09:52:28 +0000 (09:52 +0000)
commit6365080c5cd27b74ec87420c351a3e7bdcff988e
tree4cace13a2f04314b229a2c1860b7f672deb96ec4
parentb0043db4658feed7b7d17fd45285745d8af38001
parent24ef90527351bb1a52c8b54e948cdbba8db3eef6
Auto merge of #23085 - goffrie:interpolating-quote, r=huonw

This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed.

The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed.

New `Nonterminal`s are added: NtArm, NtImplItem, and NtTraitItem. These are just for quasiquote, not macros.

`ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense).

This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987.

As such, this is a [breaking-change].

Fixes #16472.
Fixes #15962.
Fixes #17397.
Fixes #16617.