diff options
author | Kevin Mehall <[email protected]> | 2021-03-06 16:36:22 +0000 |
---|---|---|
committer | Kevin Mehall <[email protected]> | 2021-03-06 16:48:08 +0000 |
commit | 632fa8ef4a3c9e7440b79e04a9f7dd9bd23a4de4 (patch) | |
tree | 61dfaffb6b23173f53a7796dc6dfa80b50ef8726 /crates/hir_ty/src/infer.rs | |
parent | 750d3cb84678b23a55092f2e4726e48ead37a9ff (diff) |
Fix TokenStream::from_str for input consisting of a single Group
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.
In this case, wrap an extra level of Subtree around it.
Fixes #7810
Fixes #7875
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
0 files changed, 0 insertions, 0 deletions