about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-14 20:24:58 +0200
committerGitHub <noreply@github.com>2024-07-14 20:24:58 +0200
commitfebe4423c15fb31456b7f97c75cea790d3f82887 (patch)
tree5b299ced53b3ef187f36a12c6319d67259929550 /compiler/rustc_pattern_analysis/src
parent88fa119c77682e6d55ce21001cf761675cfebeae (diff)
parentaa0e8e147588c75fbb6ad158140c890582886027 (diff)
downloadrust-febe4423c15fb31456b7f97c75cea790d3f82887.tar.gz
rust-febe4423c15fb31456b7f97c75cea790d3f82887.zip
Rollup merge of #127273 - nnethercote:fix-DebugParser, r=workingjubilee
Fix `DebugParser`.

I tried using this and it didn't work at all. `prev_token` is never eof, so the accumulator is always false, which means the `then_some` always returns `None`, which means `scan` always returns `None`, and `tokens` always ends up an empty vec. I'm not sure how this code was supposed to work.

(An aside: I find `Iterator::scan` to be a pretty wretched function, that produces code which is very hard to understand. Probably why this is just one of two uses of it in the entire compiler.)

This commit changes it to a simpler imperative style that produces a valid `tokens` vec.

r? `@workingjubilee`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions