]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #97903 - est31:unused_macro_rules_compile_error, r=petrochenkov
bors [Sat, 11 Jun 2022 08:46:21 +0000 (08:46 +0000)]
Auto merge of #97903 - est31:unused_macro_rules_compile_error, r=petrochenkov

Never regard macro rules with compile_error! invocations as unused

The very point of compile_error! is to never be reached, and one of
the use cases of the macro, currently also listed as examples in the
documentation of compile_error, is to create nicer errors for wrong
macro invocations. Thus, we should never warn about unused macro arms
that contain invocations of compile_error.

See also https://github.com/rust-lang/rust/pull/96150#issuecomment-1126599107 and the discussion after that.

Furthermore, the PR also contains two commits to silence `unused_macro_rules` when a macro has an invalid rule, and to add a test that `unused_macros` does not behave badly in the same situation.

r? `@petrochenkov` as I've talked to them about this

2 years agoAuto merge of #97980 - Dylan-DPC:rollup-l8exe4b, r=Dylan-DPC
bors [Sat, 11 Jun 2022 06:17:54 +0000 (06:17 +0000)]
Auto merge of #97980 - Dylan-DPC:rollup-l8exe4b, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #96868 (Stabilize explicit_generic_args_with_impl_trait)
 - #97703 (some additional `need_type_info.rs` cleanup)
 - #97812 (Suggest to swap a struct and a trait in trait impls)
 - #97958 (ExitStatus docs fixups)
 - #97967 (Mention `infer::Trace` methods on `infer::At` methods' docs)
 - #97972 (Update #[doc(html_playground_url)] documentation to mention what the request will be)

Failed merges:

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

2 years agoRollup merge of #97972 - hamza1311:patch-1, r=Dylan-DPC
Dylan DPC [Sat, 11 Jun 2022 05:42:17 +0000 (07:42 +0200)]
Rollup merge of #97972 - hamza1311:patch-1, r=Dylan-DPC

Update #[doc(html_playground_url)] documentation to mention what the request will be

The [documentation for `#![doc(html_playground_url = "_")]`](https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_playground_url) specifies that a request will be made to the given URL but does specify what the contents of the request will be. This PR updates the documentation to include the query parameters through which the code is provided to the playground.

2 years agoRollup merge of #97967 - BoxyUwU:at_docs_mention_trace, r=compiler-errors
Dylan DPC [Sat, 11 Jun 2022 05:42:16 +0000 (07:42 +0200)]
Rollup merge of #97967 - BoxyUwU:at_docs_mention_trace, r=compiler-errors

Mention `infer::Trace` methods on `infer::At` methods' docs

I missed that you could do `infcx.at(...).trace(...).eq(a, b)` when `a` and `b` dont implement `ToTrace` but does implement `Relate` these docs would have helped see that :sweat_smile:

2 years agoRollup merge of #97958 - mkroening:exit-status-docs, r=Dylan-DPC
Dylan DPC [Sat, 11 Jun 2022 05:42:15 +0000 (07:42 +0200)]
Rollup merge of #97958 - mkroening:exit-status-docs, r=Dylan-DPC

ExitStatus docs fixups

This fixes a typo, adds a link and adds code-quotes in the ExitStatus docs.

2 years agoRollup merge of #97812 - TaKO8Ki:suggest-to-swap-struct-and-trait, r=estebank
Dylan DPC [Sat, 11 Jun 2022 05:42:14 +0000 (07:42 +0200)]
Rollup merge of #97812 - TaKO8Ki:suggest-to-swap-struct-and-trait, r=estebank

Suggest to swap a struct and a trait in trait impls

closes #89590

2 years agoRollup merge of #97703 - lcnr:post-89862, r=estebank
Dylan DPC [Sat, 11 Jun 2022 05:42:13 +0000 (07:42 +0200)]
Rollup merge of #97703 - lcnr:post-89862, r=estebank

some additional `need_type_info.rs` cleanup

also fixes #97698, fixes #97806

cc `@estebank`

2 years agoRollup merge of #96868 - nrc:turbo-stable, r=jhpratt,nbdd0121,nagisa
Dylan DPC [Sat, 11 Jun 2022 05:42:12 +0000 (07:42 +0200)]
Rollup merge of #96868 - nrc:turbo-stable, r=jhpratt,nbdd0121,nagisa

Stabilize explicit_generic_args_with_impl_trait

This is a stabilisation PR for `explicit_generic_args_with_impl_trait`.

* [tracking issue](https://github.com/rust-lang/rust/issues/83701)
  - [Stabilisation report](https://github.com/rust-lang/rust/issues/83701#issuecomment-1109949897)
  - [FCP entered](https://github.com/rust-lang/rust/issues/83701#issuecomment-1120285703)
* [implementation PR](https://github.com/rust-lang/rust/pull/86176)
* [Reference PR](https://github.com/rust-lang/reference/pull/1212)
* There is no mention of using the turbofish operator in the book (other than an entry in the operator list in the appendix), so there is no documentation to change/add there, unless we felt like we should add a section on using turbofish, but that seems orthogonal to `explicit_generic_args_with_impl_trait`

2 years agoAuto merge of #97905 - nnethercote:revert-infallible-encoder, r=bjorn3
bors [Sat, 11 Jun 2022 04:00:23 +0000 (04:00 +0000)]
Auto merge of #97905 - nnethercote:revert-infallible-encoder, r=bjorn3

Revert part of #94372 to improve performance

#94732 was supposed to give small but widespread performance improvements, as judged from three per-merge performance runs. But the performance run that occurred after merging included a roughly equal number of improvements and regressions, for unclear reasons.

This PR is for a test run reverting those changes, to see what happens.

r? `@ghost`

2 years agoAuto merge of #97648 - lcnr:bound-var-replacer, r=jackh726
bors [Sat, 11 Jun 2022 01:39:43 +0000 (01:39 +0000)]
Auto merge of #97648 - lcnr:bound-var-replacer, r=jackh726

cleanup bound variable handling

each commit should be pretty self-contained and hopefully straightforward to review.

I've added 677ec23a8dbf8ff5f1c03ccebd46f8b85e5ec1fc so that we can stop returning the region map from `replace_bound_vars_with_fresh_vars` in the following commit.

r? `@nikomatsakis` or `@jackh726`

2 years agoAuto merge of #97968 - matthiaskrgr:rollup-qtd4i5h, r=matthiaskrgr
bors [Fri, 10 Jun 2022 22:50:17 +0000 (22:50 +0000)]
Auto merge of #97968 - matthiaskrgr:rollup-qtd4i5h, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #93331 (refactor write_output_file to merge two invocation paths into one.)
 - #97928 (Removes debug settings from wasm32_unknown_emscripten default link args)
 - #97940 (Use relative links instead of linking to doc.rust-lang.org when possible)
 - #97941 (nit: Fixed several error_codes/Exxxx.md messages which used UpperCamelCase…)
 - #97953 (Add regression test for #54378)
 - #97957 (Make `std::` prefix suggestion test `run-rustfix`)

Failed merges:

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

2 years agoUpdate the-doc-attribute.md
Muhammad Hamza [Fri, 10 Jun 2022 22:10:29 +0000 (03:10 +0500)]
Update the-doc-attribute.md

2 years agoUpdate the-doc-attribute.md
Muhammad Hamza [Fri, 10 Jun 2022 21:03:33 +0000 (02:03 +0500)]
Update the-doc-attribute.md

2 years agothe day that i make a PR without a tidy error..
Ellen [Fri, 10 Jun 2022 20:47:00 +0000 (21:47 +0100)]
the day that i make a PR without a tidy error..

2 years agoRollup merge of #97957 - estebank:spancito, r=compiler-errors
Matthias Krüger [Fri, 10 Jun 2022 20:32:34 +0000 (22:32 +0200)]
Rollup merge of #97957 - estebank:spancito, r=compiler-errors

Make `std::` prefix suggestion test `run-rustfix`

2 years agoRollup merge of #97953 - JohnTitor:issue-54378, r=compiler-errors
Matthias Krüger [Fri, 10 Jun 2022 20:32:33 +0000 (22:32 +0200)]
Rollup merge of #97953 - JohnTitor:issue-54378, r=compiler-errors

Add regression test for #54378

Closes #54378
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2 years agoRollup merge of #97941 - CorinJG:error_naming_conventions, r=compiler-errors
Matthias Krüger [Fri, 10 Jun 2022 20:32:32 +0000 (22:32 +0200)]
Rollup merge of #97941 - CorinJG:error_naming_conventions, r=compiler-errors

nit: Fixed several error_codes/Exxxx.md messages which used UpperCamelCase…

… instead of snake_case for module names

2 years agoRollup merge of #97940 - GuillaumeGomez:relative-link, r=Dylan-DPC
Matthias Krüger [Fri, 10 Jun 2022 20:32:31 +0000 (22:32 +0200)]
Rollup merge of #97940 - GuillaumeGomez:relative-link, r=Dylan-DPC

Use relative links instead of linking to doc.rust-lang.org when possible

Part of https://github.com/rust-lang/rust/issues/97918.

2 years agoRollup merge of #97928 - hoodmane:emscripten-no-assertions, r=tlively
Matthias Krüger [Fri, 10 Jun 2022 20:32:30 +0000 (22:32 +0200)]
Rollup merge of #97928 - hoodmane:emscripten-no-assertions, r=tlively

Removes debug settings from wasm32_unknown_emscripten default link args

This is a debug setting. We should only make debug builds if user requests
a debug build. Currently this is inserted in release builds.

Furthermore, it would be better to insert these settings in --pre-link-args
because then it would be possible to override them if appropriate. Because
these are inserted at the end, it is necessary to patch emscripten to remove
them.

``@sbc100``

2 years agoRollup merge of #93331 - pnkfelix:refactor-write-output-file, r=oli-obk
Matthias Krüger [Fri, 10 Jun 2022 20:32:29 +0000 (22:32 +0200)]
Rollup merge of #93331 - pnkfelix:refactor-write-output-file, r=oli-obk

refactor write_output_file to merge two invocation paths into one.

this is a trivial refactor I did while I was investigating issue #91671.

2 years agoa
Ellen [Fri, 10 Jun 2022 20:26:53 +0000 (21:26 +0100)]
a

2 years agodocs: Consistently mark ExitStatus as code
Martin Kröning [Fri, 10 Jun 2022 18:26:41 +0000 (20:26 +0200)]
docs: Consistently mark ExitStatus as code

2 years agodocs: Link to ExitCode instead of ExitStatus in ExitStatus
Martin Kröning [Fri, 10 Jun 2022 18:25:36 +0000 (20:25 +0200)]
docs: Link to ExitCode instead of ExitStatus in ExitStatus

2 years agodocs: Fix typo in ExitStatus
Martin Kröning [Fri, 10 Jun 2022 18:24:45 +0000 (20:24 +0200)]
docs: Fix typo in ExitStatus

2 years agoAdd regression test for #54378
Yuki Okushi [Fri, 10 Jun 2022 16:58:16 +0000 (01:58 +0900)]
Add regression test for #54378

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2 years agoE0577 fixed Sea struct CamelCase/sea module snake_case
CorinJG [Fri, 10 Jun 2022 13:21:40 +0000 (14:21 +0100)]
E0577 fixed Sea struct CamelCase/sea module snake_case

2 years agouse FxHashMap instead of BTreeMap
lcnr [Fri, 10 Jun 2022 08:09:05 +0000 (10:09 +0200)]
use FxHashMap instead of BTreeMap

2 years agoAuto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplett
bors [Fri, 10 Jun 2022 11:50:39 +0000 (11:50 +0000)]
Auto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplett

Use `fcntl(fd, F_GETFD)` to detect if standard streams are open

In the previous implementation, if the standard streams were open,
but the RLIMIT_NOFILE value was below three, the poll would fail
with EINVAL:

> ERRORS: EINVAL The nfds value exceeds the RLIMIT_NOFILE value.

Switch to the existing fcntl based implementation to avoid the issue.

Fixes #96621.

2 years agoFixed several error_codes/Exxxx.md messages which used UpperCamelCase instead of...
CorinJG [Fri, 10 Jun 2022 10:25:47 +0000 (11:25 +0100)]
Fixed several error_codes/Exxxx.md messages which used UpperCamelCase instead of snake_case for module names

2 years agoUse relative links instead of linking to doc.rust-lang.org when possible
Guillaume Gomez [Fri, 10 Jun 2022 09:57:53 +0000 (11:57 +0200)]
Use relative links instead of linking to doc.rust-lang.org when possible

2 years agoAuto merge of #97939 - JohnTitor:rollup-79pxupb, r=JohnTitor
bors [Fri, 10 Jun 2022 09:05:50 +0000 (09:05 +0000)]
Auto merge of #97939 - JohnTitor:rollup-79pxupb, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #97718 (Fix `delayed_good_path_bug` ice for expected diagnostics (RFC 2383))
 - #97876 (update docs for `std::future::IntoFuture`)
 - #97888 (Don't use __gxx_personality_v0 in panic_unwind on emscripten target)
 - #97922 (Remove redundant calls to reserve in impl Write for VecDeque)
 - #97927 (Do not introduce bindings for types and consts in HRTB.)
 - #97937 (Fix a typo in `test/ui/hrtb/hrtb-just-for-static.rs`)

Failed merges:

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

2 years agoRollup merge of #97937 - TaKO8Ki:fix-typo-in-hrtb-just-for-static, r=Dylan-DPC
Yuki Okushi [Fri, 10 Jun 2022 08:22:33 +0000 (17:22 +0900)]
Rollup merge of #97937 - TaKO8Ki:fix-typo-in-hrtb-just-for-static, r=Dylan-DPC

Fix a typo in `test/ui/hrtb/hrtb-just-for-static.rs`

closes #97934

2 years agoRollup merge of #97927 - cjgillot:issue-97836, r=petrochenkov
Yuki Okushi [Fri, 10 Jun 2022 08:22:32 +0000 (17:22 +0900)]
Rollup merge of #97927 - cjgillot:issue-97836, r=petrochenkov

Do not introduce bindings for types and consts in HRTB.

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

r? `@petrochenkov`

2 years agoRollup merge of #97922 - paolobarbolini:no-vecdeque-extra-reserve, r=the8472
Yuki Okushi [Fri, 10 Jun 2022 08:22:31 +0000 (17:22 +0900)]
Rollup merge of #97922 - paolobarbolini:no-vecdeque-extra-reserve, r=the8472

Remove redundant calls to reserve in impl Write for VecDeque

Removes the reserve calls made redundant by #95904 (as discussed in https://github.com/rust-lang/rust/pull/95632#discussion_r846850293)

2 years agoRollup merge of #97888 - hoodmane:emscripten-eh-personality, r=Amanieu
Yuki Okushi [Fri, 10 Jun 2022 08:22:30 +0000 (17:22 +0900)]
Rollup merge of #97888 - hoodmane:emscripten-eh-personality, r=Amanieu

Don't use __gxx_personality_v0 in panic_unwind on emscripten target

This resolves #85821. See also the discussion here:
https://github.com/emscripten-core/emscripten/issues/17128

The consensus seems to be that rust_eh_personality is never invoked.
I patched __gxx_personality_v0 to log invocations and then ran
various panic tests and it was never called, so this analysis matches
what seems to happen in practice. This replaces the definition with
an abort, modeled on the structured exception handling implementation.

2 years agoRollup merge of #97876 - yoshuawuyts:into-future-docs, r=JohnTitor,yaahc
Yuki Okushi [Fri, 10 Jun 2022 08:22:29 +0000 (17:22 +0900)]
Rollup merge of #97876 - yoshuawuyts:into-future-docs, r=JohnTitor,yaahc

update docs for `std::future::IntoFuture`

Ref https://github.com/rust-lang/rust/issues/67644.

This updates the docs for `IntoFuture` providing a bit more guidance on how to use it. Thanks!

2 years agoRollup merge of #97718 - xFrednet:95540-delayed-good-path-ice-for-expect, r=wesleywiser
Yuki Okushi [Fri, 10 Jun 2022 08:22:28 +0000 (17:22 +0900)]
Rollup merge of #97718 - xFrednet:95540-delayed-good-path-ice-for-expect, r=wesleywiser

Fix `delayed_good_path_bug` ice for expected diagnostics (RFC 2383)

Fixes a small ICE with the `delayed_good_path_bug` check.

---

r? ``@wesleywiser``

cc: ``@eddyb`` this might be interesting, since you've added a `FIXME` comment above the modified check which kind of discusses a case like this

closes: https://github.com/rust-lang/rust/issues/95540

cc: https://github.com/rust-lang/rust/issues/85549

2 years agoeagerly check whether we replace any bound vars
lcnr [Wed, 8 Jun 2022 16:45:49 +0000 (18:45 +0200)]
eagerly check whether we replace any bound vars

2 years agoupdate higher_ranked_sub docs
lcnr [Thu, 2 Jun 2022 11:37:09 +0000 (13:37 +0200)]
update higher_ranked_sub docs

2 years agodon't always cache bound lts
lcnr [Thu, 2 Jun 2022 11:31:04 +0000 (13:31 +0200)]
don't always cache bound lts

2 years agobound_vars -> infer: don't return lt map
lcnr [Thu, 2 Jun 2022 10:48:56 +0000 (12:48 +0200)]
bound_vars -> infer: don't return lt map

2 years agoreplace bound vars: make caching explicit
lcnr [Thu, 2 Jun 2022 10:42:57 +0000 (12:42 +0200)]
replace bound vars: make caching explicit

2 years agoonly expect lb lt for fn calls in mir typeck
lcnr [Thu, 2 Jun 2022 10:12:24 +0000 (12:12 +0200)]
only expect lb lt for fn calls in mir typeck

2 years ago`BoundVarReplacer` remove `Option`
lcnr [Thu, 2 Jun 2022 10:02:30 +0000 (12:02 +0200)]
`BoundVarReplacer` remove `Option`

2 years agoAuto merge of #95818 - petrochenkov:stabundle, r=wesleywiser
bors [Fri, 10 Jun 2022 06:25:02 +0000 (06:25 +0000)]
Auto merge of #95818 - petrochenkov:stabundle, r=wesleywiser

Stabilize the `bundle` native library modifier

And remove the legacy `static-nobundle` linking kind.

Stabilization report - https://github.com/rust-lang/rust/pull/95818#issuecomment-1120470945.

cc #81490
Closes #37403

2 years agofix a typo
Takayuki Maeda [Fri, 10 Jun 2022 04:44:21 +0000 (13:44 +0900)]
fix a typo

2 years agoAuto merge of #95770 - nrc:read-buf-builder, r=joshtriplett
bors [Fri, 10 Jun 2022 03:55:16 +0000 (03:55 +0000)]
Auto merge of #95770 - nrc:read-buf-builder, r=joshtriplett

std::io: Modify some ReadBuf method signatures to return `&mut Self`

This allows using `ReadBuf` in a builder-like style and to setup a `ReadBuf` and
pass it to `read_buf` in a single expression, e.g.,

```
// With this PR:
reader.read_buf(ReadBuf::uninit(buf).assume_init(init_len))?;

// Previously:
let mut buf = ReadBuf::uninit(buf);
buf.assume_init(init_len);
reader.read_buf(&mut buf)?;
```

r? `@sfackler`

cc https://github.com/rust-lang/rust/issues/78485, https://github.com/rust-lang/rust/issues/94741

2 years agoRevert dc08bc51f2c58a0f5f815a07f9bb3d671153b5a1.
Nicholas Nethercote [Fri, 10 Jun 2022 01:58:29 +0000 (11:58 +1000)]
Revert dc08bc51f2c58a0f5f815a07f9bb3d671153b5a1.

2 years agoAuto merge of #91970 - nrc:provide-any, r=scottmcm
bors [Fri, 10 Jun 2022 01:10:59 +0000 (01:10 +0000)]
Auto merge of #91970 - nrc:provide-any, r=scottmcm

Add the Provider api to core::any

This is an implementation of [RFC 3192](https://github.com/rust-lang/rfcs/pull/3192) ~~(which is yet to be merged, thus why this is a draft PR)~~. It adds an API for type-driven requests and provision of data from trait objects. A primary use case is for the `Error` trait, though that is not implemented in this PR. The only major difference to the RFC is that the functionality is added to the `any` module, rather than being in a sibling `provide_any` module (as discussed in the RFC thread).

~~Still todo: improve documentation on items, including adding examples.~~

cc `@yaahc`

2 years agouse fcntl fallback for additional poll-specific errors
The 8472 [Tue, 7 Jun 2022 19:30:07 +0000 (21:30 +0200)]
use fcntl fallback for additional poll-specific errors

2 years agoRevert b983e42936feab29f6333e9835913afc6b4a394e.
Nicholas Nethercote [Thu, 9 Jun 2022 22:35:03 +0000 (08:35 +1000)]
Revert b983e42936feab29f6333e9835913afc6b4a394e.

2 years agoTest that the unused_macros lint works correctly if rules are malformed
est31 [Thu, 9 Jun 2022 21:46:40 +0000 (23:46 +0200)]
Test that the unused_macros lint works correctly if rules are malformed

The unused_macro_rules lint had a bug where it would regard all rules of
a macro as unused if one rule were malformed. This bug doesn't exist
with the unused_macros lint. To ensure it doesn't appear in the future,
we add a test for it.

2 years agoSuppress the unused_macro_rules lint if malformed rules are encountered
est31 [Thu, 9 Jun 2022 21:34:06 +0000 (23:34 +0200)]
Suppress the unused_macro_rules lint if malformed rules are encountered

Prior to this commit, if a macro had any malformed rules, all rules would
be reported as unused, regardless of whether they were used or not.
So we just turn off unused rule checking completely for macros with
malformed rules.

2 years agoNever regard macro rules with compile_error! invocations as unused
est31 [Thu, 9 Jun 2022 02:46:51 +0000 (04:46 +0200)]
Never regard macro rules with compile_error! invocations as unused

The very point of compile_error! is to never be reached, and one of
the use cases of the macro, currently also listed as examples in the
documentation of compile_error, is to create nicer errors for wrong
macro invocations. Thus, we shuuld never warn about unused macro arms
that contain invocations of compile_error.

2 years agoClean up
Hood Chatham [Thu, 9 Jun 2022 21:07:08 +0000 (14:07 -0700)]
Clean up

2 years agoRemove ERROR_ON_UNDEFINED_SYMBOLS according to sbc100's comments
Hood Chatham [Thu, 9 Jun 2022 20:37:38 +0000 (13:37 -0700)]
Remove ERROR_ON_UNDEFINED_SYMBOLS according to sbc100's comments

2 years agoRemove -sASSERTIONS=1 from wasm32_unknown_emscripten default link args
Hood Chatham [Thu, 9 Jun 2022 19:52:03 +0000 (12:52 -0700)]
Remove -sASSERTIONS=1 from wasm32_unknown_emscripten default link args

This is a debug setting. We should only make debug builds if user requests
a debug build. Currently this is inserted in release builds.

Furthermore, it would be better to insert these settings in --pre-link-args
because then it would be possible to override them if appropriate. Because
these are inserted at the end, it is necessary to patch emscripten to remove
them.

2 years agoDo not introduce bindings for types and consts in HRTB.
Camille GILLOT [Thu, 9 Jun 2022 19:30:18 +0000 (21:30 +0200)]
Do not introduce bindings for types and consts in HRTB.

2 years agoStabilize the `bundle` native library modifier
Vadim Petrochenkov [Fri, 8 Apr 2022 15:20:57 +0000 (18:20 +0300)]
Stabilize the `bundle` native library modifier

2 years agoAuto merge of #97911 - dtolnay:numcpu, r=Mark-Simulacrum
bors [Thu, 9 Jun 2022 18:20:08 +0000 (18:20 +0000)]
Auto merge of #97911 - dtolnay:numcpu, r=Mark-Simulacrum

Revert "remove num_cpus dependency" in rustc and update cargo

Fixes #97549. This PR reverts #94524 and does a Cargo update to pull in rust-lang/cargo#10737.

Rust 1.61.0 has a regression in which it misidentifies the number of available CPUs in some environments, leading to enormously increased memory usage and failing builds. In between Rust 1.60 and 1.61 both rustc and cargo replaced some uses of `num_cpus` with `available_parallelism`, which eliminated support for cgroupv1, still apparently in common use. This PR switches both rustc and cargo back to using `num_cpus` in order to support environments where the available parallelism is controlled by cgroupv1. Both can use `available_parallism` again once it handles cgroupv1 (if ever).

I have confirmed that the rustc part of this PR fixes the memory usage regression in my non-Cargo environment, and others have confirmed in #97549 that the Cargo regression was at fault for the memory usage regression in their environments.

2 years agorefactor write_output_file to merge two invocation paths into one.
Felix S. Klock II [Wed, 26 Jan 2022 15:26:43 +0000 (10:26 -0500)]
refactor write_output_file to merge two invocation paths into one.

2 years agoRemove redundant calls to reserve in impl Write for VecDeque
Paolo Barbolini [Thu, 9 Jun 2022 17:10:09 +0000 (19:10 +0200)]
Remove redundant calls to reserve in impl Write for VecDeque

2 years agoAdd underscores to rust_eh_personality arguments to mark them as unused
Hood Chatham [Thu, 9 Jun 2022 16:50:26 +0000 (09:50 -0700)]
Add underscores to rust_eh_personality arguments to mark them as unused

2 years agoAuto merge of #97916 - RalfJung:miri, r=RalfJung
bors [Thu, 9 Jun 2022 15:39:12 +0000 (15:39 +0000)]
Auto merge of #97916 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/97886
Cc `@rust-lang/miri` r? `@ghost`

2 years agoupdate Miri
Ralf Jung [Thu, 9 Jun 2022 13:16:59 +0000 (09:16 -0400)]
update Miri

2 years agoAuto merge of #97910 - JohnTitor:rollup-gu3k0xl, r=JohnTitor
bors [Thu, 9 Jun 2022 12:58:25 +0000 (12:58 +0000)]
Auto merge of #97910 - JohnTitor:rollup-gu3k0xl, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #95632 (impl Read and Write for VecDeque<u8>)
 - #95860 (Stabilize `$$` in Rust 1.63.0)
 - #97838 (hexagon: adapt test for upstream output changes)
 - #97843 (Relax mipsel-sony-psp's linker script)
 - #97874 (rewrite combine doc comment)

Failed merges:

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

2 years agoRegenerate lockfile to include cargo's dependency on num_cpus
David Tolnay [Thu, 9 Jun 2022 10:52:43 +0000 (03:52 -0700)]
Regenerate lockfile to include cargo's dependency on num_cpus

2 years agoRollup merge of #97874 - lcnr:combine-comment, r=davidtwco
Yuki Okushi [Thu, 9 Jun 2022 10:19:57 +0000 (19:19 +0900)]
Rollup merge of #97874 - lcnr:combine-comment, r=davidtwco

rewrite combine doc comment

it was from 2014 and somewhat outdated

2 years agoRollup merge of #97843 - overdrivenpotato:psp-lto, r=michaelwoerister
Yuki Okushi [Thu, 9 Jun 2022 10:19:56 +0000 (19:19 +0900)]
Rollup merge of #97843 - overdrivenpotato:psp-lto, r=michaelwoerister

Relax mipsel-sony-psp's linker script

Previously, the linker script forcefully kept all `.lib.stub` sections, unnecessarily bloating the binary. Now, the script is LTO and `--gc-sections` friendly.

`--nmagic` was also added to the linker, because page alignment is not required on the PSP. This further reduces binary size.

Accompanying changes for the `psp` crate are found in: https://github.com/overdrivenpotato/rust-psp/pull/118

2 years agoRollup merge of #97838 - durin42:llvm-15-hexagon, r=Amanieu
Yuki Okushi [Thu, 9 Jun 2022 10:19:55 +0000 (19:19 +0900)]
Rollup merge of #97838 - durin42:llvm-15-hexagon, r=Amanieu

hexagon: adapt test for upstream output changes

The output of IR formatting changed slightly in upstream rev
a0bc67e555f404d0e7ddb2e78cb891d96eaf913d
(https://reviews.llvm.org/D123096). I'm not actually sure what any of
that means, as I don't even know what hexagon is in this context, but
this change allows the test to pass on both old and new LLVMs.

r? ``@nikic``

2 years agoRollup merge of #95860 - c410-f3r:stabilize-meta, r=joshtriplett
Yuki Okushi [Thu, 9 Jun 2022 10:19:55 +0000 (19:19 +0900)]
Rollup merge of #95860 - c410-f3r:stabilize-meta, r=joshtriplett

Stabilize `$$` in Rust 1.63.0

# Stabilization proposal

This PR proposes the stabilization of a subset of `#![feature(macro_metavar_expr)]` or more specifically, the stabilization of dollar-dollar (`$$`).

Tracking issue: #83527
Version: 1.63 (2022-06-28 => beta, 2022-08-11 => stable).

## What is stabilized

```rust
macro_rules! foo {
    () => {
        macro_rules! bar {
            ( $$( $$any:tt )* ) => { $$( $$any )* };
        }
    };
}

fn main() {
    foo!();
}
```

## Motivation

For more examples, see the [RFC](https://github.com/markbt/rfcs/blob/macro_metavar_expr/text/0000-macro-metavar-expr.md).

Users must currently resort to a tricky and not so well-known hack to declare nested macros with repetitions.

```rust
macro_rules! foo {
    ($dollar:tt) => {
        macro_rules! bar {
            ( $dollar ( $any:tt )* ) => { $dollar ( $any )* };
        }
    };
}
fn main() {
    foo!($);
}
```

As seen above, such hack is fragile and makes work with declarative macros much more unpleasant. Dollar-dollar (`$$`), on the other hand, makes nested macros more intuitive.

## What isn't stabilized

`count`, `ignore`, `index` and `length` are not being stabilized due to the lack of consensus.

## History

* 2021-02-22, [RFC: Declarative macro metavariable expressions](https://github.com/rust-lang/rfcs/pull/3086)
* 2021-03-26, [Tracking Issue for RFC 3086: macro metavariable expressions](https://github.com/rust-lang/rust/issues/83527)
* 2022-02-01, [Implement macro meta-variable expressions](https://github.com/rust-lang/rust/pull/93545)
* 2022-02-25, [[1/2] Implement macro meta-variable expressions](https://github.com/rust-lang/rust/pull/94368)
* 2022-03-11, [[2/2] Implement macro meta-variable expressions](https://github.com/rust-lang/rust/pull/94833)
* 2022-03-12, [Fix remaining meta-variable expression TODOs](https://github.com/rust-lang/rust/pull/94884)
* 2019-03-21, [[macro-metavar-expr] Fix generated tokens hygiene](https://github.com/rust-lang/rust/pull/95188)
* 2022-04-07, [Kickstart the inner usage of macro_metavar_expr](https://github.com/rust-lang/rust/pull/95761)
* 2022-04-07, [[macro_metavar_expr] Add tests to ensure the feature requirement](https://github.com/rust-lang/rust/pull/95764)

## Non-stabilized expressions

https://github.com/rust-lang/rust/issues/83527 lists several concerns about some characteristics of `count`, `index` and `length` that effectively make their stabilization unfeasible. `$$` and `ignore`, however, are not part of any discussion and thus are suitable for stabilization.

It is not in the scope of this PR to detail each concern or suggest any possible converging solution. Such thing should be restrained in this tracking issue.

## Tests

This list is a subset of https://github.com/rust-lang/rust/tree/master/src/test/ui/macros/rfc-3086-metavar-expr

* [Ensures that nested macros have correct behavior](https://github.com/rust-lang/rust/blob/master/src/test/ui/macros/rfc-3086-metavar-expr/dollar-dollar-has-correct-behavior.rs)

* [Compares produced tokens to assert expected outputs](https://github.com/rust-lang/rust/blob/master/src/test/ui/macros/rfc-3086-metavar-expr/feature-gate-macro_metavar_expr.rs)

* [Checks the declarations of the feature](https://github.com/rust-lang/rust/blob/master/src/test/ui/macros/rfc-3086-metavar-expr/required-feature.rs)

* [Verifies all possible errors that can occur due to incorrect user input](https://github.com/rust-lang/rust/blob/master/src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs)

## Possible future work

Once consensus is achieved, other nightly expressions can be stabilized.

Thanks ``@markbt`` for creating the RFC and thanks to ``@petrochenkov`` and ``@mark-i-m`` for reviewing the implementations.

2 years agoRollup merge of #95632 - evanrichter:master, r=joshtriplett
Yuki Okushi [Thu, 9 Jun 2022 10:19:54 +0000 (19:19 +0900)]
Rollup merge of #95632 - evanrichter:master, r=joshtriplett

impl Read and Write for VecDeque<u8>

Implementing `Read` and `Write` for `VecDeque<u8>` fills in the VecDeque api surface where `Vec<u8>` and `Cursor<Vec<u8>>` already impl Read and Write. Not only for completeness, but VecDeque in particular is a very handy mock interface for a TCP echo service, if only it supported Read/Write.

Since this PR is just an impl trait, I don't think there is a way to limit it behind a feature flag, so it's "insta-stable". Please correct me if I'm wrong here, not trying to rush stability.

2 years agoAuto merge of #97868 - ssomers:btree_from_sorted_iter, r=the8472
bors [Thu, 9 Jun 2022 10:17:04 +0000 (10:17 +0000)]
Auto merge of #97868 - ssomers:btree_from_sorted_iter, r=the8472

BTreeSet: avoid intermediate sorting when collecting sorted iterators

As [pointed out by droundy](https://users.rust-lang.org/t/question-about-btreeset-implementation/76427), an obvious optimization is to skip the first step introduced by #88448 (creation of a vector and sorting) and it's easy to do so for btree's own iterators. Also, exploit `from` in the examples.

2 years agoRevert "Remove num_cpus dependency from bootstrap, build-manifest and rustc_session"
David Tolnay [Thu, 9 Jun 2022 10:10:15 +0000 (03:10 -0700)]
Revert "Remove num_cpus dependency from bootstrap, build-manifest and rustc_session"

This reverts commit 2d854f9c340df887e30896f49270ae81feb3e227.

2 years agoUpdate cargo
David Tolnay [Thu, 9 Jun 2022 10:07:19 +0000 (03:07 -0700)]
Update cargo

1 commit in 85e457e158db216a2938d51bc3b617a5a7fe6015..4d92f07f34ba7fb7d7f207564942508f46c225d3
2022-06-07 21:57:52 +0000 to 2022-06-09 01:18:36 +0000
- Revert 10427: switch from num_cpus

2 years agomove suggestions to its own method
Takayuki Maeda [Thu, 9 Jun 2022 08:52:10 +0000 (17:52 +0900)]
move suggestions to its own method

2 years agorewrite combine doc comment
lcnr [Wed, 8 Jun 2022 11:58:28 +0000 (13:58 +0200)]
rewrite combine doc comment

2 years agoAuto merge of #97862 - SparrowLii:superset, r=lcnr
bors [Thu, 9 Jun 2022 07:13:46 +0000 (07:13 +0000)]
Auto merge of #97862 - SparrowLii:superset, r=lcnr

optimize `superset` method of `IntervalSet`

Given that intervals in the `IntervalSet` are sorted and strictly separated( it means the `end` of the previous interval will not be equal to the `start` of the next interval), we can reduce the complexity of the `superset` method from O(NMlogN) to O(2N) (N is the number of intervals and M is the length of each interval)

2 years agoAuto merge of #97772 - GuillaumeGomez:minifier-update, r=notriddle
bors [Thu, 9 Jun 2022 04:33:01 +0000 (04:33 +0000)]
Auto merge of #97772 - GuillaumeGomez:minifier-update, r=notriddle

Update minifier version to 0.2.1

This change and these changes come from an idea of `@camelid:` instead of creating a string, we just `write` the type into the file directly.

I don't think it'll have a big impact on perf but it's still a potential small improvement.

r? `@notriddle`

2 years agoAuto merge of #97740 - RalfJung:ctfe-cycle-spans, r=lcnr
bors [Thu, 9 Jun 2022 01:52:15 +0000 (01:52 +0000)]
Auto merge of #97740 - RalfJung:ctfe-cycle-spans, r=lcnr

use precise spans for recursive const evaluation

This fixes https://github.com/rust-lang/rust/issues/73283 by using a `TyCtxtAt` with a more precise span when the interpreter recursively calls itself. Hopefully such calls are sufficiently rare that this does not cost us too much performance.

(In theory, cycles can also arise through layout computation, as layout can depend on consts -- but layout computation happens all the time so we'd have to do something to not make this terrible for performance.)

2 years agoRemove __gxx_personality_v0 declaration
Hood Chatham [Wed, 8 Jun 2022 23:31:21 +0000 (16:31 -0700)]
Remove __gxx_personality_v0 declaration

2 years agoAuto merge of #97896 - compiler-errors:rollup-mrl7ng0, r=compiler-errors
bors [Wed, 8 Jun 2022 23:07:22 +0000 (23:07 +0000)]
Auto merge of #97896 - compiler-errors:rollup-mrl7ng0, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #97557 (Fix indices and remove some unwraps in arg mismatch algorithm)
 - #97830 (Add std::alloc::set_alloc_error_hook example)
 - #97856 (Don't suggest adding `let` in certain `if` conditions)
 - #97857 (Suggest escaping `box` as identifier)
 - #97871 (Suggest using `iter()` or `into_iter()` for `Vec`)
 - #97882 (Add regresion test for #67498)
 - #97883 (Remove `ignore-compare-mode-nll` annotations from tests)
 - #97891 (Update books)
 - #97894 (Fix polonius compare mode.)

Failed merges:

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

2 years agoRollup merge of #97894 - ehuss:fix-polonius-compare-mode, r=jackh726
Michael Goulet [Wed, 8 Jun 2022 20:32:26 +0000 (13:32 -0700)]
Rollup merge of #97894 - ehuss:fix-polonius-compare-mode, r=jackh726

Fix polonius compare mode.

This fixes running compiler tests in `--compare-mode=polonius`. The `-Zborrowck=mir` option was removed in #95565.

r? `@jackh726`

2 years agoRollup merge of #97891 - ehuss:update-books, r=ehuss
Michael Goulet [Wed, 8 Jun 2022 20:32:25 +0000 (13:32 -0700)]
Rollup merge of #97891 - ehuss:update-books, r=ehuss

Update books

## nomicon

5 commits in 10d40c59a581c66d8ecd29ad18d410bf97ed524d..3a43983b76174342b7dbd3e12ea2c49f762e52be
2022-05-07 10:45:07 +0900 to 2022-05-30 17:01:30 +0900
- Changes for `c_unwind` (rust-lang/nomicon#365)
- Upgrade actions/checkout to v3 (rust-lang/nomicon#367)
- Clarification of borrowck (rust-lang/nomicon#354)
- Update the now stale warning about `PhantomData&lt;T&gt;` and dropck (rust-lang/nomicon#363)
- Minor language fixes (rust-lang/nomicon#364)

## reference

1 commits in b74825d8f88b685e239ade00f00de68ba4cd63d4..683bfe5cd64d589c6a1645312ab5f93b6385ccbb
2022-05-20 14:30:30 -0700 to 2022-05-27 11:54:20 -0700
- Reflect changes about unsizing casts in const context (rust-lang/reference#1221)

## book

58 commits in b4dd5f00b87190ad5ef42cbc2a88a783c6ae57ef..396fdb69de7fb18f24b15c7ad13491b1c1fa7231
2022-05-24 21:37:06 -0400 to 2022-06-08 10:02:35 -0400
- Make not-equals operator example consistent. Fixes rust-lang/book#3189.
- Propagate nostarch appendix edits to src
- Edits to edits to appendices
- Edits from nostarch for the appendices
- Propagate edits to chapter 20 to src
- Edits to edits of chapter 20
- Update reference to chapter 12 code that was changed
- Edits from nostarch to chapter 20
- Fix spelling mistake
- Propagate ch17 tech review changes to src
- Responses to tech review for ch17
- Chapter 17 tech review comments
- Update dependencies via `cargo update`
- Propagate changes from ch16 tech review to src
- Tech review comments and responses for chapter 16
- Println captures in chapter 15
- Propagate chapter 15 tech review edits to src
- Responses to tech review for chapter 15
- Tech review comments for chapter 15
- Merge branch 'ch14-tr'
- Upgrade to Rust 1.61
- Upgrade to Rust 1.60
- More little improvements to chapter 12
- Update references to ch12 to be Config::build instead of new
- Propagate ch12 tech review edits to src
- Responses to tech review of chapter 12
- Tech review comments of chapter 12
- Show directory layouts including integration test files
- Clarify that integration/doc tests aren't run if unit tests fail
- Propagate ch11 tech review edits to src
- Edits in response to tech review of chapter 11
- Comments from tech review in chapter 11
- Propagate other edits to nostarch
- Adjust listing so error output line numbers match
- Merge remote-tracking branch 'origin/pr/3153' into ch10-tr
- Reword a rewording about lifetimes of values vs references
- Merge remote-tracking branch 'origin/pr/3107' into ch10-tr
- Merge remote-tracking branch 'origin/pr/3104' into ch10-tr
- Propagate ch10 edits to src
- Edits in response to tech review
- Comments from tech review for chapter 10
- New dictionary entries
- Demonstrate a better expect message. Fixes rust-lang/book#2918.
- Propagate tech review ch9 edits to src
- Termination has stabilized! Fixes rust-lang/book#3116.
- Respond to tech review comments to chapter 9
- Comments from tech review on chapter 9
- Propagate changes for ch8 to src
- Clarify that split_whitespace returns an iterator
- Add type annotation in nostarch snapshot too
- Extra-clarity qualification
- Edits to chapter 8 in response to tech review
- Comments from tech review for chapter 8
- Propagate tech review edits to ch06 src
- Responses to tech review comments on chapter 6
- Chapter 6 after tech review
- Snapshot of chapter 1 for nostarch
- src: use TLSv1.3 if we're going to specify at all

## rust-by-example

4 commits in 2ed26865e8c29ef939dc913a97bd321cadd72a9a..dbb7e5e2345ee26199ffba218156b6009016a20c
2022-05-18 17:23:47 -0300 to 2022-06-02 16:30:51 -0300
- Fix typo in Traits → "impl Trait" (rust-lang/rust-by-example#1544)
- doc_testing.md: clarify tests vs doc-tests (rust-lang/rust-by-example#1547)
- unsafe::asm.md: add some explicit declarations (rust-lang/rust-by-example#1548)
- Update dsl.md to remove unnecessary braces (rust-lang/rust-by-example#1543)

## rustc-dev-guide

6 commits in 554c00e4805df7f7bffac7db408437d62d6dfb9a..6e4d6435db89bcc027b1bba9742e4f59666f5412
2022-05-24 17:15:35 -0700 to 2022-06-08 08:06:32 +0900
- Make build scripts and proc macros work with the suggested rust-analyzer config (rust-lang/rustc-dev-guide#1365)
- improve rustc_interface examples a little (rust-lang/rustc-dev-guide#1362)
- Bump regex from 1.4.3 to 1.5.5 in /ci/date-check (rust-lang/rustc-dev-guide#1364)
- Clarify cargo fallback behavior for rustup link (rust-lang/rustc-dev-guide#1273)
- Update rustc-driver related examples
- Triage some date references related to traits

## embedded-book

1 commits in f7cefbb995eec8c6148f213235e9e2e03268e775..cbb494f96da3268c2925bdadc65ca83d42f2d4ef
2022-04-20 10:38:51 +0000 to 2022-05-26 06:58:43 +0000
- Add Chinese translation repository  (rust-embedded/book#318)

2 years agoRollup merge of #97883 - JohnTitor:no-more-compare-mode-nll, r=jackh726
Michael Goulet [Wed, 8 Jun 2022 20:32:24 +0000 (13:32 -0700)]
Rollup merge of #97883 - JohnTitor:no-more-compare-mode-nll, r=jackh726

Remove `ignore-compare-mode-nll` annotations from tests

Since #95565 these do nothing as compare-mode-nll has been removed.
r? `@jackh726`

2 years agoRollup merge of #97882 - JohnTitor:issue-67498, r=compiler-errors
Michael Goulet [Wed, 8 Jun 2022 20:32:23 +0000 (13:32 -0700)]
Rollup merge of #97882 - JohnTitor:issue-67498, r=compiler-errors

Add regresion test for #67498

Closes #67498
r? `@compiler-errors`

2 years agoRollup merge of #97871 - ChayimFriedman2:vec-iterator-unimplemented, r=compiler-errors
Michael Goulet [Wed, 8 Jun 2022 20:32:22 +0000 (13:32 -0700)]
Rollup merge of #97871 - ChayimFriedman2:vec-iterator-unimplemented, r=compiler-errors

Suggest using `iter()` or `into_iter()` for `Vec`

We cannot do that for `&Vec` because `#[rustc_on_unimplemented]` is limited (it does not clean generic instantiation for references, only for ADTs).

`@rustbot` label +A-diagnostics

2 years agoRollup merge of #97857 - ChayimFriedman2:box-identifier-help, r=compiler-errors
Michael Goulet [Wed, 8 Jun 2022 20:32:21 +0000 (13:32 -0700)]
Rollup merge of #97857 - ChayimFriedman2:box-identifier-help, r=compiler-errors

Suggest escaping `box` as identifier

Fixes #97810.

2 years agoRollup merge of #97856 - compiler-errors:bad-let-suggestions, r=estebank
Michael Goulet [Wed, 8 Jun 2022 20:32:20 +0000 (13:32 -0700)]
Rollup merge of #97856 - compiler-errors:bad-let-suggestions, r=estebank

Don't suggest adding `let` in certain `if` conditions

Avoid being too eager to suggest `let` in an `if` condition with an `=`, namely when the LHS of the `=` isn't even valid as a pattern (to a first degree approximation).

This heustic I came up with kinda sucks. Let me know if it needs to be refined.

2 years agoRollup merge of #97830 - LucasDumont:add-example-alloc, r=yaahc
Michael Goulet [Wed, 8 Jun 2022 20:32:19 +0000 (13:32 -0700)]
Rollup merge of #97830 - LucasDumont:add-example-alloc, r=yaahc

Add std::alloc::set_alloc_error_hook example

2 years agoRollup merge of #97557 - compiler-errors:arg-mismatch-mini, r=jackh726
Michael Goulet [Wed, 8 Jun 2022 20:32:18 +0000 (13:32 -0700)]
Rollup merge of #97557 - compiler-errors:arg-mismatch-mini, r=jackh726

Fix indices and remove some unwraps in arg mismatch algorithm

This is a more conservative fix than #97542, addressing some indices which were used incorectly and unwraps which are bound to panic (e.g. when the provided and expected arg counts differ). Beta nominating this as it's quite easy to cause ICEs -- I wrote a fuzzer and found hundreds of examples of ICEs.

cc `@jackh726` as author of #92364, and `@estebank` as reviewer of that PR.
fixes #97484
r? `@jackh726` this should be _much_ easier to review than the other PR :sweat_smile:

2 years agoAuto merge of #97893 - ehuss:update-cargo, r=ehuss
bors [Wed, 8 Jun 2022 20:26:34 +0000 (20:26 +0000)]
Auto merge of #97893 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in 38472bc19f2f76e245eba54a6e97ee6821b3c1db..85e457e158db216a2938d51bc3b617a5a7fe6015
2022-05-31 02:03:24 +0000 to 2022-06-07 21:57:52 +0000
- Make -Z http-registry use index.crates.io when accessing crates-io (rust-lang/cargo#10725)
- Respect submodule update=none strategy in .gitmodules (rust-lang/cargo#10717)
- Expose rust-version through env var (rust-lang/cargo#10713)
- add validation for string "true"/"false" in lto profile (rust-lang/cargo#10676)
- Enhance documentation of testing (rust-lang/cargo#10726)
- Clear disk space on CI. (rust-lang/cargo#10724)
- Enforce to use tar v0.4.38 (rust-lang/cargo#10720)

2 years agoFix polonius compare mode.
Eric Huss [Wed, 8 Jun 2022 18:53:16 +0000 (11:53 -0700)]
Fix polonius compare mode.

2 years agoUpdate cargo
Eric Huss [Wed, 8 Jun 2022 18:48:31 +0000 (11:48 -0700)]
Update cargo

2 years agoUpdate books
Eric Huss [Wed, 8 Jun 2022 18:19:53 +0000 (11:19 -0700)]
Update books

2 years agoAuto merge of #97887 - matthiaskrgr:rollup-ym5k7kb, r=matthiaskrgr
bors [Wed, 8 Jun 2022 17:57:59 +0000 (17:57 +0000)]
Auto merge of #97887 - matthiaskrgr:rollup-ym5k7kb, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #97507 (Move rustfmt downloads from bootstrap.py to rustbuild)
 - #97813 (Sync rustc_codegen_gcc)
 - #97878 (Add regression test for anonymous lifetimes)
 - #97879 (remove unneeded code)
 - #97880 (Fix typo: fo->for)

Failed merges:

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

2 years agoFix formatter
Hood Chatham [Wed, 8 Jun 2022 17:25:18 +0000 (10:25 -0700)]
Fix formatter

2 years agoDon't use __gxx_personality_v0 in panic_unwind on emscripten target
Hood Chatham [Wed, 8 Jun 2022 17:04:02 +0000 (10:04 -0700)]
Don't use __gxx_personality_v0 in panic_unwind on emscripten target

This resolves #85821. See also the discussion here:
https://github.com/emscripten-core/emscripten/issues/17128

The consensus seems to be that rust_eh_personality is never invoked.
I patched __gxx_personality_v0 to log invocations and then ran
various panic tests and it was never called, so this analysis matches
what seems to happen in practice. This replaces the definition with
an abort, modeled on the structured exception handling implementation.

2 years agoRollup merge of #97880 - ChayimFriedman2:patch-2, r=lcnr
Matthias Krüger [Wed, 8 Jun 2022 16:15:06 +0000 (18:15 +0200)]
Rollup merge of #97880 - ChayimFriedman2:patch-2, r=lcnr

Fix typo: fo->for

2 years agoRollup merge of #97879 - hermitcore:condvar, r=Dylan-DPC
Matthias Krüger [Wed, 8 Jun 2022 16:15:05 +0000 (18:15 +0200)]
Rollup merge of #97879 - hermitcore:condvar, r=Dylan-DPC

remove unneeded code

The init function isn't longer part of `Condvar`. Consequently, we removed the implementation for the target os `hermit`.