about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-06-21Address review comments from #98259Joshua Nelson-31/+27
It got merged so fast I didn't have time to make changes xD
2022-06-19Greatly improve error reporting for futures and generators in ↵Joshua Nelson-72/+389
`note_obligation_cause_code` Most futures don't go through this code path, because they're caught by `maybe_note_obligation_cause_for_async_await`. But all generators do, and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses. At some point, we may want to consider unifying this with the code for `maybe_note_async_await`, so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points. But both functions are quite complicated, and it's not clear to me how to combine them; this seems like a good incremental improvement.
2022-06-18Auto merge of #98153 - nnethercote:fix-MissingDoc-quadratic-behaviour, ↵bors-36/+16
r=cjgillot Fix `MissingDoc` quadratic behaviour Best reviewed one commit at a time. r? `@cjgillot`
2022-06-18Auto merge of #98186 - mystor:tokenstream_as_vec_tt, r=eddybbors-173/+303
Batch proc_macro RPC for TokenStream iteration and combination operations This is the first part of #86822, split off as requested in https://github.com/rust-lang/rust/pull/86822#pullrequestreview-1008655452. It reduces the number of RPC calls required for common operations such as iterating over and concatenating TokenStreams.
2022-06-18Auto merge of #98178 - RalfJung:btree-alloc, r=thomccbors-241/+270
btree: avoid forcing the allocator to be a reference The previous code forces the actual allocator used to be some `&A`. This generalizes the code to allow any `A: Copy`. If people truly want to use a reference, they can use `&A` themselves. Fixes https://github.com/rust-lang/rust/issues/98176
2022-06-18Auto merge of #98216 - JohnTitor:rollup-jlcmu5d, r=JohnTitorbors-108/+172
Rollup of 5 pull requests Successful merges: - #97803 (Impl Termination for Infallible and then make the Result impls of Termination more generic) - #97828 (Allow configuring where artifacts are downloaded from) - #98150 (Emscripten target: replace -g4 with -g, and -g3 with --profiling-funcs) - #98195 (Fix rustdoc json primitive handling) - #98205 (Remove a possible unnecessary assignment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-17review fixupsNika Layzell-70/+43
2022-06-18Rollup merge of #98205 - JohnTitor:remove-unnecessary-let, r=jyn514Yuki Okushi-2/+0
Remove a possible unnecessary assignment The reference issue has been closed (the feature has been stabilized) and things work fine without it, it seems. Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-18Rollup merge of #98195 - GuillaumeGomez:rustdoc-json-primitive, r=notriddleYuki Okushi-3/+20
Fix rustdoc json primitive handling Fixes https://github.com/rust-lang/rust/issues/98006. cc `@matthiaskrgr`
2022-06-18Rollup merge of #98150 - hoodmane:emscripten-g4, r=sbc100Yuki Okushi-2/+2
Emscripten target: replace -g4 with -g, and -g3 with --profiling-funcs Emscripten prints the following warning: ``` emcc: warning: please replace -g4 with -gsource-map [-Wdeprecated] ``` `@sbc100`
2022-06-18Rollup merge of #97828 - ferrocene:pa-config-artifacts, r=jyn514Yuki Okushi-73/+132
Allow configuring where artifacts are downloaded from Bootstrap has support for downloading prebuilt LLVM and rustc artifacts to speed up local builds, but that currently works only for users working on `rust-lang/rust`. Forks of the repository (for example Ferrocene) might have different URLs to download artifacts from, or might use a different email address on merge commits, breaking both LLVM and rustc artifact downloads. This PR refactors bootstrap to load the download URLs and other constants from `src/stage0.json`, allowing downstream forks to tweak those values. It also future-proofs the download code to easily allow forks to add their own custom protocols (like `s3://`). This PR is best reviewed commit-by-commit.
2022-06-18Rollup merge of #97803 - Gankra:term, r=dtolnayYuki Okushi-28/+18
Impl Termination for Infallible and then make the Result impls of Termination more generic This allows things like `Result<ExitCode, E>` to 'just work'
2022-06-18Auto merge of #97652 - RalfJung:cenum_impl_drop_cast, r=nagisabors-4/+19
make cenum_impl_drop_cast deny-by-default Also make it show up as future breakage diagnostic. In https://github.com/rust-lang/rust/pull/96862 we are proposing to change behavior of those drops *again*, so this looks like a good opportunity to increase our pressure on getting them out of the ecosystem. Looking at the [tracking issue](https://github.com/rust-lang/rust/issues/73333), so far nobody spoke up in favor of this (accidental) feature. Cc https://github.com/rust-lang/rust/issues/73333 `@oli-obk`
2022-06-17comments explaining why we have and don't have ManuallyDropRalf Jung-0/+6
2022-06-17Auto merge of #98081 - gco:no_static_libcpp, r=jyn514bors-1/+2
Do not try to statically link libstdc++ on Solaris Fixes #97260
2022-06-17bless new test result, it's a regression but seemingly a compiler bugAria Beingessner-6/+3
2022-06-17Impl Termination for Infallible and then make the Result impls of ↵Aria Beingessner-22/+15
Termination into a blanket This allows things like `Result<ExitCode, E>` to 'just work'
2022-06-17Replace -g4 with -gsource-mapHood Chatham-2/+2
2022-06-17Auto merge of #97892 - klensy:fix-spaces, r=oli-obkbors-733/+737
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
2022-06-18Remove a possible unnecessary assignmentYuki Okushi-2/+0
The reference issue has been closed (the feature has been stabilized) and things work fine without fine, it seems. Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-17Auto merge of #98097 - lqd:const-alloc-hash, r=oli-obkbors-2/+75
ctfe: limit hashing of big const allocations when interning Const allocations are only hashed for interning. However, they can be large, making the hashing expensive especially since it uses `FxHash`: it's better suited to short keys, not potentially big buffers like the actual bytes of allocation and the associated 1/8th sized `InitMask`. We can partially hash these fields when they're large, hashing the length, and head and tail of these buffers, to limit possible collisions while avoiding most of the hashing work. r? `@ghost`
2022-06-17Move empty final TokenStream handling to server side of bridgeNika Layzell-14/+16
2022-06-17Add regression test for #98006Guillaume Gomez-0/+17
2022-06-17Auto merge of #98193 - Dylan-DPC:rollup-5gihjij, r=Dylan-DPCbors-229/+405
Rollup of 5 pull requests Successful merges: - #95392 (std: Stabilize feature try_reserve_2 ) - #97798 (Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown) - #97844 (Windows: No panic if function not (yet) available) - #98013 (Subtype FRU fields first in `type_changing_struct_update`) - #98191 (Remove the rest of unnecessary `to_string`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-17Fix rustdoc handling of primitive documentationGuillaume Gomez-3/+3
2022-06-17Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string, ↵Dylan DPC-5/+5
r=Dylan-DPC Remove the rest of unnecessary `to_string` I removed most of unnecessary `to_string` in #98043. This patch removes the rest of them I missed.
2022-06-17Rollup merge of #98013 - compiler-errors:guide-inference-2, r=lcnrDylan DPC-78/+93
Subtype FRU fields first in `type_changing_struct_update` So this fixes a subtle bug that `type_changing_struct_update` introduced, where it'll no longer coerce the base expr correctly. I actually think this code is easier to understand now, too. r? `@lcnr` since you reviewed the last one
2022-06-17Rollup merge of #97844 - ChrisDenton:dont-panic, r=JohnTitorDylan DPC-4/+5
Windows: No panic if function not (yet) available In some situations (e.g. #97814) it is possible for required functions to be called before they've had a chance to be loaded. Therefore, we make it possible to recover from this situation simply by looking at error codes. `@rustbot` label +O-windows
2022-06-17Rollup merge of #97798 - ↵Dylan DPC-132/+296
WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230. I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result. Here is an example of how this changes the output: Before: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | 5 | 6 | 7 | 8 | ... ``` After: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | ... 31| 32~ } }; | ``` r? `@estebank` `@rustbot` label +A-diagnostics +A-suggestion-diagnostics
2022-06-17Rollup merge of #95392 - Xuanwo:stablize_try_reserve_2, r=dtolnayDylan DPC-10/+6
std: Stabilize feature try_reserve_2 This PR intends to stabilize feature `try_reserve_2`, closes https://github.com/rust-lang/rust/issues/91789 This PR will also replace the previous PR: https://github.com/rust-lang/rust/pull/95139
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-487/+600
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-17remove the rest of unnecessary `to_string`Takayuki Maeda-5/+5
2022-06-17Auto merge of #97863 - JakobDegen:bitset-choice, r=nnethercotebors-23/+141
`BitSet` related perf improvements This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet` I have local benchmarks verifying that each of these changes individually yield significant perf improvements to #96451 . I'm hoping this will be true outside of that context too. If that is not the case, I'll try to gate things on where they help as needed r? `@nnethercote` who I believe was working on closely related things, cc `@tmiasko` because of the destprop pr
2022-06-17Auto merge of #98160 - nnethercote:mv-finish-out-of-Encoder, r=bjorn3bors-111/+51
Move `finish` out of the `Encoder` trait. This simplifies things, but requires making `CacheEncoder` non-generic. (This was previously merged as commit 4 in #94732 and then was reverted in #97905 because it caused a perf regression.) r? `@ghost`
2022-06-16btree: avoid forcing the allocator to be a referenceRalf Jung-241/+264
2022-06-17Try to reduce codegen complexity of TokenStream's FromIterator and Extend implsNika Layzell-18/+94
This is an experimental patch to try to reduce the codegen complexity of TokenStream's FromIterator and Extend implementations for downstream crates, by moving the core logic into a helper type. This might help improve build performance of crates which depend on proc_macro as iterators are used less, and the compiler may take less time to do things like attempt specializations or other iterator optimizations. The change intentionally sacrifices some optimization opportunities, such as using the specializations for collecting iterators derived from Vec::into_iter() into Vec. This is one of the simpler potential approaches to reducing the amount of code generated in crates depending on proc_macro, so it seems worth trying before other more-involved changes.
2022-06-17proc_macro: reduce the number of messages required to create, extend, and ↵Nika Layzell-96/+128
iterate TokenStreams This significantly reduces the cost of common interactions with TokenStream when running with the CrossThread execution strategy, by reducing the number of RPC calls required.
2022-06-17Subtype FRU fields first in type_changing_struct_updateMichael Goulet-78/+93
2022-06-16proc_macro: use macros to simplify aggregate Mark/Unmark definitionsNika Layzell-24/+34
2022-06-17Auto merge of #98143 - cuviper:futex-rwlock-inline, r=thomccbors-0/+9
Add `#[inline]` to small fns of futex `RwLock` The important methods like `read` and `write` were already inlined, which can propagate all the way to inlining in user code, but these small state functions were left behind as normal calls. They should almost always be inlined as well, as they're just a few instructions.
2022-06-16Auto merge of #98181 - JohnTitor:rollup-65ztwnz, r=JohnTitorbors-26/+194
Rollup of 5 pull requests Successful merges: - #97377 (Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros) - #97675 (Make `std::mem::needs_drop` accept `?Sized`) - #98118 (Test NLL fix of bad lifetime inference for reference captured in closure.) - #98166 (Add rustdoc-json regression test for #98009) - #98169 (Keyword docs: Link to wikipedia article for dynamic dispatch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-17Rollup merge of #98169 - pierwill:dyn-disp, r=JohnTitorYuki Okushi-1/+2
Keyword docs: Link to wikipedia article for dynamic dispatch
2022-06-17Rollup merge of #98166 - GuillaumeGomez:regression-test-98009, r=matthiaskrgrYuki Okushi-0/+38
Add rustdoc-json regression test for #98009 Fixes #98009. There was apparently nothing to be done... cc `@matthiaskrgr` r? `@notriddle`
2022-06-17Rollup merge of #98118 - steffahn:scoped-threads-nll-test, r=m-ou-seYuki Okushi-0/+13
Test NLL fix of bad lifetime inference for reference captured in closure. This came up as a use-case for `thread::scope` API that only compiles successfully since `feature(nll)` got stabilized recently. Closes #93203 which had been re-opened for tracking this very test case to be added.
2022-06-17Rollup merge of #97675 - nvzqz:unsized-needs-drop, r=dtolnayYuki Okushi-4/+18
Make `std::mem::needs_drop` accept `?Sized` This change attempts to make `needs_drop` work with types like `[u8]` and `str`. This enables code in types like `Arc<T>` that was not possible before, such as https://github.com/rust-lang/rust/pull/97676.
2022-06-17Rollup merge of #97377 - ChayimFriedman2:issue-91800, r=estebankYuki Okushi-21/+123
Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros Fixes #91800.
2022-06-16Auto merge of #97936 - nnethercote:compile-unicode_normalization-faster, ↵bors-115/+87
r=oli-obk Compile `unicode-normalization` faster Various optimizations and cleanups aimed at improving compilation of `unicode-normalization`, which is notable for having several very large `match`es with many char ranges. Best reviewed one commit at a time. r? `@oli-obk`
2022-06-16adjust const alloc interning partial hash commentsRémy Rakic-4/+8
2022-06-16Auto merge of #98173 - flip1995:clippyup, r=Manishearthbors-1913/+4142
Update Clippy r? `@Manishearth`
2022-06-16ctfe: limit hashing of big const allocations when interningRémy Rakic-2/+71
Big const allocations hash a large amount of data for interning: the whole bytes buffer, and the 1/8th sized initmask, with FxHash. This hash function is made for shorter keys. This only hashes the length, and head and tail of these buffers, to limit possible collisions while avoiding most of the hashing work.