Use Vec::push_mut when adding a chunk to arenas#155161
Use Vec::push_mut when adding a chunk to arenas#155161rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
3fc647e to
955f7b9
Compare
This comment has been minimized.
This comment has been minimized.
955f7b9 to
ff61915
Compare
|
should we add a test for this? |
|
The arena in the compiler already has tests, the trick is that you can only get a test failure if you run the test code with Miri. The copy+paste into proc_macro does not have any tests. I could also copy+paste the tests from the compiler into it, then also expand https://github.com/rust-lang/miri-test-libstd/ to run its new tests. The original report is based on misuse of the API so we'd be checking that the test panics and doesn't report UB when run with Miri, but if someone just moves the panicking check around that will make the test always pass even if the UB comes back. I'd rather not balloon the effort here. |
|
ohhhh, ok cool then r? me @bors r+ rollup |
…uwer Rollup of 5 pull requests Successful merges: - #155197 (miri subtree update) - #154804 (Fix ICE when reporting host-effect errors for const Fn HRTBs in next trait solver) - #155014 (Hexagon: add scalar arch-version target features (v60-v79, audio)) - #155068 (Fix ICE in `span_extend_prev_while` with multibyte characters) - #155161 (Use Vec::push_mut when adding a chunk to arenas)
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#155197 (miri subtree update) - rust-lang/rust#154804 (Fix ICE when reporting host-effect errors for const Fn HRTBs in next trait solver) - rust-lang/rust#155014 (Hexagon: add scalar arch-version target features (v60-v79, audio)) - rust-lang/rust#155068 (Fix ICE in `span_extend_prev_while` with multibyte characters) - rust-lang/rust#155161 (Use Vec::push_mut when adding a chunk to arenas)
This fixes #155148, which may or may not be worth fixing on its own merits, but I think
Vec::push_mutalso makes the code nicer.