-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Lexer tweaks #133070
Lexer tweaks #133070
Conversation
@bors try @rust-timer queue |
Lexer tweaks r? `@ghost`
☀️ Try build successful - checks-actions |
Doesn't seem to have triggered perf |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (3b55679): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 788.822s -> 788.155s (-0.08%) |
There is a not-very-useful layering in the lexer, where `TokenTreesReader` contains a `StringReader`. This commit combines them and names the result `Lexer`, which is a more obvious name for it. The methods of `Lexer` are now split across `mod.rs` and `tokentrees.rs` which isn't ideal, but it doesn't seem worth moving a bunch of code to avoid it.
It has two different ways of being called.
Must be one of those cases where the function is too long and rustfmt bails out.
It's currently a bit ad hoc. This commit makes it more methodical, with pairs of match/no-match tests for all the relevant cases.
- Rename a misleading local `mk_kind` as `single_quoted`. - Use `fn` for all three arguments, for consistency.
- Use iterators instead of `for` loops. - Use `if`/`else` instead of `match`.
ac1311b
to
16a39bb
Compare
@bors r+ rollup |
…kang Lexer tweaks Some cleanups and small performance improvements. r? `@chenyukang`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133134 (Don't use a SyntheticProvider for literally every type) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133134 (Don't use a SyntheticProvider for literally every type) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133134 (Don't use a SyntheticProvider for literally every type) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
…kang Lexer tweaks Some cleanups and small performance improvements. r? ``@chenyukang``
Rollup of 28 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133248 (CI: split x86_64-msvc-ext job) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133304 (Revert diagnostics hack to fix ICE 132920) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) - rust-lang#133443 (Remove dead code stemming from the old effects desugaring (II)) - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`) - rust-lang#133450 (remove "onur-ozkan" from users_on_vacation) - rust-lang#133454 (Update test expectations to accept LLVM 'initializes' attribute) - rust-lang#133458 (Fix `Result` and `Option` not getting a jump to def link generated) - rust-lang#133462 (Use ReadCache for archive reading in bootstrap) - rust-lang#133464 (std::thread: avoid leading whitespace in some panic messages) - rust-lang#133467 (tests: Add recursive associated type bound regression tests) - rust-lang#133470 (Cleanup: delete `//@ pretty-expanded` directive) - rust-lang#133473 (tests: Add regression test for recursive enum with Cow and Clone) - rust-lang#133481 (Disable `avr-rjmp-offset` on Windows for now) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 28 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133248 (CI: split x86_64-msvc-ext job) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133304 (Revert diagnostics hack to fix ICE 132920) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) - rust-lang#133443 (Remove dead code stemming from the old effects desugaring (II)) - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`) - rust-lang#133450 (remove "onur-ozkan" from users_on_vacation) - rust-lang#133454 (Update test expectations to accept LLVM 'initializes' attribute) - rust-lang#133458 (Fix `Result` and `Option` not getting a jump to def link generated) - rust-lang#133462 (Use ReadCache for archive reading in bootstrap) - rust-lang#133464 (std::thread: avoid leading whitespace in some panic messages) - rust-lang#133467 (tests: Add recursive associated type bound regression tests) - rust-lang#133470 (Cleanup: delete `//@ pretty-expanded` directive) - rust-lang#133473 (tests: Add regression test for recursive enum with Cow and Clone) - rust-lang#133481 (Disable `avr-rjmp-offset` on Windows for now) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 28 pull requests Successful merges: - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133248 (CI: split x86_64-msvc-ext job) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133304 (Revert diagnostics hack to fix ICE 132920) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133411 (the emscripten OS no longer exists on non-wasm targets) - rust-lang#133419 (Added a doc test for std::path::strip_prefix) - rust-lang#133430 (Tweak parameter mismatch explanation to not say `{unknown}`) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) - rust-lang#133443 (Remove dead code stemming from the old effects desugaring (II)) - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`) - rust-lang#133450 (remove "onur-ozkan" from users_on_vacation) - rust-lang#133454 (Update test expectations to accept LLVM 'initializes' attribute) - rust-lang#133458 (Fix `Result` and `Option` not getting a jump to def link generated) - rust-lang#133462 (Use ReadCache for archive reading in bootstrap) - rust-lang#133464 (std::thread: avoid leading whitespace in some panic messages) - rust-lang#133467 (tests: Add recursive associated type bound regression tests) - rust-lang#133470 (Cleanup: delete `//@ pretty-expanded` directive) - rust-lang#133473 (tests: Add regression test for recursive enum with Cow and Clone) - rust-lang#133481 (Disable `avr-rjmp-offset` on Windows for now) r? `@ghost` `@rustbot` modify labels: rollup
…mpiler-errors Rollup of 12 pull requests Successful merges: - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133155 (Yet more `rustc_mir_dataflow` cleanups) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133070 - nnethercote:lexer-tweaks, r=chenyukang Lexer tweaks Some cleanups and small performance improvements. r? ```@chenyukang```
Some cleanups and small performance improvements.
r? @chenyukang