-
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
proc_macro: make TokenStream::from_streams
pre-allocate its vector.
#58001
proc_macro: make TokenStream::from_streams
pre-allocate its vector.
#58001
Conversation
This requires a pre-pass over the input streams. But that is cheap compared to the quadratic blowup associated with reallocating the accumulating vector on-the-fly.
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Note that this does not include a regression test because it is non-trivial to reproduce the conditions of the test. In particular, the I did try to whip up a test that didn't use |
cc @nnethercote |
@bors r+ |
📌 Commit 1a18336 has been approved by |
⌛ Testing commit 1a18336 with merge ff0c8c90fd2f2af47457e1fa0a44a9c858ff75ea... |
💔 Test failed - status-appveyor |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
⌛ Testing commit 1a18336 with merge 6c02e295e76a8a271720d3d0ebf003de05882ba3... |
💔 Test failed - status-appveyor |
hmm:
|
do we need to update the |
@pnkfelix rls submodule has to be updated but there was issue with the tests last time rust-lang/rls#1271. There is PR for that: #58024 It doesn't matter though because tools are allowed to fail.
|
@bors retry
|
…h-large-tokenstream-slow, r=eddyb proc_macro: make `TokenStream::from_streams` pre-allocate its vector. This requires a pre-pass over the input streams. But that is cheap compared to the quadratic blowup associated with reallocating the accumulating vector on-the-fly. Fix rust-lang#57735
Rollup of 23 pull requests Successful merges: - #58001 (proc_macro: make `TokenStream::from_streams` pre-allocate its vector.) - #58096 (Transition linkchecker to 2018 edition) - #58097 (Transition remote test to Rust 2018) - #58106 (libfmt_macros => 2018) - #58107 (libgraphviz => 2018) - #58108 (Add NVPTX target to a build manifest) - #58109 (librustc_privacy => 2018) - #58112 (libpanic_abort => 2018) - #58113 (Transition build-manifest to 2018 edition) - #58114 (Transition tidy and unstable-book-gen to 2018 edition) - #58116 (Include the span of attributes of the lhs to the span of the assignment expression) - #58117 (Transition rustdoc-theme to 2018 edition) - #58128 (libunwind => 2018) - #58138 (Fix #58101) - #58139 (hir: add more HirId methods) - #58141 (Remove weasel word in docs for iter's take_while()) - #58142 (Remove stray FIXME) - #58145 (Add #[must_use] to core::task::Poll) - #58162 (Add more debugging code to track down appveyor 259 exit code) - #58169 (Update contributor name in .mailmap) - #58172 (update split docs) - #58182 (SGX target: handle empty user buffers correctly) - #58186 (Add Rustlings to the doc index) Failed merges: r? @ghost
This requires a pre-pass over the input streams. But that is cheap compared to the quadratic blowup associated with reallocating the accumulating vector on-the-fly.
Fix #57735