-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some token stream cleanups #98278
Some token stream cleanups #98278
Conversation
It's a weird function: it lets you modify the token stream in the middle of iteration. There is only one call site, and it is only used for the rare `ProceduralMasquerade` legacy case.
It's unused.
By inlining it into the only non-test call site. The one test call site is changed to use `TokenStreamBuilder`.
Both functions do some modifying of streams using `make_mut`: - `push` sometimes glues the first token of the next stream to the last token of the first stream. - `build` appends tokens to the first stream. By doing all of this in the one place, things are simpler. The first stream can be modified in both ways (if necessary) in the one place, and any next stream with the first token removed doesn't need to be stored.
Because that's the standard way of doing it.
Not expecting much change here: @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 69f45b7 with merge a4080d0740dfac42d6c48c3a7a0e49498c03c7c9... |
☀️ Try build successful - checks-actions |
Queued a4080d0740dfac42d6c48c3a7a0e49498c03c7c9 with parent 9a0b774, future comparison URL. |
r=me when the perf run is complete. |
Finished benchmarking commit (a4080d0740dfac42d6c48c3a7a0e49498c03c7c9): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
@bors r+ |
📌 Commit 69f45b7 has been approved by |
@bors rollup=never |
@matthiaskrgr: with the neutral perf CI run done, I think this one would be fine to be in a rollup. It's fairly small, and not doing anything very complicated. |
@bors rollup=maybe |
…ups, r=petrochenkov Some token stream cleanups Best reviewed one commit at a time. r? `@petrochenkov`
…ups, r=petrochenkov Some token stream cleanups Best reviewed one commit at a time. r? ``@petrochenkov``
Rollup of 11 pull requests Successful merges: - rust-lang#94033 (Improve docs for `is_running` to explain use case) - rust-lang#97269 (adjust transmute const stabilization version) - rust-lang#97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting) - rust-lang#98022 (Fix erroneous span for borrowck error) - rust-lang#98124 (Improve loading of crates.js and sidebar-items.js) - rust-lang#98278 (Some token stream cleanups) - rust-lang#98306 (`try_fold_unevaluated` for infallible folders) - rust-lang#98313 (Remove lies in comments.) - rust-lang#98323 (:arrow_up: rust-analyzer) - rust-lang#98329 (Avoid an ICE and instead let the compiler report a useful error) - rust-lang#98330 (update ioslice docs to use shared slices) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Best reviewed one commit at a time.
r? @petrochenkov