about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-24 09:30:31 +0200
committerGitHub <noreply@github.com>2020-05-24 09:30:31 +0200
commitfb848a6b7daf63d5cd51b167565a400c3ec42d6a (patch)
tree01c6c870fd1fa4652115e7c0f72b0b9e8ed729da /src/libstd/sys/unix/stack_overflow.rs
parent3137f8e2d141d7d7c65040a718a9193f50e1282e (diff)
parent5685e4dd90ad2f4978c63b9097f0b568e4ce6e5c (diff)
downloadrust-fb848a6b7daf63d5cd51b167565a400c3ec42d6a.tar.gz
rust-fb848a6b7daf63d5cd51b167565a400c3ec42d6a.zip
Rollup merge of #72388 - Aaron1011:fix/deep-tokenstream-equality, r=petrochenkov
Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro`

Fixes #68430

When comparing the captured and re-parsed `TokenStream` for a `TokenKind::Interpolated`, we currently treat any nested `TokenKind::Interpolated` tokens as unequal. If a `TokenKind::Interpolated` token shows up in the captured `TokenStream` due to a `macro_rules!` expansion, we will throw away the captured `TokenStream`, losing span information.

This PR recursively invokes `nt_to_tokenstream` on nested `TokenKind::Interpolated` tokens, effectively flattening the stream into a sequence of non-interpolated tokens. This allows it to compare equal with the re-parsed stream, allowing us to keep the original captured `TokenStream` (with span information).

This requires all of the `probably_equal_for_proc_macro` methods to be moved from `librustc_ast` to `librustc_parse` so that they can call `nt_to_tokenstream`.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions