]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #87185 - waterlens:issue-86499-fix, r=Mark-Simulacrum
Yuki Okushi [Fri, 23 Jul 2021 19:31:05 +0000 (04:31 +0900)]
Rollup merge of #87185 - waterlens:issue-86499-fix, r=Mark-Simulacrum

Fix panics on Windows when the build was cancelled

Fixes #86499

cc `@jyn514`

2 years agoRollup merge of #87175 - inquisitivecrystal:inner-error, r=kennytm
Yuki Okushi [Fri, 23 Jul 2021 19:31:04 +0000 (04:31 +0900)]
Rollup merge of #87175 - inquisitivecrystal:inner-error, r=kennytm

Stabilize `into_parts()` and `into_error()`

This stabilizes `IntoInnerError`'s `into_parts()` and `into_error()` methods, currently gated behind the `io_into_inner_error_parts` feature. The FCP has [already completed.](https://github.com/rust-lang/rust/issues/79704#issuecomment-880652967)

Closes #79704.

2 years agoRollup merge of #87171 - Alexendoo:bufwriter-option, r=Mark-Simulacrum
Yuki Okushi [Fri, 23 Jul 2021 19:31:03 +0000 (04:31 +0900)]
Rollup merge of #87171 - Alexendoo:bufwriter-option, r=Mark-Simulacrum

Remove Option from BufWriter

Fixes #72925

2 years agoRollup merge of #86790 - janikrabe:retain-iter-order-doc, r=m-ou-se
Yuki Okushi [Fri, 23 Jul 2021 19:30:56 +0000 (04:30 +0900)]
Rollup merge of #86790 - janikrabe:retain-iter-order-doc, r=m-ou-se

Document iteration order of `retain` functions

For `HashSet` and `HashMap`, this simply copies the comment from
`BinaryHeap::retain`.

For `BTreeSet` and `BTreeMap`, this adds an additional guarantee that
wasn't previously documented. I think that because these data structures
are inherently ordered and other functions guarantee ordered iteration,
it makes sense to provide this guarantee for `retain` as well.

2 years agoRollup merge of #86410 - spastorino:get_value_matching, r=oli-obk
Yuki Okushi [Fri, 23 Jul 2021 19:30:56 +0000 (04:30 +0900)]
Rollup merge of #86410 - spastorino:get_value_matching, r=oli-obk

VecMap::get_value_matching should return just one element

r? `@nikomatsakis`

Related to #86465 and #87287

2 years agoAuto merge of #87400 - JohnTitor:rollup-zbwyuxi, r=JohnTitor
bors [Fri, 23 Jul 2021 12:33:58 +0000 (12:33 +0000)]
Auto merge of #87400 - JohnTitor:rollup-zbwyuxi, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #87034 (DOC: fix hypothetical Rust code in `step_by()` docstring)
 - #87298 (memorialize Anna Harren in the bastion of the turbofish)
 - #87332 (Don't hide fields of enum struct variants)
 - #87362 (Make `x.py d` an alias for `x.py doc`)
 - #87372 (Move calls to test_main into one function)
 - #87373 (Extend HIR WF checking to fields)
 - #87376 (Change rustdoc logo to use the full container size)
 - #87383 (Add regression tests for the impl_trait_in_bindings ICEs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoAdd ConstraintLocator docs
Santiago Pastorino [Thu, 22 Jul 2021 21:24:20 +0000 (18:24 -0300)]
Add ConstraintLocator docs

2 years agoAdd VecMap::get_value_matching and assert if > 1 element
Santiago Pastorino [Thu, 17 Jun 2021 19:59:00 +0000 (16:59 -0300)]
Add VecMap::get_value_matching and assert if > 1 element

Otherwise is a bug that we want to uncover.

2 years agoRollup merge of #87383 - Alexendoo:impl_trait_in_bindings-tests, r=oli-obk
Yuki Okushi [Fri, 23 Jul 2021 10:27:51 +0000 (19:27 +0900)]
Rollup merge of #87383 - Alexendoo:impl_trait_in_bindings-tests, r=oli-obk

Add regression tests for the impl_trait_in_bindings ICEs

Closes #54600, closes #54840, closes #58504, closes #58956, closes #70971, closes #79099, closes #84919, closes #86201, closes #86642, closes #87295

r? ``@oli-obk``

2 years agoRollup merge of #87376 - Thomasdezeeuw:rustdoc-large-logo, r=GuillaumeGomez
Yuki Okushi [Fri, 23 Jul 2021 10:27:49 +0000 (19:27 +0900)]
Rollup merge of #87376 - Thomasdezeeuw:rustdoc-large-logo, r=GuillaumeGomez

Change rustdoc logo to use the full container size

We have a logo in svg that scales nicely to large sizes, but by default
is only 5px large, i.e. very small. With the change the logo expands to
the full size. By only setting the height to 100% we ensure that the
width-height ratio isn't changed.

2 years agoRollup merge of #87373 - Aaron1011:hir-wf-field, r=estebank
Yuki Okushi [Fri, 23 Jul 2021 10:27:48 +0000 (19:27 +0900)]
Rollup merge of #87373 - Aaron1011:hir-wf-field, r=estebank

Extend HIR WF checking to fields

r? ``@estebank``

2 years agoRollup merge of #87372 - GuillaumeGomez:move-test_main-calls, r=jyn514
Yuki Okushi [Fri, 23 Jul 2021 10:27:47 +0000 (19:27 +0900)]
Rollup merge of #87372 - GuillaumeGomez:move-test_main-calls, r=jyn514

Move calls to test_main into one function

Fixes #86254.

cc ``@jyn514``
r? ``@camelid``

2 years agoRollup merge of #87362 - inquisitivecrystal:bootstrap-doc, r=jyn514
Yuki Okushi [Fri, 23 Jul 2021 10:27:46 +0000 (19:27 +0900)]
Rollup merge of #87362 - inquisitivecrystal:bootstrap-doc, r=jyn514

Make `x.py d` an alias for `x.py doc`

In rust-lang/cargo#9680, `d` was added to Cargo as an alias for `doc`. This PR adds the same alias to `x.py`. The same considerations of convenience that applied to Cargo also apply to `x.py`, and in any case, the two should be kept symmetrical.

2 years agoRollup merge of #87332 - camelid:dont-hide-fields, r=GuillaumeGomez
Yuki Okushi [Fri, 23 Jul 2021 10:27:45 +0000 (19:27 +0900)]
Rollup merge of #87332 - camelid:dont-hide-fields, r=GuillaumeGomez

Don't hide fields of enum struct variants

* The toggle adds visual clutter
* It's easy to miss that there are fields
* Tuple variant fields are always shown, so it is inconsistent to hide
  struct variant fields
* It's annoying to have to click the toggle every time

2 years agoRollup merge of #87298 - boringcactus:patch-2, r=steveklabnik
Yuki Okushi [Fri, 23 Jul 2021 10:27:44 +0000 (19:27 +0900)]
Rollup merge of #87298 - boringcactus:patch-2, r=steveklabnik

memorialize Anna Harren in the bastion of the turbofish

this seems fitting, at least to me.

2 years agoRollup merge of #87034 - mgeier:doc-step_by, r=JohnTitor
Yuki Okushi [Fri, 23 Jul 2021 10:27:43 +0000 (19:27 +0900)]
Rollup merge of #87034 - mgeier:doc-step_by, r=JohnTitor

DOC: fix hypothetical Rust code in `step_by()` docstring

I don't know how important that is, but if I'm not mistaken, the hypothetical code in the docstring of `step_by()` (see https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.step_by) isn't correct.

I guess writing `next()` instead of `self.next()` isn't a biggie, but this would also imply that `advance_n_and_return_first()` is a method, which AFAICT it isn't.

I've also done some re-formatting in a separate commit and a parameter renaming in yet another commit.

Feel free to take or leave any combination of those commits.

2 years agoAuto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorino
bors [Fri, 23 Jul 2021 03:40:26 +0000 (03:40 +0000)]
Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorino

 Make mir borrowck's use of opaque types independent of the typeck query's result

fixes #87218
fixes #86465

we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result.

When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information.

We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead.

r? `@spastorino`

2 years agoRemove Option from BufWriter
Alex Macleod [Thu, 15 Jul 2021 19:04:14 +0000 (20:04 +0100)]
Remove Option from BufWriter

Fixes #72925

2 years agoDon't hide fields of enum struct variants
Noah Lev [Mon, 17 May 2021 23:49:38 +0000 (16:49 -0700)]
Don't hide fields of enum struct variants

* The toggle adds visual clutter
* It's easy to miss that there are fields
* Tuple variant fields are always shown, so it is inconsistent to hide
  struct variant fields
* It's annoying to have to click the toggle every time

2 years agoAdd regression tests for the impl_trait_in_bindings ICEs
Alex Macleod [Thu, 22 Jul 2021 18:16:33 +0000 (19:16 +0100)]
Add regression tests for the impl_trait_in_bindings ICEs

2 years agoAuto merge of #86212 - pnkfelix:mainline-targetted-revert-81473-warn-write-only-field...
bors [Thu, 22 Jul 2021 18:41:27 +0000 (18:41 +0000)]
Auto merge of #86212 - pnkfelix:mainline-targetted-revert-81473-warn-write-only-fields, r=simulacrum

Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.

This is a nightly-targetted variant of PR #83171

The intent is to just address issue #81658 on all release channels, rather that keep repeatedly reverting PR #83171 on beta.

However, our intent is *also* to reland PR #83171 after we have addressed issue #81658 , most likely by coupling the re-landing of PR #83171 with an enhancement like PR #83004

2 years agoChange rustdoc logo to use the full container size
Thomas de Zeeuw [Thu, 22 Jul 2021 15:57:06 +0000 (17:57 +0200)]
Change rustdoc logo to use the full container size

We have a logo in svg that scales nicely to large sizes, but by default
is only 5px large, i.e. very small. With the change the logo expands to
the full size. By only setting the height to 100% we ensure that the
width-height ratio isn't changed.

2 years agoExtend HIR WF checking to fields
Aaron Hill [Tue, 20 Jul 2021 15:56:33 +0000 (10:56 -0500)]
Extend HIR WF checking to fields

2 years agoAuto merge of #87371 - ehuss:update-cargo, r=ehuss
bors [Thu, 22 Jul 2021 15:10:19 +0000 (15:10 +0000)]
Auto merge of #87371 - ehuss:update-cargo, r=ehuss

Update cargo

2 commits in 4e143fd131e0c16cefd008456e974236ca54e62e..cebef2951ee69617852844894164b54ed478a7da
2021-07-20 21:55:45 +0000 to 2021-07-22 13:01:52 +0000
- Changes rustc argument from `--force-warns` to `--force-warn` (rust-lang/cargo#9714)
- Display registry name instead of registry URL when possible (rust-lang/cargo#9632)

2 years agoMove calls to test_main into one function
Guillaume Gomez [Thu, 22 Jul 2021 15:01:12 +0000 (17:01 +0200)]
Move calls to test_main into one function

2 years agoUpdate cargo
Eric Huss [Thu, 22 Jul 2021 14:58:45 +0000 (07:58 -0700)]
Update cargo

2 years agoAuto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez
bors [Thu, 22 Jul 2021 12:29:30 +0000 (12:29 +0000)]
Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #87270 (Don't display <table> in item summary)
 - #87281 (Normalize generic_ty before checking if bound is met)
 - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping)
 - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.)
 - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations)
 - #87357 (Update my name/email in .mailmap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #87357 - lilyball:mailmap, r=jyn514
Guillaume Gomez [Thu, 22 Jul 2021 11:39:25 +0000 (13:39 +0200)]
Rollup merge of #87357 - lilyball:mailmap, r=jyn514

Update my name/email in .mailmap

I should have done this years ago.

My name is also scattered across many other rust-lang repos, but none of the other repos I've looked at have a `.mailmap`. Is there any particular reason for this, or any process for updating my name/email everywhere?

2 years agoRollup merge of #87343 - steffahn:fix_unsound_zip_optimization_only_regression_fix...
Guillaume Gomez [Thu, 22 Jul 2021 11:39:24 +0000 (13:39 +0200)]
Rollup merge of #87343 - steffahn:fix_unsound_zip_optimization_only_regression_fix, r=cuviper

Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations

Removes the implementations that depend on the user-definable trait `Copy`.

Only fix regressions to ensure merge in 1.55: Does not modify `vec::IntoIter`.

<hr>

This PR applies the beta-`1.53` backport #86222 (merged as part of #86225), a reduced version of #85874 that only fixes regressions, to `master` in order to avoid the need for further backports from `1.55` onwards. Beta-`1.54` backport already happened with #87136. In case that #85874 gets merged quickly (within a week), this PR would be unnecessary.

r? `@cuviper`

2 years agoRollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisa
Guillaume Gomez [Thu, 22 Jul 2021 11:39:23 +0000 (13:39 +0200)]
Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisa

Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.

The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support.

Fixes https://github.com/rust-lang/rust/issues/61002.

r? ``@nagisa`` (or anyone else from ``@rust-lang/wg-llvm)``

2 years agoRollup merge of #87288 - ijackson:rustdoc-theme, r=GuillaumeGomez
Guillaume Gomez [Thu, 22 Jul 2021 11:39:22 +0000 (13:39 +0200)]
Rollup merge of #87288 - ijackson:rustdoc-theme, r=GuillaumeGomez

rustdoc: Restore --default-theme, etc, by restoring varname escaping

In #86157

    cd0f93193c84ddc6698f9b65909da71c084dcb74
    Use Tera templates for rustdoc.

dropped the following transformation from the keys of the default settings element's `data-` attribute names:

    .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v)))

The `Escape` part is indeed no longer needed, because Tera does that for us.  But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments.

I have tested that the default theme function works again for me.  I have also verified that passing (in shell syntax)

    '--default-theme="zork&"'

escapes the value in the HTML.

Closes #87263

2 years agoRollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakis
Guillaume Gomez [Thu, 22 Jul 2021 11:39:21 +0000 (13:39 +0200)]
Rollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakis

Normalize generic_ty before checking if bound is met

Fixes #81487

r? `@nikomatsakis`

2 years agoRollup merge of #87270 - GuillaumeGomez:item-summary-table, r=notriddle
Guillaume Gomez [Thu, 22 Jul 2021 11:39:20 +0000 (13:39 +0200)]
Rollup merge of #87270 - GuillaumeGomez:item-summary-table, r=notriddle

Don't display <table> in item summary

Fixes #87231.

r? `@notriddle`

2 years agobless nll tests
Oli Scherer [Thu, 22 Jul 2021 11:26:42 +0000 (11:26 +0000)]
bless nll tests

2 years agoAdd a regression test
Oli Scherer [Tue, 20 Jul 2021 15:16:41 +0000 (15:16 +0000)]
Add a regression test

2 years agoResolve nested inference variables.
Oli Scherer [Tue, 20 Jul 2021 15:10:55 +0000 (15:10 +0000)]
Resolve nested inference variables.

I attempted that with the previous code, but I misunderstdood how
`shallow_resolve` works.

2 years agoRemove an unnecessary variable
Oli Scherer [Tue, 20 Jul 2021 10:53:23 +0000 (10:53 +0000)]
Remove an unnecessary variable

2 years agoUse instrument debugging for more readable logs
Oli Scherer [Tue, 20 Jul 2021 10:48:56 +0000 (10:48 +0000)]
Use instrument debugging for more readable logs

2 years agoMake mir borrowck's use of opaque types independent of the typeck query's result
Oli Scherer [Mon, 19 Jul 2021 16:50:43 +0000 (16:50 +0000)]
Make mir borrowck's use of opaque types independent of the typeck query's result

2 years agoFix VecMap::iter_mut
Oli Scherer [Mon, 19 Jul 2021 16:38:14 +0000 (16:38 +0000)]
Fix VecMap::iter_mut

It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.

2 years agoMove implementors directly into lib2
Guillaume Gomez [Wed, 21 Jul 2021 20:30:12 +0000 (22:30 +0200)]
Move implementors directly into lib2

2 years agoAdd tests for default-settings
Guillaume Gomez [Wed, 21 Jul 2021 15:56:41 +0000 (17:56 +0200)]
Add tests for default-settings

2 years agoAuto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiser
bors [Thu, 22 Jul 2021 10:04:44 +0000 (10:04 +0000)]
Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiser

Profile incremental compilation hashing fingerprints

Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query.

This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time.

TODOs:
* [x] Address the FIXME where we are including node interning in the hash timing.
* [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166
* [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time)

r? `@ghost`

cc `@michaelwoerister`

2 years agoAuto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank
bors [Thu, 22 Jul 2021 07:21:45 +0000 (07:21 +0000)]
Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank

Support HIR wf checking for function signatures

During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).

2 years agoMake `x.py d` an alias for `x.py doc`
inquisitivecrystal [Wed, 21 Jul 2021 07:50:12 +0000 (00:50 -0700)]
Make `x.py d` an alias for `x.py doc`

2 years agoAuto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakis
bors [Thu, 22 Jul 2021 05:02:50 +0000 (05:02 +0000)]
Auto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakis

Fix implicit Sized relaxation when attempting to relax other, unsupported trait

Fixes #87199.

Do note that this bug fix causes code like the `ref_arg::<[i32]>(&[5]);` line in the test case in combination with an affected function to no longer compile.

2 years agotemporarily ignore a test until we reland PR 83171.
Felix S. Klock II [Thu, 22 Jul 2021 03:03:06 +0000 (23:03 -0400)]
temporarily ignore a test until we reland PR 83171.

2 years agoAllow some temporarily dead code.
Felix S. Klock II [Thu, 22 Jul 2021 02:57:10 +0000 (22:57 -0400)]
Allow some temporarily dead code.

I expect these two methods to come back very soon; noise of removing them to satisfy lint seems wrong.

2 years agoRevert PR 81473 to resolve (on mainline) issues 81626 and 81658.
Felix S. Klock II [Mon, 15 Mar 2021 20:39:41 +0000 (16:39 -0400)]
Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.

Revert "Add missing brace"

This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655.

Revert "Simplify base_expr"

This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c.

Revert "Warn write-only fields"

This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.

2 years agoAuto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakis
bors [Thu, 22 Jul 2021 02:22:02 +0000 (02:22 +0000)]
Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakis

When pretty printing, name placeholders as bound regions

Split from #85499

When we see a placeholder that we are going to print, treat it as a bound var (and add it to a `for<...>`

2 years agoUpdate my name/email in .mailmap
Lily Ballard [Wed, 21 Jul 2021 23:53:19 +0000 (16:53 -0700)]
Update my name/email in .mailmap

2 years agoAuto merge of #86946 - Aaron1011:eval-proj-obligation, r=nikomatsakis
bors [Wed, 21 Jul 2021 23:18:19 +0000 (23:18 +0000)]
Auto merge of #86946 - Aaron1011:eval-proj-obligation, r=nikomatsakis

 Improve caching during trait evaluation

Previously, we would 'forget' that we had `'static` regions in some
place during trait evaluation. This lead to us producing
`EvaluatedToOkModuloRegions` when we could have produced
`EvaluatedToOk`, causing us to perform unnecessary work.

This PR preserves `'static` regions when we canonicalize a predicate for
`evaluate_obligation`, and when we 'freshen' a predicate during trait
evaluation. Thie ensures that evaluating a predicate containing
`'static` regions can produce `EvaluatedToOk` (assuming that we
don't end up introducing any region dependencies during evaluation).

Building off of this improved caching, we use
`predicate_must_hold_considering_regions` during fulfillment of
projection predicates to see if we can skip performing additional work.
We already do this for trait predicates, but doing this for projection
predicates lead to mixed performance results without the above caching
improvements.

2 years agoImprove caching during trait evaluation
Aaron Hill [Wed, 7 Jul 2021 15:56:26 +0000 (10:56 -0500)]
Improve caching during trait evaluation

Previously, we would 'forget' that we had `'static` regions in some
place during trait evaluation. This lead to us producing
`EvaluatedToOkModuloRegions` when we could have produced
`EvaluatedToOk`, causing us to perform unnecessary work.

This PR preserves `'static` regions when we canonicalize a predicate for
`evaluate_obligation`, and when we 'freshen' a predicate during trait
evaluation. Thie ensures that evaluating a predicate containing
`'static` regions can produce `EvaluatedToOk` (assuming that we
don't end up introducing any region dependencies during evaluation).

Building off of this improved caching, we use
`predicate_must_hold_considering_regions` during fulfillment of
projection predicates to see if we can skip performing additional work.
We already do this for trait predicates, but doing this for projection
predicates lead to mixed performance results without the above caching
improvements.

2 years agoAuto merge of #87351 - ehuss:rollup-pga85az, r=ehuss
bors [Wed, 21 Jul 2021 19:50:10 +0000 (19:50 +0000)]
Auto merge of #87351 - ehuss:rollup-pga85az, r=ehuss

Rollup of 5 pull requests

Successful merges:

 - #81864 (docs: GlobalAlloc: completely replace example with one that works)
 - #87024 (rustdoc: show count of item contents when hidden)
 - #87278 (:arrow_up: rust-analyzer)
 - #87326 (Update cargo)
 - #87346 (Rename force-warns to force-warn)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRemove cargo workspace to build rustdoc-gui test crates because of cargo config not...
Guillaume Gomez [Wed, 21 Jul 2021 15:55:44 +0000 (17:55 +0200)]
Remove cargo workspace to build rustdoc-gui test crates because of cargo config not being applied

2 years agoAdd test to ensure tables are not inside items summary
Guillaume Gomez [Mon, 19 Jul 2021 10:02:41 +0000 (12:02 +0200)]
Add test to ensure tables are not inside items summary

2 years agoDon't render <table> in items' summary
Guillaume Gomez [Mon, 19 Jul 2021 09:50:14 +0000 (11:50 +0200)]
Don't render <table> in items' summary

2 years agoRun rustfmt
Ian Jackson [Tue, 20 Jul 2021 15:12:11 +0000 (16:12 +0100)]
Run rustfmt

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agorustdoc: Restore --default-theme, etc, by restoring varname escaping
Ian Jackson [Mon, 19 Jul 2021 16:13:22 +0000 (17:13 +0100)]
rustdoc: Restore --default-theme, etc, by restoring varname escaping

In #86157

    cd0f93193c84ddc6698f9b65909da71c084dcb74
    Use Tera templates for rustdoc.

dropped the following transformation from the keys of the default
settings element's `data-` attribute names:

    .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v)))

The `Escape` part is indeed no longer needed, because Tera does that
for us.  But the massaging of `-` to `_` is needed, for the (bizarre)
reasons explained in the new comments.

I have tested that the default theme function works again for me.  I
have also verified that passing

    --default-theme="zork&"

escapes the value in the HTML.

Closes #87263.

CC: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoRollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakis
Eric Huss [Wed, 21 Jul 2021 17:12:30 +0000 (10:12 -0700)]
Rollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakis

Rename force-warns to force-warn

The renames the `--force-warns` option to `--force-warn`. This mirrors other lint options like `--warn` and `--deny` which are in the singular.

r? `@nikomatsakis`

cc `@ehuss` - this option is being used by Cargo. How do we make sure the transition to using the new name is as smooth as possible?

2 years agoRollup merge of #87326 - ehuss:update-cargo, r=ehuss
Eric Huss [Wed, 21 Jul 2021 17:12:29 +0000 (10:12 -0700)]
Rollup merge of #87326 - ehuss:update-cargo, r=ehuss

Update cargo

6 commits in 27277d966b3cfa454d6dea7f724cb961c036251c..4e143fd131e0c16cefd008456e974236ca54e62e
2021-07-16 00:50:39 +0000 to 2021-07-20 21:55:45 +0000
- Named profile updates (rust-lang/cargo#9685)
- Inform build scripts of rustc compiler context (rust-lang/cargo#9601)
- Factor version preferences into a struct (rust-lang/cargo#9703)
- docs: Fix sentence & update link for GitLab CI docs (rust-lang/cargo#9704)
- Deduplicate compiler diagnostics. (rust-lang/cargo#9675)
- Re-enable future-incompatible tests. (rust-lang/cargo#9698)

2 years agoRollup merge of #87278 - lnicola:rust-analyzer-2021-07-19, r=lnicola
Eric Huss [Wed, 21 Jul 2021 17:12:28 +0000 (10:12 -0700)]
Rollup merge of #87278 - lnicola:rust-analyzer-2021-07-19, r=lnicola

:arrow_up: rust-analyzer

2 years agoRollup merge of #87024 - weihanglo:issue-85494, r=Manishearth
Eric Huss [Wed, 21 Jul 2021 17:12:27 +0000 (10:12 -0700)]
Rollup merge of #87024 - weihanglo:issue-85494, r=Manishearth

rustdoc: show count of item contents when hidden

Resolves #85494

2 years agoRollup merge of #81864 - ijackson:globalalloc-example, r=Amanieu
Eric Huss [Wed, 21 Jul 2021 17:12:26 +0000 (10:12 -0700)]
Rollup merge of #81864 - ijackson:globalalloc-example, r=Amanieu

docs: GlobalAlloc: completely replace example with one that works

Since this is an example, this could really do with some review from someone familiar with unsafe stuff!

I made the example no longer `no_run` since it works for me.

Fixes #81847

2 years agoAuto merge of #87347 - GuillaumeGomez:rollup-ke92xxc, r=GuillaumeGomez
bors [Wed, 21 Jul 2021 13:54:22 +0000 (13:54 +0000)]
Auto merge of #87347 - GuillaumeGomez:rollup-ke92xxc, r=GuillaumeGomez

Rollup of 9 pull requests

Successful merges:

 - #87187 (Fix NixOS detection)
 - #87206 (avoid temporary vectors/reuse iterators)
 - #87230 (Fix docblock <table> overflow)
 - #87273 (Recognize bounds on impls as const bounds)
 - #87279 (Add comments explaining the unix command-line argument support.)
 - #87301 (Fix typo in compile.rs)
 - #87311 (Get back the more precise suggestion spans of old regionck)
 - #87321 (Add long explanation for E0722)
 - #87342 (Add long explanation for E0757)

Failed merges:

 - #87270 (Don't display <table> in item summary)

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #87342 - midgleyc:add-E0757-long, r=GuillaumeGomez
Guillaume Gomez [Wed, 21 Jul 2021 13:52:53 +0000 (15:52 +0200)]
Rollup merge of #87342 - midgleyc:add-E0757-long, r=GuillaumeGomez

Add long explanation for E0757

Helps with #61137

2 years agoRollup merge of #87321 - midgleyc:add-E0722-long, r=GuillaumeGomez
Guillaume Gomez [Wed, 21 Jul 2021 13:52:52 +0000 (15:52 +0200)]
Rollup merge of #87321 - midgleyc:add-E0722-long, r=GuillaumeGomez

Add long explanation for E0722

Helps with #61137

2 years agoRollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebank
Guillaume Gomez [Wed, 21 Jul 2021 13:52:51 +0000 (15:52 +0200)]
Rollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebank

Get back the more precise suggestion spans of old regionck

I noticed that when you turn on nll, the structured suggestion replaces a snippet instead of appending a snippet. It seems clearer to the user to only highlight the newly added characters instead of the entire `impl Trait` (and old regionck already does it this way).

r? ``@estebank``

2 years agoRollup merge of #87301 - chinmaydd:chinmaydd-patch-1-1, r=jyn514
Guillaume Gomez [Wed, 21 Jul 2021 13:52:50 +0000 (15:52 +0200)]
Rollup merge of #87301 - chinmaydd:chinmaydd-patch-1-1, r=jyn514

Fix typo in compile.rs

2 years agoRollup merge of #87279 - sunfishcode:document-unix-argv, r=RalfJung
Guillaume Gomez [Wed, 21 Jul 2021 13:52:49 +0000 (15:52 +0200)]
Rollup merge of #87279 - sunfishcode:document-unix-argv, r=RalfJung

Add comments explaining the unix command-line argument support.

Following up on #87236, add comments to the unix command-line argument
support explaining that the code doesn't mutate the system-provided
argc/argv, and that this is why the code doesn't need a lock or special
memory ordering.

r? ```@RalfJung```

2 years agoRollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk
Guillaume Gomez [Wed, 21 Jul 2021 13:52:47 +0000 (15:52 +0200)]
Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk

Recognize bounds on impls as const bounds

r? ```@oli-obk```

2 years agoRollup merge of #87230 - GuillaumeGomez:docblock-table-overflow, r=notriddle
Guillaume Gomez [Wed, 21 Jul 2021 13:52:46 +0000 (15:52 +0200)]
Rollup merge of #87230 - GuillaumeGomez:docblock-table-overflow, r=notriddle

Fix docblock <table> overflow

Before:

![Screenshot from 2021-07-18 00-05-23](https://user-images.githubusercontent.com/3050060/126050272-ce08bc5f-74ff-4135-bc12-d708d87470cc.png)

After:

![Screenshot from 2021-07-18 00-03-55](https://user-images.githubusercontent.com/3050060/126050273-42f41b4d-ad57-4a87-91de-18e63f8504ec.png)

cc `@SergioBenitez`

r? `@notriddle`

2 years agoRollup merge of #87206 - matthiaskrgr:clippy_collect, r=davidtwco
Guillaume Gomez [Wed, 21 Jul 2021 13:52:45 +0000 (15:52 +0200)]
Rollup merge of #87206 - matthiaskrgr:clippy_collect, r=davidtwco

avoid temporary vectors/reuse iterators

Avoid collecting an interator just to re-iterate immediately.
Rather reuse the previous iterator. (clippy::needless_collect)

2 years agoRollup merge of #87187 - oxalica:fix-nixos-detect, r=nagisa
Guillaume Gomez [Wed, 21 Jul 2021 13:52:44 +0000 (15:52 +0200)]
Rollup merge of #87187 - oxalica:fix-nixos-detect, r=nagisa

Fix NixOS detection

Use `/etc/os-release` instead of `/etc/NIXOS` for detection.
The latter one does not exist on NixOS when using tmpfs as root.

2 years agoRename force-warns to force-warn
Ryan Levick [Wed, 21 Jul 2021 13:40:52 +0000 (15:40 +0200)]
Rename force-warns to force-warn

2 years agodocs: normalise wording in line with docs
Chris Midgley [Wed, 21 Jul 2021 13:13:46 +0000 (14:13 +0100)]
docs: normalise wording in line with docs

2 years agodocs: add additional links for ffi_pure / ffi_const
Chris Midgley [Wed, 21 Jul 2021 13:11:14 +0000 (14:11 +0100)]
docs: add additional links for ffi_pure / ffi_const

2 years agoRemove unsound TrustedRandomAccess implementations
Frank Steffahn [Tue, 1 Jun 2021 00:21:26 +0000 (02:21 +0200)]
Remove unsound TrustedRandomAccess implementations

Removes the implementations that depend on the user-definable trait `Copy`.

Only fix regressions to ensure merge in 1.55: Does not modify `vec::IntoIter`.

2 years agoAdd long explanation for E0757
Chris Midgley [Wed, 21 Jul 2021 12:22:57 +0000 (13:22 +0100)]
Add long explanation for E0757

2 years agodocs: GlobalAlloc: Make example only require 4096-aligned static
Ian Jackson [Wed, 21 Jul 2021 11:37:59 +0000 (12:37 +0100)]
docs: GlobalAlloc: Make example only require 4096-aligned static

Alignments > 4k are not supported,
  https://github.com/rust-lang/rust/issues/70022
  https://github.com/rust-lang/rust/issues/70144

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodocs: add newline before example
Chris Midgley [Wed, 21 Jul 2021 09:58:35 +0000 (10:58 +0100)]
docs: add newline before example

2 years agodocs: remove spurious main functions
Chris Midgley [Wed, 21 Jul 2021 09:57:27 +0000 (10:57 +0100)]
docs: remove spurious main functions

2 years agoadd working code example
Chris Midgley [Wed, 21 Jul 2021 09:29:20 +0000 (10:29 +0100)]
add working code example

2 years agoAuto merge of #86847 - tlyu:stdin-forwarders, r=joshtriplett
bors [Wed, 21 Jul 2021 06:06:37 +0000 (06:06 +0000)]
Auto merge of #86847 - tlyu:stdin-forwarders, r=joshtriplett

add `Stdin::lines`, `Stdin::split` forwarder methods

Add forwarder methods `Stdin::lines` and `Stdin::split`, which consume
and lock a `Stdin` handle, and forward on to the corresponding `BufRead`
methods. This should make it easier for beginners to use those iterator
constructors without explicitly dealing with locks or lifetimes.

Replaces #86412.
~~Based on #86846 to get the tracking issue number for the `stdio_locked` feature.~~ Rebased after merge, so it's only one commit now.

r? `@joshtriplett`
`@rustbot` label +A-io +C-enhancement +D-newcomer-roadblock +T-libs-api

2 years agoAuto merge of #82653 - jyn514:submodules-on-demand, r=Mark-Simulacrum
bors [Wed, 21 Jul 2021 03:36:21 +0000 (03:36 +0000)]
Auto merge of #82653 - jyn514:submodules-on-demand, r=Mark-Simulacrum

Update all submodules that rustbuild doesn't depend on lazily

This only updates the submodules the first time they're needed, instead
of unconditionally the first time you run x.py.

Ideally, this would move *all* submodules to rustbuild and not exclude some tools and
backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the
whole workspace to be present to build any crate.

On my machine, this takes the time for an initial submodule clone (for
`x.py --help`) from 55.70 to 15.87 seconds.

Helps with https://github.com/rust-lang/rust/issues/76653. Builds on https://github.com/rust-lang/rust/pull/86015 and should not be merged before (only the last commit is relevant).

2 years agoUpdate all submodules that rustbuild doesn't depend on lazily
Joshua Nelson [Mon, 1 Mar 2021 04:51:15 +0000 (23:51 -0500)]
Update all submodules that rustbuild doesn't depend on lazily

This only updates the submodules the first time they're needed, instead
of unconditionally the first time you run x.py.

Ideally, this would move *all* submodules and not exclude some tools and
backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the
whole workspace to be present to build any crate.

On my machine, this takes the time for an initial submodule clone (for
`x.py --help`) from 55.70 to 15.87 seconds.

This uses exactly the same logic as the LLVM update used, modulo some
minor cleanups:
- Use a local variable for `src.join(relative_path)`
- Remove unnecessary arrays for `book!` macro and make the macro simpler to use
- Add more comments

2 years agoAuto merge of #87168 - the8472:flatten-len, r=scottmcm
bors [Tue, 20 Jul 2021 23:47:48 +0000 (23:47 +0000)]
Auto merge of #87168 - the8472:flatten-len, r=scottmcm

implement TrustedLen for Flatten/FlatMap if the U: IntoIterator == [T; N]

This only works if arrays are passed directly instead of array iterators
because we need to be sure that they have not been advanced before
Flatten does its size calculation.

resolves #87094

2 years agoUpdate cargo
Eric Huss [Tue, 20 Jul 2021 23:08:41 +0000 (16:08 -0700)]
Update cargo

2 years agoAdd long explanation for E0722
Chris Midgley [Tue, 20 Jul 2021 19:13:08 +0000 (20:13 +0100)]
Add long explanation for E0722

2 years agoAuto merge of #87312 - ehuss:update-books, r=ehuss
bors [Tue, 20 Jul 2021 18:44:35 +0000 (18:44 +0000)]
Auto merge of #87312 - ehuss:update-books, r=ehuss

Update books

## reference

6 commits in ab60513a3a5a0591e237fddff5d027a982648392..82d75cf423e4a7824fb36e73ccb18519d6900610
2021-07-05 08:27:31 -0700 to 2021-07-15 06:49:08 -0700
- fix wording/punctuation in "Lifetime bounds" (rust-lang/reference#1062)
- mention implicit `Sized` bound in more places (rust-lang/reference#1053)
-  (rust-lang/reference#1060)
- Remove inner attributes from non-block expressions. (rust-lang/reference#1051)
- Add note about the sign of the remainder (rust-lang/reference#1073)
- Clarify closure capture modes slightly (rust-lang/reference#1064)

## book

21 commits in a90f07f1e9a7fc75dc9105a6c6f16d5c13edceb0..eac55314210519238652f12b30fec9daea61f7fe
2021-07-05 14:43:12 -0400 to 2021-07-19 11:08:01 -0400
-  (rust-lang/book#2791)
- Add Deref trait to overload the deref operator in appendix table
- Revise linker installation instructions. Fixes rust-lang/book#2151.
- Clarify number literal type suffixes. Fixes rust-lang/book#1979.
- Add a note that lifetimes are coming up but aren't required
- Zip creates an iterator, not a vector. Fixes rust-lang/book#2762.
- Add Thai translation to the appendix. Connects to rust-lang/book#2636
- Derive Copy and Clone for Point to match stdlib docs example; fixes rust-lang/book#2657
- Make the definition of Option match the stdlib's, fixes rust-lang/book#2634
- Explain double quote backslash; closes rust-lang/book#2597
- Don't use the term 'anonymous struct' to fix rust-lang/book#2584
- Reword a sentence to fix rust-lang/book#2525
- Add Hindi translation. Connects to rust-lang/book#2496
- Remove unsafe Ferris designations from code. Fixes rust-lang/book#2555
- Add Traditional Chinese translation. Connects to rust-lang/book#2470
- Remove some more references to the authors field
- Make Appendix E be a link
- fix line wrapping
- remove description about the authors field
- remove the authors field
- remove the authors field

## rust-by-example

6 commits in 028f93a61500fe8f746ee7cc6b204ea6c9f42935..1db6bb483cc87ad3b424d9aba764fe622960a1be
2021-07-06 06:28:53 -0300 to 2021-07-15 06:17:42 -0300
- Updated the file destructure_tuple.md (rust-lang/rust-by-example#1452)
- Fix nomenclature around methods (rust-lang/rust-by-example#1450)
- std_misc/path.md: update `Show` to `Display` (rust-lang/rust-by-example#1449)
- Fix up github action (rust-lang/rust-by-example#1451)
- Remove github pages
- Support GitHub Actions (rust-lang/rust-by-example#1330)

## rustc-dev-guide

2 commits in 60e282559104035985331645907c3d9f842312c5..93422c21baca585dc88357ec886a48f6ddc7d665
2021-07-05 11:21:03 -0400 to 2021-07-13 12:45:58 -0400
- Update for merge of CrateDisambiguator into StableCrateId
- Minor capitalization fix (rust-lang/rustc-dev-guide#1170)

## edition-guide

8 commits in 5d57b3832f8d308a9f478ce0a69799548f27ad4d..af696ce8ea526445590ae0ca66a8128d2a95a69a
2021-07-05 10:33:32 +0200 to 2021-07-20 11:38:03 -0400
- Add migration section for panic-macro-consistency (rust-lang/edition-guide#258)
- Update transitioning chapter. (rust-lang/edition-guide#255)
- Add details on migrating the Cargo feature resolver. (rust-lang/edition-guide#259)
- Improve panic macro consistency summary (rust-lang/edition-guide#256)
- Add migration details to or-patterns guide (rust-lang/edition-guide#252)
- Add migration section to into-iterator (rust-lang/edition-guide#253)
- Add Rust 2021 prelude migration details (rust-lang/edition-guide#251)
- Provide more information about disjoint capture in closures and migration instructions (rust-lang/edition-guide#246)

## embedded-book

1 commits in 506840eb73b0749336e1d5274e16d6393892ee82..09986cd352404eb4659db44613b27cac9aa652fc
2021-06-24 00:01:32 +0000 to 2021-07-18 19:26:46 +0000
- Stop referring to the alloc crate as unstable  (rust-embedded/book#297)

2 years agoFix NixOS detection
oxalica [Fri, 16 Jul 2021 11:18:50 +0000 (19:18 +0800)]
Fix NixOS detection

Use `/etc/os-release` instead of `/etc/NIXOS`.
The latter one does not exist on NixOS when using tmpfs as root.

2 years agoUpdate books
Eric Huss [Tue, 20 Jul 2021 16:10:17 +0000 (09:10 -0700)]
Update books

2 years agoAuto merge of #87247 - crlf0710:merge-libterm-into-libtest, r=nagisa
bors [Tue, 20 Jul 2021 16:03:47 +0000 (16:03 +0000)]
Auto merge of #87247 - crlf0710:merge-libterm-into-libtest, r=nagisa

Merge libterm into libtest

I think it's quite clear at this point that rust won't stablize the current libterm APIs to the outside world. And its only user is libtest. The compiler doesn't use this api at all. So I'm merging the crate into libtest as a module.

This also allows me to remove 15% of the libterm code, since these APIs are dead-code now.

2 years agoSupport HIR wf checking for function signatures
Aaron Hill [Sun, 18 Jul 2021 16:33:49 +0000 (11:33 -0500)]
Support HIR wf checking for function signatures

During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).

2 years agoGet back the more precise suggestion spans of old regionck
Oli Scherer [Tue, 20 Jul 2021 11:36:31 +0000 (11:36 +0000)]
Get back the more precise suggestion spans of old regionck

2 years agodocs: GlobalAlloc: completely replace example with one that works
Ian Jackson [Sun, 7 Feb 2021 21:50:56 +0000 (21:50 +0000)]
docs: GlobalAlloc: completely replace example with one that works

Since this is an example, this could really do with some review from
someone familiar with unsafe stuff !

I made the example no longer `no_run` since it works for me.

Fixes #81847

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2 years agoAuto merge of #87310 - spastorino:update_miri, r=RalfJung
bors [Tue, 20 Jul 2021 13:37:02 +0000 (13:37 +0000)]
Auto merge of #87310 - spastorino:update_miri, r=RalfJung

Update MIRI

Fixes #87306

r? `@RalfJung`

2 years agoUpdate MIRI
Santiago Pastorino [Tue, 20 Jul 2021 12:52:19 +0000 (09:52 -0300)]
Update MIRI

2 years agoAuto merge of #87244 - jackh726:issue-71883, r=estebank
bors [Tue, 20 Jul 2021 10:56:08 +0000 (10:56 +0000)]
Auto merge of #87244 - jackh726:issue-71883, r=estebank

Better diagnostics with mismatched types due to implicit static lifetime

Fixes #78113

I think this is my first diagnostics PR...definitely happy to hear thoughts on the direction/implementation here.

I was originally just trying to solve the error above, where the lifetime on a GAT was causing a cryptic "mismatched types" error. But as I was writing this, I realized that this (unintentionally) also applied to a different case: `wf-in-foreign-fn-decls-issue-80468.rs`. I'm not sure if this diagnostic should get a new error code, or even reuse an existing one. And, there might be some ways to make this even more generalized. Also, the error is a bit more lengthy and verbose than probably needed. So thoughts there are welcome too.

This PR essentially ended up adding a new nice region error pass that triggers if a type doesn't match the self type of an impl which is selected because of a predicate because of an implicit static bound on that self type.

r? `@estebank`

2 years agoAllow combining -Cprofile-generate and -Cpanic=unwind when targeting
Michael Woerister [Mon, 19 Jul 2021 15:14:58 +0000 (17:14 +0200)]
Allow combining -Cprofile-generate and -Cpanic=unwind when targeting
MSVC.

The LLVM limitation that previously prevented this has been fixed in LLVM
9 which is older than the oldest LLVM version we currently support.

See https://github.com/rust-lang/rust/issues/61002.