bors[bot] f0b7c02f16
Merge #7892
7892: Fix TokenStream::from_str for input consisting of a single group with delimiter r=edwin0cheng a=kevinmehall

TokenStream holds a `tt::Subtree` but assumes its `delimiter` is always `None`. In particular, the iterator implementation iterates over the inner `token_trees` and ignores the `delimiter`.

However, `TokenStream::from_str` violated this assumption when the input consists of a single group by producing a Subtree with an outer delimiter, which was ignored as seen by a procedural macro.

`tt::Subtree` is just `pub delimiter: Option<Delimiter>, pub token_trees: Vec<TokenTree>`, so a Subtree that is statically guaranteed not to have a delimiter is just `Vec<TokenTree>`.

Fixes #7810
Fixes #7875

Co-authored-by: Kevin Mehall <km@kevinmehall.net>
2021-03-07 00:32:56 +00:00
..
2021-03-02 14:27:29 +02:00
2021-03-05 20:25:24 +02:00
2021-03-05 15:59:50 +02:00
2021-03-06 20:22:36 +00:00
2021-03-03 23:04:11 +01:00
2021-03-06 04:57:34 +08:00
2021-03-02 14:27:29 +02:00
2021-03-02 15:33:22 -05:00
2021-02-25 05:47:13 +08:00