]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #89759 - jyn514:x-build-assemble, r=Mark-Simulacrum
Matthias Krüger [Wed, 13 Oct 2021 20:51:03 +0000 (22:51 +0200)]
Rollup merge of #89759 - jyn514:x-build-assemble, r=Mark-Simulacrum

Assemble the compiler when running `x.py build`

Previously, there was no way to actually get binaries in
`build/$TARGET/stage1/bin` without building the standard library. This
makes it possible to build just the compiler. This can be useful when
the standard library isn't actually necessary for trying out your tests
(e.g. a bug that can be reproduced with only a `no_core` crate).

Closes https://github.com/rust-lang/rust/issues/73519.

2 years agoRollup merge of #89757 - jyn514:submodule, r=Mark-Simulacrum
Matthias Krüger [Wed, 13 Oct 2021 20:51:02 +0000 (22:51 +0200)]
Rollup merge of #89757 - jyn514:submodule, r=Mark-Simulacrum

Use shallow clones for submodules

This reduces the amount of git history downloaded for submodules from ~67M to ~11M. For comparison, a shallow clone of rust-lang/rust is 103M and a deep clone is 740M, so this almost halves the amount of history necessary if you made a shallow clone to start, and it's a significant reduction even if not.

Closes https://github.com/rust-lang/rust/issues/63978. r? `@Mark-Simulacrum`

2 years agoRollup merge of #89670 - yoshuawuyts:available-parallelism-docs, r=joshtriplett
Matthias Krüger [Wed, 13 Oct 2021 20:51:01 +0000 (22:51 +0200)]
Rollup merge of #89670 - yoshuawuyts:available-parallelism-docs, r=joshtriplett

Improve `std::thread::available_parallelism` docs

_Tracking issue: https://github.com/rust-lang/rust/issues/74479_

This PR reworks the documentation of `std::thread::available_parallelism`, as requested [here](https://github.com/rust-lang/rust/pull/89324#issuecomment-934343254).

## Changes

The following changes are made:

- We've removed prior mentions of "hardware threads" and instead centers the docs around "parallelism" as a resource available to a program.
- We now provide examples of when `available_parallelism` may return numbers that differ from the number of CPU cores in the host machine.
- We now mention that the amount of available parallelism may change over time.
- We make note of which platform components we don't take into account which more advanced users may want to take note of.
- The example has been updated, which should be a bit easier to use.
- We've added a docs alias to `num-cpus` which provides similar functionality to `available_parallelism`, and is one of the most popular crates on crates.io.

---

Thanks!

r? `@BurntSushi`

2 years agoRollup merge of #89347 - TaKO8Ki:crate-or-module-typo, r=estebank
Matthias Krüger [Wed, 13 Oct 2021 20:51:00 +0000 (22:51 +0200)]
Rollup merge of #89347 - TaKO8Ki:crate-or-module-typo, r=estebank

suggestion for typoed crate or module

Previously, the compiler didn't suggest similarly named crates or modules. This pull request adds a suggestion for typoed crates or modules.

#76208

before:

```
error[E0433]: failed to resolve: use of undeclared type or module `chono`
 --> src/main.rs:2:5
  |
2 | use chono::prelude::*;
  |     ^^^^^ use of undeclared type or module `chono`
```

after:

```
error[E0433]: failed to resolve: use of undeclared type or module `chono`
 --> src/main.rs:2:5
  |
2 | use chono::prelude::*;
  |     ^^^^^
  |     |
  |     use of undeclared crate or module `chono`
  |     help: a similar crate or module exists: `chrono`
```

2 years agoAuto merge of #89822 - tmiasko:overflap-duplicates, r=cjgillot
bors [Wed, 13 Oct 2021 16:42:53 +0000 (16:42 +0000)]
Auto merge of #89822 - tmiasko:overflap-duplicates, r=cjgillot

Deduplicate regions ids before merging them

The merging code does not expect to see any duplicates.

Fixes #89820.

r? `@cjgillot`

2 years agoImprove `std::thread::available_parallelism` docs
Yoshua Wuyts [Fri, 8 Oct 2021 15:17:50 +0000 (17:17 +0200)]
Improve `std::thread::available_parallelism` docs

2 years agoAuto merge of #89847 - JohnTitor:rollup-xfymeo4, r=JohnTitor
bors [Wed, 13 Oct 2021 13:41:48 +0000 (13:41 +0000)]
Auto merge of #89847 - JohnTitor:rollup-xfymeo4, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #89768 (add some more testcases)
 - #89777 (Edit explanation of test for nested type ascriptions)
 - #89781 (Add missing words in `Infallible` docs)
 - #89782 (Improve CJK font in rustdoc)
 - #89794 (Add #[must_use] to to_value conversions)
 - #89814 (Fix uppercase/lowercase error)
 - #89816 (Fix invalid rules in .gitignore)
 - #89817 (Add #[inline] to int log10 functions.)
 - #89818 (Use Option::map_or instead of open coding it)
 - #89828 (Fix config.toml overflow-checks options)
 - #89840 (fix the stage0 tools config file path in `config.toml.example`)
 - #89845 (Add davidtwco to the `.mailmap`)

Failed merges:

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

2 years agoRollup merge of #89845 - davidtwco:davidtwco-mailmap, r=oli-obk
Yuki Okushi [Wed, 13 Oct 2021 12:55:19 +0000 (21:55 +0900)]
Rollup merge of #89845 - davidtwco:davidtwco-mailmap, r=oli-obk

Add davidtwco to the `.mailmap`

2 years agoRollup merge of #89840 - wangkirin:master, r=jyn514
Yuki Okushi [Wed, 13 Oct 2021 12:55:18 +0000 (21:55 +0900)]
Rollup merge of #89840 - wangkirin:master, r=jyn514

fix the stage0 tools config file path in `config.toml.example`

in  #88362  , the `stage0.txt ` have been switched to `stage0.json`  , but in `config.toml.example` the guide didn't change ,  this PR fix  this issue

2 years agoRollup merge of #89828 - rusticstuff:overflow-check-options-take-two, r=Mark-Simulacrum
Yuki Okushi [Wed, 13 Oct 2021 12:55:18 +0000 (21:55 +0900)]
Rollup merge of #89828 - rusticstuff:overflow-check-options-take-two, r=Mark-Simulacrum

Fix config.toml overflow-checks options

This a follow-up PR to #87784.

Improvements:
* Add missing entries for overflow-checks to config.toml.example.
* Add --enable-overflow-checks-std option to configure script.
* Make rust.overflow-checks-stdoption default to rust.overflow-checks.

Also adds the missing  `--enable-debug-assertions-std `option to configure script.

r? ```@Mark-Simulacrum```
cc ```@jyn514```

2 years agoRollup merge of #89818 - LingMan:map_or, r=oli-obk
Yuki Okushi [Wed, 13 Oct 2021 12:55:17 +0000 (21:55 +0900)]
Rollup merge of #89818 - LingMan:map_or, r=oli-obk

Use Option::map_or instead of open coding it

````@rustbot```` modify labels +C-cleanup +T-compiler

2 years agoRollup merge of #89817 - m-ou-se:int-log-10-inline, r=the8472
Yuki Okushi [Wed, 13 Oct 2021 12:55:16 +0000 (21:55 +0900)]
Rollup merge of #89817 - m-ou-se:int-log-10-inline, r=the8472

Add #[inline] to int log10 functions.

2 years agoRollup merge of #89816 - Canop:master, r=Mark-Simulacrum
Yuki Okushi [Wed, 13 Oct 2021 12:55:15 +0000 (21:55 +0900)]
Rollup merge of #89816 - Canop:master, r=Mark-Simulacrum

Fix invalid rules in .gitignore

`**node_modules` in a .gitignore is the same than
`*node_modules` or `*****node_modules`.

It matches every file whose name ends with `node_modules`,
including `not_node_modules`.

The intent here was obviously to have `**/node_modules`
which is the same than just `node_modules`.

Reference on git ignoring rules format: https://git-scm.com/docs/gitignore

2 years agoRollup merge of #89814 - jkugelman:must-use-string-transforms-typo, r=joshtriplett
Yuki Okushi [Wed, 13 Oct 2021 12:55:14 +0000 (21:55 +0900)]
Rollup merge of #89814 - jkugelman:must-use-string-transforms-typo, r=joshtriplett

Fix uppercase/lowercase error

Fix https://github.com/rust-lang/rust/pull/89694#discussion_r726829890

r? ````@joshtriplett````

2 years agoRollup merge of #89794 - jkugelman:must-use-to_value-conversions, r=joshtriplett
Yuki Okushi [Wed, 13 Oct 2021 12:55:13 +0000 (21:55 +0900)]
Rollup merge of #89794 - jkugelman:must-use-to_value-conversions, r=joshtriplett

Add #[must_use] to to_value conversions

`NonNull<T>::cast` snuck in when I wasn't looking. What a scamp!

Parent issue: #89692

r? ````@joshtriplett````

2 years agoRollup merge of #89782 - konan8205:develop, r=jsha
Yuki Okushi [Wed, 13 Oct 2021 12:55:12 +0000 (21:55 +0900)]
Rollup merge of #89782 - konan8205:develop, r=jsha

Improve CJK font in rustdoc

This PR includes:
- Fix unicode range of korean letters in `rustdoc.css`.
- Add WOFF2 format version of Noto Sans KR font.
- Shorten the font file name.

2 years agoRollup merge of #89781 - Wilfred:patch-2, r=JohnTitor
Yuki Okushi [Wed, 13 Oct 2021 12:55:11 +0000 (21:55 +0900)]
Rollup merge of #89781 - Wilfred:patch-2, r=JohnTitor

Add missing words in `Infallible` docs

This sentence was previously incomplete.

2 years agoRollup merge of #89777 - pierwill:fix-88233, r=Mark-Simulacrum
Yuki Okushi [Wed, 13 Oct 2021 12:55:10 +0000 (21:55 +0900)]
Rollup merge of #89777 - pierwill:fix-88233, r=Mark-Simulacrum

Edit explanation of test for nested type ascriptions

Fixes typo ("an ascribing") and removes extra.

Closes #88233.

2 years agoRollup merge of #89768 - hellow554:tests, r=Mark-Simulacrum
Yuki Okushi [Wed, 13 Oct 2021 12:55:10 +0000 (21:55 +0900)]
Rollup merge of #89768 - hellow554:tests, r=Mark-Simulacrum

add some more testcases

resolves #52893
resolves #68295
resolves #87750
resolves #88071

All these issues have been fixed according to glacier. Just adding a test so it can be closed.

Can anybody tell me why the github keywords do not work? 🤔
Please edit this post if you can fix it.

2 years agoAdd davidtwco to the `.mailmap`
David Wood [Wed, 13 Oct 2021 11:12:54 +0000 (11:12 +0000)]
Add davidtwco to the `.mailmap`

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoAuto merge of #89587 - camelid:all-candidates, r=petrochenkov
bors [Wed, 13 Oct 2021 10:38:12 +0000 (10:38 +0000)]
Auto merge of #89587 - camelid:all-candidates, r=petrochenkov

Include rmeta candidates in "multiple matching crates" error

Only dylib and rlib candidates were included in the error. I think the
reason is that at the time this error was originally implemented, rmeta
crate sources were represented different from dylib and rlib sources.
I wrote up more detailed analysis in [this comment][1].

The new version of the code is also a bit easier to read and should be
more robust to future changes since it uses `CrateSources::paths()`.

I also changed the code to sort the candidates to make the output deterministic;
added full stderr tests for the error; and added a long error code explanation.

[1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436

cc `@Mark-Simulacrum` `@jyn514`

2 years agofix the stage0 tools config file path in config.toml.example
Wang Qilin [Wed, 13 Oct 2021 07:47:15 +0000 (15:47 +0800)]
fix the stage0 tools config file path in config.toml.example

2 years agoAssemble the compiler when running `x.py build`
Joshua Nelson [Mon, 11 Oct 2021 04:09:15 +0000 (04:09 +0000)]
Assemble the compiler when running `x.py build`

Previously, there was no way to actually get binaries in
`build/$TARGET/stage1/bin` without building the standard library. This
makes it possible to build just the compiler. This can be useful when
the standard library isn't actually necessary for trying out your tests
(e.g. a bug that can be reproduced with only a `no_core` crate).

2 years agosuggestion for typoed crate or module
Takayuki Maeda [Wed, 29 Sep 2021 04:55:24 +0000 (13:55 +0900)]
suggestion for typoed crate or module

avoid suggesting the same name

sort candidates

fix a message

use `opt_def_id` instead of `def_id`

move `find_similarly_named_module_or_crate` to rustc_resolve/src/diagnostics.rs

2 years agoAuto merge of #89802 - ehuss:update-cargo, r=ehuss
bors [Wed, 13 Oct 2021 03:00:33 +0000 (03:00 +0000)]
Auto merge of #89802 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in d56b42c549dbb7e7d0f712c51b39400260d114d4..c7957a74bdcf3b11e7154c1a9401735f23ebd484
2021-09-27 13:44:18 +0000 to 2021-10-11 20:17:07 +0000
- Add some more information to verbose version. (rust-lang/cargo#9968)
- Skip all `cargo fix` that tends to write to registry cache. (rust-lang/cargo#9938)
- Stabilize named profiles (rust-lang/cargo#9943)
- Update git2 (rust-lang/cargo#9963)
- Distinguish lockfile version req from normal dep in resolver error message (rust-lang/cargo#9847)
- nit: Allocated slightly bigger vec than needed (rust-lang/cargo#9954)
- Add shell completion for shorthand commands (rust-lang/cargo#9951)

2 years agoDeduplicate regions ids before merging them
Tomasz Miąsko [Wed, 13 Oct 2021 00:00:00 +0000 (00:00 +0000)]
Deduplicate regions ids before merging them

The merging code does not expect to see any duplicates.

2 years agoAuto merge of #89774 - the8472:inline-mut-iter-next, r=m-ou-se
bors [Tue, 12 Oct 2021 23:59:48 +0000 (23:59 +0000)]
Auto merge of #89774 - the8472:inline-mut-iter-next, r=m-ou-se

inline next() on &mut Iterator impl

In [#87431](https://github.com/rust-lang/rust/pull/87431/files#diff-79a6b417b85ecf4f1a4ef2235135fedf540199caf6e9e1d154ac6a413b40a757R132-R136)   I found that `(&mut range).fold` doesn't optimize well because the default impl for for `fold` on `&mut Iterator` doesn't inline `next`. In that particular case it was worked around by using `try_fold` which takes a `&mut self` instead of `self`.

Let's see if this can be fixed more broadly.

2 years agoAuto merge of #89105 - DevinR528:reachable-fix, r=Nadrieril
bors [Tue, 12 Oct 2021 20:54:15 +0000 (20:54 +0000)]
Auto merge of #89105 - DevinR528:reachable-fix, r=Nadrieril

Fix: non_exhaustive_omitted_patterns by filtering unstable and doc hidden variants

Fixes: #89042
Now that #86809 has been merged there are cases (std::io::ErrorKind) where unstable feature gated variants were included in warning/error messages when the feature was not turned on. This filters those variants out of the return of `SplitWildcard::new`.

Variants marked `doc(hidden)` are filtered out of the witnesses list in `Usefulness::apply_constructor`.

Probably worth a perf run :shrug: since this area can be sensitive.

2 years agoWork around different filenames for DLLs
Noah Lev [Tue, 12 Oct 2021 20:30:15 +0000 (13:30 -0700)]
Work around different filenames for DLLs

2 years agoAdd long explanation for E0464
Noah Lev [Wed, 6 Oct 2021 20:01:43 +0000 (13:01 -0700)]
Add long explanation for E0464

The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and
its auxiliary tests. I added it to the `compile_fail` code example check
exemption list since it's hard if not impossible to reproduce this error
in a standalone code example.

2 years agoInclude rmeta candidates in "multiple matching crates" error
Noah Lev [Wed, 6 Oct 2021 02:43:44 +0000 (19:43 -0700)]
Include rmeta candidates in "multiple matching crates" error

Only dylib and rlib candidates were included in the error. I think the
reason is that at the time this error was originally implemented, rmeta
crate sources were represented different from dylib and rlib sources.
I wrote up more detailed analysis in [this comment][1].

The new version of the code is also a bit easier to read and should be
more robust to future changes since it uses `CrateSources::paths()`.

[1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436

2 years agoAdd test for showing rmeta candidates in error
Noah Lev [Wed, 6 Oct 2021 03:40:24 +0000 (20:40 -0700)]
Add test for showing rmeta candidates in error

2 years agoTest crate loading error stderr
Noah Lev [Wed, 6 Oct 2021 03:23:40 +0000 (20:23 -0700)]
Test crate loading error stderr

And remove E0464 from test-exemption list, since it now has a full test.

2 years agoSort candidate libraries by source path in error
Noah Lev [Wed, 6 Oct 2021 17:16:02 +0000 (10:16 -0700)]
Sort candidate libraries by source path in error

This makes the error output deterministic and thus testable.

2 years agoMake `rust.overflow-checks-std`option default to `rust.overflow-checks`.
Hans Kratz [Tue, 12 Oct 2021 19:28:49 +0000 (21:28 +0200)]
Make `rust.overflow-checks-std`option default to `rust.overflow-checks`.

2 years agoAdd --enable-debug-assertions-std option to configure script.
Hans Kratz [Tue, 12 Oct 2021 19:32:47 +0000 (21:32 +0200)]
Add --enable-debug-assertions-std option to configure script.

2 years agoAdd --enable-overflow-checks-std option to configure script.
Hans Kratz [Mon, 11 Oct 2021 21:05:26 +0000 (23:05 +0200)]
Add --enable-overflow-checks-std option to configure script.

2 years agoAdd missing entries for overflow-checks to config.toml.example.
Hans Kratz [Mon, 11 Oct 2021 17:54:27 +0000 (19:54 +0200)]
Add missing entries for overflow-checks to config.toml.example.

2 years agoAuto merge of #89813 - the8472:rollup-f1f99mb, r=the8472
bors [Tue, 12 Oct 2021 17:57:34 +0000 (17:57 +0000)]
Auto merge of #89813 - the8472:rollup-f1f99mb, r=the8472

Rollup of 7 pull requests

Successful merges:

 - #89778 (Add #[must_use] to as_type conversions)
 - #89784 (Remove built-in query cache_hit tracking)
 - #89796 (Add #[must_use] to non-mutating verb methods)
 - #89797 (Add #[must_use] to is_condition tests)
 - #89799 (fix minor spelling error in Poll::ready docs)
 - #89800 (Update books)
 - #89809 (Remap ssa RealPredicate to llvm RealPredicate)

Failed merges:

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

2 years agoUpdate winapi shared features.
Eric Huss [Tue, 12 Oct 2021 14:14:32 +0000 (07:14 -0700)]
Update winapi shared features.

Needed due to os_info.

2 years agoAdd #[inline] to int log10 functions.
Mara Bos [Tue, 12 Oct 2021 13:21:14 +0000 (15:21 +0200)]
Add #[inline] to int log10 functions.

2 years agoFix invalid rules in .gitignore
Canop [Tue, 12 Oct 2021 13:09:28 +0000 (15:09 +0200)]
Fix invalid rules in .gitignore

`**node_modules` in a .gitignore is the same than
`*node_modules` or `*****node_modules`.

It matches every file whose name ends with `node_modules`,
including `not_node_modules`.

The intent here was obviously to have `**/node_modules`
which is the same than just `node_modules`.

2 years agoFix uppercase/lowercase error
John Kugelman [Tue, 12 Oct 2021 12:53:54 +0000 (08:53 -0400)]
Fix uppercase/lowercase error

2 years agoRollup merge of #89809 - tmiasko:remap-real-predicate, r=michaelwoerister
the8472 [Tue, 12 Oct 2021 12:53:13 +0000 (14:53 +0200)]
Rollup merge of #89809 - tmiasko:remap-real-predicate, r=michaelwoerister

Remap ssa RealPredicate to llvm RealPredicate

to avoid relying on the discriminant of the former for FFI purposes

2 years agoRollup merge of #89800 - ehuss:update-books, r=ehuss
the8472 [Tue, 12 Oct 2021 12:53:12 +0000 (14:53 +0200)]
Rollup merge of #89800 - ehuss:update-books, r=ehuss

Update books

## nomicon

5 commits in 2747c4bb2cbc0639b733793ddb0bf4e9daa2634e..2d66852a27c5d0ec50ae021820d1de22caa2b1bd
2021-09-19 17:33:32 +0900 to 2021-10-07 19:00:37 +0900
- Fix typo/minor grammar error in subtyping.md (rust-lang/nomicon#317)
- doc: clarify `thread::scoped::JoinGuard` chapter (rust-lang/nomicon#313)
- Clarify niche optimization on enums with reprs (rust-lang/nomicon#315)
- Update rc decrement snipped (rust-lang/nomicon#316)
- Remove useless `unsafe`, `mut` and ptr casts in example in `send-and-sync.md` (rust-lang/nomicon#308)

## reference

2 commits in 13747275bd14c2d2b453100498532f9ae5504769..b5c68b02984f74e99d1f1b332029e05f607e2660
2021-09-24 17:44:04 +0900 to 2021-10-02 08:11:35 -0700
- Use subtrait/supertrait, not sub-trait, super-trait. (rust-lang/reference#1095)
- Fixed link typo in Generics.md (rust-lang/reference#1094)

## rust-by-example

3 commits in 28aca4a36962c709bce301c03114b5589381dfb8..9a60624fcad0140826c44389571dc622917cd632
2021-09-25 08:19:51 -0300 to 2021-10-04 08:13:53 -0300
- Change 1..n + 1 to 1..=n (rust-lang/rust-by-example#1467)
- Close rust-lang/rust-by-example#1464 (rust-lang/rust-by-example#1465)
- Fix incorrect formatted print hint; closes rust-lang/rust-by-example#1459. (rust-lang/rust-by-example#1466)

## rustc-dev-guide

11 commits in d1f03cbaa39d9164f5fe4b9b93762668142e0dad..fba15a46ca8efa97e8a955794724ac7ce27805b8
2021-09-24 12:00:29 +0900 to 2021-10-12 08:52:21 +0900
- Update some docs from 2021-10 date triage (rust-lang/rustc-dev-guide#1230)
- Recommend `rustfmt --edition=2021`
- Update sanitizer documentation
- Mention needs-sanitizer-hwaddress directive
- Address review comments
- Document tracing awesomeness
- Move log/tracing instructions to its own file
- Update src/closure.md
- Fix accidental HTML tag
- Update links to `rustc_mir` in Two Phase Borrows (rust-lang/rustc-dev-guide#1226)
- Update some docs from 2021-10 date triage (rust-lang/rustc-dev-guide#1224)

## edition-guide

1 commits in 2d9b1b9da706de24650fdc5c3b0182f55c82115d..7c0088ca744d293a5f4b1e2ac378e7c23d30fe55
2021-08-31 10:44:09 +0200 to 2021-10-05 13:28:05 +0200
- Clarify cargo resolver behavior in a workspace. (rust-lang/edition-guide#267)

## embedded-book

2 commits in 4c76da9ddb4650203c129fceffdea95a3466c205..270fccd339e5972d9c900e788f197e81a0bcd956
2021-09-12 12:43:03 +0000 to 2021-10-06 16:28:48 +0000
- Update section 1.4 to mention that some additional packages required  (rust-embedded/book#304)
- Change `-file-headers` to `--file-headers`  (rust-embedded/book#303)

2 years agoRollup merge of #89799 - ast-ral:ready-method-spellck, r=joshtriplett
the8472 [Tue, 12 Oct 2021 12:53:11 +0000 (14:53 +0200)]
Rollup merge of #89799 - ast-ral:ready-method-spellck, r=joshtriplett

fix minor spelling error in Poll::ready docs

Fixes minor spelling error in the proposed `Poll::ready` docs. Not that my opinion matters, but +1 on the original PR (#89651), it reads much nicer to me than the `ready!` macro.

2 years agoRollup merge of #89797 - jkugelman:must-use-is_condition-tests, r=joshtriplett
the8472 [Tue, 12 Oct 2021 12:53:11 +0000 (14:53 +0200)]
Rollup merge of #89797 - jkugelman:must-use-is_condition-tests, r=joshtriplett

Add #[must_use] to is_condition tests

I threw in `std::path::Path::has_root` for funsies.

A continuation of #89718.

Parent issue: #89692

r? ```@joshtriplett```

2 years agoRollup merge of #89796 - jkugelman:must-use-non-mutating-verb-methods, r=joshtriplett
the8472 [Tue, 12 Oct 2021 12:53:10 +0000 (14:53 +0200)]
Rollup merge of #89796 - jkugelman:must-use-non-mutating-verb-methods, r=joshtriplett

Add #[must_use] to non-mutating verb methods

These are methods that could be misconstrued to mutate their input, similar to #89694. I gave each one a different custom message.

I wrote that `upgrade` and `downgrade` don't modify the input pointers. Logically they don't, but technically they do...

Parent issue: #89692

r? ```@joshtriplett```

2 years agoRollup merge of #89784 - Mark-Simulacrum:delete-cache-hit-tracking, r=petrochenkov
the8472 [Tue, 12 Oct 2021 12:53:09 +0000 (14:53 +0200)]
Rollup merge of #89784 - Mark-Simulacrum:delete-cache-hit-tracking, r=petrochenkov

Remove built-in query cache_hit tracking

This was already only enabled in debug_assertions builds. Generally, it seems
like most use cases that would use this could also use the -Zself-profile flag
which also tracks cache hits (in all builds), and so the extra cfg's and such
are not really necessary.

This is largely just a small cleanup though, which primarily is intended to make
other changes easier by avoiding the need to deal with this field.

2 years agoRollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett
the8472 [Tue, 12 Oct 2021 12:53:08 +0000 (14:53 +0200)]
Rollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett

Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: #89692

r? ````@joshtriplett````

2 years agoUse Option::map_or instead of open coding it
LingMan [Tue, 12 Oct 2021 12:47:31 +0000 (14:47 +0200)]
Use Option::map_or instead of open coding it

2 years agoFilter unstable and doc hidden variants in usefulness checking
Devin Ragotzy [Sat, 18 Sep 2021 20:52:43 +0000 (16:52 -0400)]
Filter unstable and doc hidden variants in usefulness checking

Add test cases for unstable variants
Add test cases for doc hidden variants
Move is_doc_hidden to method on TyCtxt
Add unstable variants test to reachable-patterns ui test
Rename reachable-patterns -> omitted-patterns

2 years agoRemap ssa RealPredicate to llvm RealPredicate
Tomasz Miąsko [Tue, 12 Oct 2021 00:00:00 +0000 (00:00 +0000)]
Remap ssa RealPredicate to llvm RealPredicate

to avoid relying on the discriminant of the former for FFI purposes

2 years agoAuto merge of #89770 - jkugelman:must-use-from-and-into, r=joshtriplett
bors [Tue, 12 Oct 2021 09:43:37 +0000 (09:43 +0000)]
Auto merge of #89770 - jkugelman:must-use-from-and-into, r=joshtriplett

Add #[must_use] to From::from and Into::into

Risk of churn: **High**
Magic 8-Ball says: **Outlook not so good**

I figured I'd put this out there. If we don't do it now maybe we save it for a rainy day.

Parent issue: #89692

r? `@joshtriplett`

2 years agoAuto merge of #89769 - jkugelman:must-use-maybe-uninit-new, r=joshtriplett
bors [Tue, 12 Oct 2021 07:02:53 +0000 (07:02 +0000)]
Auto merge of #89769 - jkugelman:must-use-maybe-uninit-new, r=joshtriplett

Add #[must_use] to MaybeUninit::new

As discussed in https://github.com/rust-lang/rust/pull/89729#issuecomment-939775659.

Parent issue: #89692

r? `@joshtriplett`

2 years agoadd some more testcases
Marcel Hellwig [Mon, 11 Oct 2021 14:03:57 +0000 (16:03 +0200)]
add some more testcases

2 years agoUpdate cargo
Eric Huss [Tue, 12 Oct 2021 04:48:27 +0000 (21:48 -0700)]
Update cargo

2 years agoUpdate books
Eric Huss [Tue, 12 Oct 2021 04:10:05 +0000 (21:10 -0700)]
Update books

2 years agofix minor spelling error in Poll::ready docs
ast-ral [Tue, 12 Oct 2021 04:00:02 +0000 (21:00 -0700)]
fix minor spelling error in Poll::ready docs

2 years agoAuto merge of #88788 - falk-hueffner:speedup-int-log10-branchless, r=joshtriplett
bors [Tue, 12 Oct 2021 03:18:54 +0000 (03:18 +0000)]
Auto merge of #88788 - falk-hueffner:speedup-int-log10-branchless, r=joshtriplett

Speedup int log10 branchless

This is achieved with a branchless bit-twiddling implementation of the case x < 100_000, and using this as building block.

Benchmark on an Intel i7-8700K (Coffee Lake):

```
name                                   old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
num::int_log::u8_log10_predictable     165          169                     4    2.42%   x 0.98
num::int_log::u8_log10_random          438          423                   -15   -3.42%   x 1.04
num::int_log::u8_log10_random_small    438          423                   -15   -3.42%   x 1.04
num::int_log::u16_log10_predictable    633          417                  -216  -34.12%   x 1.52
num::int_log::u16_log10_random         908          471                  -437  -48.13%   x 1.93
num::int_log::u16_log10_random_small   945          471                  -474  -50.16%   x 2.01
num::int_log::u32_log10_predictable    1,496        1,340                -156  -10.43%   x 1.12
num::int_log::u32_log10_random         1,076        873                  -203  -18.87%   x 1.23
num::int_log::u32_log10_random_small   1,145        874                  -271  -23.67%   x 1.31
num::int_log::u64_log10_predictable    4,005        3,171                -834  -20.82%   x 1.26
num::int_log::u64_log10_random         1,247        1,021                -226  -18.12%   x 1.22
num::int_log::u64_log10_random_small   1,265        921                  -344  -27.19%   x 1.37
num::int_log::u128_log10_predictable   39,667       39,579                -88   -0.22%   x 1.00
num::int_log::u128_log10_random        6,456        6,696                 240    3.72%   x 0.96
num::int_log::u128_log10_random_small  4,108        3,903                -205   -4.99%   x 1.05
```

Benchmark on an M1 Mac Mini:

```
name                                   old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
num::int_log::u8_log10_predictable     143          130                   -13   -9.09%   x 1.10
num::int_log::u8_log10_random          375          325                   -50  -13.33%   x 1.15
num::int_log::u8_log10_random_small    376          325                   -51  -13.56%   x 1.16
num::int_log::u16_log10_predictable    500          322                  -178  -35.60%   x 1.55
num::int_log::u16_log10_random         794          405                  -389  -48.99%   x 1.96
num::int_log::u16_log10_random_small   1,035        405                  -630  -60.87%   x 2.56
num::int_log::u32_log10_predictable    1,144        894                  -250  -21.85%   x 1.28
num::int_log::u32_log10_random         832          786                   -46   -5.53%   x 1.06
num::int_log::u32_log10_random_small   832          787                   -45   -5.41%   x 1.06
num::int_log::u64_log10_predictable    2,681        2,057                -624  -23.27%   x 1.30
num::int_log::u64_log10_random         1,015        806                  -209  -20.59%   x 1.26
num::int_log::u64_log10_random_small   1,004        795                  -209  -20.82%   x 1.26
num::int_log::u128_log10_predictable   56,825       56,526               -299   -0.53%   x 1.01
num::int_log::u128_log10_random        9,056        8,861                -195   -2.15%   x 1.02
num::int_log::u128_log10_random_small  1,528        1,527                  -1   -0.07%   x 1.00
```

The 128 bit case remains ridiculously slow because llvm fails to optimize division by a constant 128-bit value to multiplications. This could be worked around but it seems preferable to fix this in llvm.

From u32 up, table lookup (like suggested [here](https://github.com/rust-lang/rust/issues/70887#issuecomment-881099813)) is still faster, but requires a hardware `leading_zeros` to be viable, and might clog up the cache.

2 years agoAdd #[must_use] to non-mutating verb methods
John Kugelman [Tue, 12 Oct 2021 00:40:03 +0000 (20:40 -0400)]
Add #[must_use] to non-mutating verb methods

2 years agoAdd #[must_use] to is_condition tests
John Kugelman [Tue, 12 Oct 2021 01:15:57 +0000 (21:15 -0400)]
Add #[must_use] to is_condition tests

A continuation of #89718.

2 years agoAuto merge of #89791 - matthiaskrgr:rollup-1lhxh5b, r=matthiaskrgr
bors [Tue, 12 Oct 2021 00:20:34 +0000 (00:20 +0000)]
Auto merge of #89791 - matthiaskrgr:rollup-1lhxh5b, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #89471 (Use Ancestory to check default fn in const impl instead of comparing idents)
 - #89643 (Fix inherent impl overlap check.)
 - #89651 (Add `Poll::ready` and revert stabilization of `task::ready!`)
 - #89675 (Re-use TypeChecker instead of passing around some of its fields )
 - #89710 (Add long explanation for error E0482)
 - #89756 (Greatly reduce amount of debuginfo compiled for bootstrap itself)
 - #89760 (Remove hack ignoring unused attributes for stage 0 std)
 - #89772 (Fix function-names test for GDB 10.1)
 - #89785 (Fix ICE when compiling nightly std/rustc on beta compiler)

Failed merges:

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

2 years agoAdd #[must_use] to to_value conversions
John Kugelman [Mon, 11 Oct 2021 23:04:24 +0000 (19:04 -0400)]
Add #[must_use] to to_value conversions

2 years agoAdd #[must_use] to From::from and Into::into
John Kugelman [Mon, 11 Oct 2021 14:13:50 +0000 (10:13 -0400)]
Add #[must_use] to From::from and Into::into

2 years agoRollup merge of #89785 - nbdd0121:master, r=Mark-Simulacrum
Matthias Krüger [Mon, 11 Oct 2021 21:45:53 +0000 (23:45 +0200)]
Rollup merge of #89785 - nbdd0121:master, r=Mark-Simulacrum

Fix ICE when compiling nightly std/rustc on beta compiler

Fix #89775

#89479 renames a lot of diagnostic items, but it happens that the beta compiler assumes that there must be DefId with `rustc_diagnostic_item = "send_trait"`, causing an ICE when compiling stage 0 std or stage 1 compiler. So gate it with `cfg(bootstrap)`.

The unwrap is also removed, so that existence of the diagnostic item is not required. I ripgreped the code base and this seems the only place where `unwrap` is called on the return value of `get_diagnostic_item`.

2 years agoRollup merge of #89772 - michaelwoerister:fix-function-names-test-gdb, r=Mark-Simulacrum
Matthias Krüger [Mon, 11 Oct 2021 21:45:52 +0000 (23:45 +0200)]
Rollup merge of #89772 - michaelwoerister:fix-function-names-test-gdb, r=Mark-Simulacrum

Fix function-names test for GDB 10.1

This PR updates the test output in `src/test/debuginfo/function-names.rs` for GDB 10.1.

This should fix issue https://github.com/rust-lang/rust/issues/89750 -- but not the underlying problem of CI ignoring tests if not viable debugger happens to be present.

2 years agoRollup merge of #89760 - jyn514:remove-incremental-hack, r=Mark-Simulacrum
Matthias Krüger [Mon, 11 Oct 2021 21:45:51 +0000 (23:45 +0200)]
Rollup merge of #89760 - jyn514:remove-incremental-hack, r=Mark-Simulacrum

Remove hack ignoring unused attributes for stage 0 std

This seems to no longer be giving spurious errors when incremental is
enabled.

Closes https://github.com/rust-lang/rust/issues/58633.

2 years agoRollup merge of #89756 - jyn514:bootstrap-times, r=Mark-Simulacrum
Matthias Krüger [Mon, 11 Oct 2021 21:45:51 +0000 (23:45 +0200)]
Rollup merge of #89756 - jyn514:bootstrap-times, r=Mark-Simulacrum

Greatly reduce amount of debuginfo compiled for bootstrap itself

Rather than compiling rustbuild and all its dependencies with
`debuginfo=2`, this compiles dependencies without debuginfo and
rustbuild with `debuginfo=1`. On my laptop, this brings compile times
down from ~1:20 to ~1:05.

See also https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/async.20in.20bootstrap.3F/near/254847594.

r? ``@Mark-Simulacrum``

2 years agoRollup merge of #89710 - sireliah:e0482, r=GuillaumeGomez
Matthias Krüger [Mon, 11 Oct 2021 21:45:50 +0000 (23:45 +0200)]
Rollup merge of #89710 - sireliah:e0482, r=GuillaumeGomez

Add long explanation for error E0482

This is longer explanation for error E0482 in the #61137.

Please take a look and leave some feedback!

2 years agoRollup merge of #89675 - oli-obk:type_checker, r=davidtwco
Matthias Krüger [Mon, 11 Oct 2021 21:45:49 +0000 (23:45 +0200)]
Rollup merge of #89675 - oli-obk:type_checker, r=davidtwco

Re-use TypeChecker instead of passing around some of its fields

In the future (for lazy TAIT) we will need more of its fields, but even ignoring that, this change seems reasonable on its own to me.

2 years agoRollup merge of #89651 - ibraheemdev:poll-ready, r=dtolnay
Matthias Krüger [Mon, 11 Oct 2021 21:45:48 +0000 (23:45 +0200)]
Rollup merge of #89651 - ibraheemdev:poll-ready, r=dtolnay

Add `Poll::ready` and revert stabilization of `task::ready!`

This PR adds an inherent `ready` method to `Poll` that can be used with the `?` operator as an alternative to the `task::ready!` macro:
```rust
let val = ready!(fut.poll(cx));
let val = fut.poll(cx).ready()?;
```

I think this form is a nice, non-breaking middle ground between changing the `impl Try for Poll`, and adding a separate macro. It looks better than `ready!` in my opinion, and it composes well:

```rust
let elem = ready!(fut.poll(cx)).pop().unwrap();
let elem = fut.poll(cx).ready()?.pop().unwrap();
```

The planned stabilization of `ready!` in 1.56 has been reverted because I think this alternate approach is worth considering.

r? rust-lang/libs

2 years agoRollup merge of #89643 - cjgillot:overlap, r=matthewjasper
Matthias Krüger [Mon, 11 Oct 2021 21:45:46 +0000 (23:45 +0200)]
Rollup merge of #89643 - cjgillot:overlap, r=matthewjasper

Fix inherent impl overlap check.

The current implementation of the overlap check was slightly buggy, and unified the wrong connected component in the `ids.len() <= 1` case. This became visible in another PR which changed the iteration order of items.

r? ``@matthewjasper`` since you reviewed the other PR.

2 years agoRollup merge of #89471 - nbdd0121:const3, r=fee1-dead
Matthias Krüger [Mon, 11 Oct 2021 21:45:46 +0000 (23:45 +0200)]
Rollup merge of #89471 - nbdd0121:const3, r=fee1-dead

Use Ancestory to check default fn in const impl instead of comparing idents

Fixes https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Const.20trait.20impl.20inside.20macro

2 years agoAuto merge of #89648 - nbdd0121:issue-89606, r=nikomatsakis
bors [Mon, 11 Oct 2021 21:39:11 +0000 (21:39 +0000)]
Auto merge of #89648 - nbdd0121:issue-89606, r=nikomatsakis

Ignore type of projections for upvar capturing

Fix #89606

Ignore type of projections for upvar capturing. Originally HashMap is used, and the hash/eq implementation of Place takes the type of projections into account. These types may differ by lifetime which causes #89606 to ICE.

I originally considered erasing regions but `place.ty()` is used when creating upvar tuple type, more than just serving as a key type, so I switched to a linear comparison with custom eq (`compare_place_ignore_ty`) instead.

r? `@wesleywiser`

`@rustbot` label +T-compiler

2 years agouse fold instead of try_fold now that .by_ref().next() has been inlined
The8472 [Mon, 11 Oct 2021 21:36:04 +0000 (23:36 +0200)]
use fold instead of try_fold now that .by_ref().next() has been inlined

2 years agoRemove built-in cache_hit tracking
Mark Rousskov [Mon, 11 Oct 2021 19:49:40 +0000 (15:49 -0400)]
Remove built-in cache_hit tracking

This was already only enabled in debug_assertions builds. Generally, it seems
like most use cases that would use this could also use the -Zself-profile flag
which also tracks cache hits (in all builds), and so the extra cfg's and such
are not really necessary.

This is largely just a small cleanup though, which primarily is intended to make
other changes easier by avoiding the need to deal with this field.

2 years agoFix ICE 89775
Gary Guo [Mon, 11 Oct 2021 19:52:36 +0000 (20:52 +0100)]
Fix ICE 89775

2 years agoClarify the error descriptions
sireliah [Sun, 10 Oct 2021 12:58:12 +0000 (14:58 +0200)]
Clarify the error descriptions

2 years agorustdoc: update noto sans kr
Shinwoo Park [Mon, 11 Oct 2021 19:47:34 +0000 (04:47 +0900)]
rustdoc: update noto sans kr

2 years agoAdd missing words in `Infallible` docs
Wilfred Hughes [Mon, 11 Oct 2021 19:26:27 +0000 (12:26 -0700)]
Add missing words in `Infallible` docs

This sentence was previously incomplete.

2 years agoAdd library tracking issue for poll_ready feature
David Tolnay [Mon, 11 Oct 2021 19:17:41 +0000 (12:17 -0700)]
Add library tracking issue for poll_ready feature

2 years agoRemove task::ready! from 1.56.0 release notes
David Tolnay [Mon, 11 Oct 2021 19:06:32 +0000 (12:06 -0700)]
Remove task::ready! from 1.56.0 release notes

2 years agoUpdate library/core/src/mem/maybe_uninit.rs
John Kugelman [Mon, 11 Oct 2021 18:46:08 +0000 (14:46 -0400)]
Update library/core/src/mem/maybe_uninit.rs

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2 years agoAdd #[must_use] to as_type conversions
John Kugelman [Mon, 11 Oct 2021 17:57:38 +0000 (13:57 -0400)]
Add #[must_use] to as_type conversions

2 years agoEdit explanation of test for nested type ascriptions
pierwill [Mon, 11 Oct 2021 17:56:55 +0000 (12:56 -0500)]
Edit explanation of test for nested type ascriptions

Closes #88233

2 years agoSplit impl-with-default-fn test into a pass test and a fail test
Gary Guo [Mon, 11 Oct 2021 17:20:20 +0000 (18:20 +0100)]
Split impl-with-default-fn test into a pass test and a fail test

2 years agoUse Ancestory to check default fn in const impl instead of comparing idents
Gary Guo [Sat, 2 Oct 2021 18:02:22 +0000 (19:02 +0100)]
Use Ancestory to check default fn in const impl instead of comparing idents

2 years agoAuto merge of #83908 - Flying-Toast:master, r=davidtwco
bors [Mon, 11 Oct 2021 17:12:14 +0000 (17:12 +0000)]
Auto merge of #83908 - Flying-Toast:master, r=davidtwco

Add enum_intrinsics_non_enums lint

There is a clippy lint to prevent calling [`mem::discriminant`](https://doc.rust-lang.org/std/mem/fn.discriminant.html) with a non-enum type. I think the lint is worthy of being included in rustc, given that `discriminant::<T>()` where `T` is a non-enum has an unspecified return value, and there are no valid use cases where you'd actually want this.

I've also made the lint check [variant_count](https://doc.rust-lang.org/core/mem/fn.variant_count.html) (#73662).

closes #83899

2 years agoinline next() on &mut Iterator impl
The8472 [Mon, 11 Oct 2021 15:50:03 +0000 (17:50 +0200)]
inline next() on &mut Iterator impl

2 years agoFix function-names test for GDB 10.1
Michael Woerister [Mon, 11 Oct 2021 15:20:45 +0000 (17:20 +0200)]
Fix function-names test for GDB 10.1

2 years agoAuto merge of #89767 - GuillaumeGomez:rollup-sczixhk, r=GuillaumeGomez
bors [Mon, 11 Oct 2021 14:16:15 +0000 (14:16 +0000)]
Auto merge of #89767 - GuillaumeGomez:rollup-sczixhk, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #89655 (bootstrap: don't use `--merges` to look for commit hashes for downloading artifacts)
 - #89726 (Add #[must_use] to alloc constructors)
 - #89729 (Add #[must_use] to core and std constructors)
 - #89743 (Fix RUSTC_LOG handling)
 - #89753 (Add #[must_use] to from_value conversions)
 - #89754 (Cleanup .item-table CSS)
 - #89761 (:arrow_up: rust-analyzer)

Failed merges:

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

2 years agoAdd #[must_use] to MaybeUninit::new
John Kugelman [Mon, 11 Oct 2021 14:03:55 +0000 (10:03 -0400)]
Add #[must_use] to MaybeUninit::new

2 years agoRollup merge of #89761 - lnicola:rust-analyzer-2021-10-11, r=lnicola
Guillaume Gomez [Mon, 11 Oct 2021 12:11:46 +0000 (14:11 +0200)]
Rollup merge of #89761 - lnicola:rust-analyzer-2021-10-11, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

2 years agoRollup merge of #89754 - dns2utf8:rustdoc_cleanup_css, r=GuillaumeGomez
Guillaume Gomez [Mon, 11 Oct 2021 12:11:46 +0000 (14:11 +0200)]
Rollup merge of #89754 - dns2utf8:rustdoc_cleanup_css, r=GuillaumeGomez

Cleanup .item-table CSS

The main table-like element must be `display: table;`

r? `@GuillaumeGomez`

2 years agoRollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett
Guillaume Gomez [Mon, 11 Oct 2021 12:11:45 +0000 (14:11 +0200)]
Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett

Add #[must_use] to from_value conversions

I added two methods to the list myself. Clippy did not flag them because they take `mut` args, but neither modifies their argument.

```rust
core::str           const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str;
std::ffi::CString   unsafe fn from_raw(ptr: *mut c_char) -> CString;
```

I put a custom note on `from_raw`:

```rust
#[must_use = "call `drop(from_raw(ptr))` if you intend to drop the `CString`"]
pub unsafe fn from_raw(ptr: *mut c_char) -> CString {
```

Parent issue: #89692

r? ``@joshtriplett``

2 years agoRollup merge of #89743 - matthewjasper:env-log-fix, r=jyn514
Guillaume Gomez [Mon, 11 Oct 2021 12:11:44 +0000 (14:11 +0200)]
Rollup merge of #89743 - matthewjasper:env-log-fix, r=jyn514

Fix RUSTC_LOG handling

Rustc was incorrectly reading the value of `RUSTC_LOG` as the environment vairable with the logging configuration, rather than the logging configuration itself.

2 years agoRollup merge of #89729 - jkugelman:must-use-core-std-constructors, r=joshtriplett
Guillaume Gomez [Mon, 11 Oct 2021 12:11:43 +0000 (14:11 +0200)]
Rollup merge of #89729 - jkugelman:must-use-core-std-constructors, r=joshtriplett

Add #[must_use] to core and std constructors

Parent issue: #89692

r? ``@joshtriplett``

2 years agoRollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett
Guillaume Gomez [Mon, 11 Oct 2021 12:11:42 +0000 (14:11 +0200)]
Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett

Add #[must_use] to alloc constructors

Added `#[must_use]`. to the various forms of `new`, `pin`, and `with_capacity` in the `alloc` crate. No extra explanations given as I couldn't think of anything useful to add.

I figure this deserves extra scrutiny compared to the other PRs I've done so far. In particular:

* The 4 `pin`/`pin_in` methods I touched. Are there legitimate use cases for pinning and not using the result? Pinning's a difficult concept I'm not very comfortable with.
* `Box`'s constructors. Do people ever create boxes just for the side effects... allocating or zeroing out memory?

Parent issue: #89692

r? ``@joshtriplett``

2 years agoRollup merge of #89655 - tlyu:find-non-merge-commits, r=jyn514
Guillaume Gomez [Mon, 11 Oct 2021 12:11:41 +0000 (14:11 +0200)]
Rollup merge of #89655 - tlyu:find-non-merge-commits, r=jyn514

bootstrap: don't use `--merges` to look for commit hashes for downloading artifacts

Shallow clones (and possibly worktrees, though I can't seem to reproduce the problem there) can cause `git rev-list --merges` to falsely return no results, even if a merge commit is present. Stop using the `--merges` option when looking for commit hashes that have build artifacts. `--first-parent` and `--author=bors@rust-lang.org` should be sufficient.

Also exit with an error if the configuration asks for artifacts to be downloaded and we can't determine an appropriate commit hash to use to download artifacts.

Fixes #87890.

r? ``@jyn514``
``@rustbot`` label +A-rustbuild +A-contributor-roadblock