Commit Graph

213722 Commits

Author SHA1 Message Date
Michael Goulet
ff3326d925
Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se
Unify id-based thread parking implementations

Multiple platforms currently use thread-id-based parking implementations (NetBSD and SGX[^1]). Even though the strategy does not differ, these are duplicated for each platform, as the id is encoded into an atomic thread variable in different ways for each platform.

Since `park` is only called by one thread, it is possible to move the thread id into a separate field. By ensuring that the field is only written to once, before any other threads access it, these accesses can be unsynchronized, removing any restrictions on the size and niches of the thread id.

This PR also renames the internal `thread_parker` modules to `thread_parking`, as that name now better reflects their contents. I hope this does not add too much reviewing noise.

r? `@m-ou-se`

`@rustbot` label +T-libs

[^1]: SOLID supports this as well, I will switch it over in a follow-up PR.
2022-12-30 21:26:33 -08:00
bors
5570cda187 Auto merge of #106320 - jyn514:revert-merge-check, r=jyn514
Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits, r=jyn514"

This reverts commit 4839886f0a, reversing changes made to ce85c98575.

Fixes https://github.com/rust-lang/rust/pull/106232#issuecomment-1368144655.

r? `@jyn514`
2022-12-31 01:58:51 +00:00
Joshua Nelson
90a10cae4b Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514"
This reverts commit 4839886f0a, reversing
changes made to ce85c98575.
2022-12-31 01:55:24 +00:00
bors
4839886f0a Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514
Add tidy check to deny merge commits

This will prevent users with the pre-push hook from pushing a merge commit.

Exceptions are added for subtree updates. These exceptions are a little hacky and may be non-exhaustive but can be extended in the future.

I added a link to `@jyn514's` blog post for the error case because that's the best resource to solve merge commits. But it would probably be better if it was integrated into https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy, then we could link that instead.

r? `@jyn514`
2022-12-30 22:55:51 +00:00
Nilstrieb
878af66b53 Add build_helper crate to share code between tidy and bootstrap 2022-12-30 20:41:47 +01:00
bors
ce85c98575 Auto merge of #105651 - tgross35:once-cell-inline, r=m-ou-se
Add #[inline] markers to once_cell methods

Added inline markers to all simple methods under the `once_cell` feature. Relates to #74465 and  #105587

This should not block #105587
2022-12-30 19:22:33 +00:00
bors
bbdca4c28f Auto merge of #106296 - matthiaskrgr:rollup-ukdbqwx, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #99244 (doc: clearer and more correct Iterator::scan)
 - #103707 (Replace libstd, libcore, liballoc terminology in docs)
 - #104182 (`IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` documentation.)
 - #106273 (rustdoc: remove redundant CSS `.source .content { overflow: visible }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-30 16:10:00 +00:00
Matthias Krüger
3f9909a7c4
Rollup merge of #106273 - notriddle:notriddle/source-content-overflow, r=GuillaumeGomez
rustdoc: remove redundant CSS `.source .content { overflow: visible }`

When added in 7669f04fb0 / #16066, the page itself was set to scroll. Now it's set so that the `example-wrap` is scrolling inside the page, so the overflow setting for the content is irrelevant.
2022-12-30 17:01:40 +01:00
Matthias Krüger
bd20fc1fd6
Rollup merge of #104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se
`IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` documentation.

Added documentation for IPv6 Addresses `IN6ADDR_ANY_INIT` also known as `in6addr_any` and `IN6ADDR_LOOPBACK_INIT` also known as `in6addr_loopback` similar to `INADDR_ANY` for IPv4 Addresses.
2022-12-30 17:01:39 +01:00
Matthias Krüger
25b1f1c26d
Rollup merge of #103707 - jonathanCogan:master, r=m-ou-se
Replace libstd, libcore, liballoc terminology in docs

Fixes #103551.  I changed line comments containing the outdated terms as well.

It would be great if someone with more experience could weigh in on whether these changes introduce ambiguity as suggested in https://github.com/rust-lang/rust/issues/103551#issuecomment-1291225315.
2022-12-30 17:01:39 +01:00
Matthias Krüger
80e309f798
Rollup merge of #99244 - gthb:doc-improve-iterator-scan, r=m-ou-se
doc: clearer and more correct Iterator::scan

The `Iterator::scan` documentation seemed a little misleading to my newcomer
eyes, and this tries to address that.

* I found “similar to `fold`” unhelpful because (a) the similarity is only that
  they maintain state between iterations, and (b) the _dissimilarity_ is no less
  important: one returns a final value and the other an iterator. So this
  replaces that with “which, like `fold`, holds internal state, but unlike
  `fold`, produces a new iterator.

* I found “the return value from the closure, an `Option`, is yielded by the
  iterator” to be downright incorrect, because “yielded by the iterator” means
  “returned by the `next` method wrapped in `Some`”, so this implied that `scan`
  would convert an input iterator of `T` to an output iterator of `Option<T>`.
  So this replaces “yielded by the iterator” with “returned by the `next`
  method” and elaborates: “Thus the closure can return `Some(value)` to yield
  `value`, or `None` to end the iteration.”

* This also changes the example to illustrate the latter point by returning
  `None` to terminate the iteration early based on `state`.
2022-12-30 17:01:38 +01:00
joboet
898302e685
std: remove unnecessary #[cfg] on NetBSD 2022-12-30 15:50:31 +01:00
joboet
9abda03da6
std: rename Parker::new to Parker::new_in_place, add safe Parker::new constructor for SGX 2022-12-30 15:49:47 +01:00
jonathanCogan
78691e3589 Update paths in comments. 2022-12-30 14:00:42 +01:00
jonathanCogan
db47071df2 Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
jonathanCogan
72067c77bd Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
bors
7c991868c6 Auto merge of #105426 - flba-eb:fix_tls_destructor_unwinding, r=m-ou-se
Catch panics/unwinding in destruction of TLS values

`destroy_value` is/can be called from C code (libc). Unwinding from Rust to C code is undefined behavior, which is why unwinding is caught here.

This problem caused an infinite loop inside the unwinding code when running `src/test/ui/threads-sendsync/issue-24313.rs` on a tier 3 target (QNX/Neutrino) on aarch64.

See also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Infinite.20unwinding.20bug.
2022-12-30 12:58:50 +00:00
Nilstrieb
ad9806b73c Checkout master branch in CI 2022-12-30 11:23:01 +01:00
Nilstrieb
e15272d8d6 Add tidy check to deny merge commits
This will prevent users with the pre-push hook from pushing a merge
commit.

Exceptions are added for subtree updates. These exceptions are a little
hacky and may be non-exhaustive but can be extended in the future.
2022-12-30 11:23:01 +01:00
bors
f6cc345be4 Auto merge of #106264 - Swatinem:higher-lifetime-regression, r=petrochenkov
Add regression test for #105501

The test was minified from the published crate `msf-ice:0.2.1` which failed in a crater run.

A faulty compiler was triggering a `higher-ranked lifetime error`:
> could not prove `[async block@...]: Send`

The testcase has some complexity, as it has a simplified subset of `futures::StreamExt` in it, but the error is only being triggered by a few layers of nesting. For example removing the noop `then` call would have been enough to make the error go away.
2022-12-30 09:47:19 +00:00
Arpad Borsos
42e7df998c
Add regression test for #105501
The test was minified from the published `msf-ice:0.2.1` crate which failed in a crater run.

A faulty compiler was triggering a `higher-ranked lifetime error`:

> could not prove `[async block@...]: Send`
2022-12-30 08:52:35 +01:00
bors
e5e5fcb0b7 Auto merge of #106268 - kraktus:patch-2, r=Nilstrieb
fix comment for `TokenCursor::desugar`

the hashes of the text were forgotten.
2022-12-30 06:59:13 +00:00
bors
808be91da0 Auto merge of #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, r=notriddle
Migrate more scraped examples CSS rules to CSS variables

It's based on https://github.com/rust-lang/rust/pull/106218 so it will need to wait for it to be merged first.

r? `@notriddle`
2022-12-30 03:58:49 +00:00
bors
973a4db8d5 Auto merge of #106210 - fee1-dead-contrib:const-closure-trait-method, r=compiler-errors
Allow trait method paths to satisfy const Fn bounds

r? `@oli-obk`
2022-12-30 01:09:31 +00:00
bors
2c7536eaae Auto merge of #105920 - MarcusCalhoun-Lopez:respect_set, r=jyn514
Respect --set=target.platform when building rustbuild itself

`--set=target.platform.cc` and `--set=target.platform.cxx` are ignored if target is quoted.

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.

Undo parts of
d1291dc8b4 and
1532fd8cd0
2022-12-29 22:21:16 +00:00
Michael Howell
44fb7e2ea3 rustdoc: remove redundant CSS .source .content { overflow: visible }
When added in 7669f04fb0 / #16066, the page
itself was set to scroll. Now it's set so that the `example-wrap` is
scrolling inside the page, so the overflow setting for the content is
irrelevant.
2022-12-29 14:16:33 -07:00
bors
ad8ae0504c Auto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params)
 - #105899 (`./x doc library --open` opens `std`)
 - #106190 (Account for multiple multiline spans with empty padding)
 - #106202 (Trim more paths in obligation types)
 - #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing)
 - #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`)
 - #106259 (Update Clippy)
 - #106260 (Fix index out of bounds issues in rustdoc)
 - #106263 (Formatter should not try to format non-Rust files)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-29 19:40:06 +00:00
Marcus Calhoun-Lopez
480297d216 Respect --set=target.platform during build
Avoid quoting targets that do not contain a period.
See 1532fd8cd0

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of d1291dc8b4
2022-12-29 12:22:49 -07:00
kraktus
d08134f1d2
fix comment for TokenCursor::desugar
the hashes of the text were forgotten.
2022-12-29 19:45:31 +01:00
Matthias Krüger
65fb70304a
Rollup merge of #106263 - chenyukang:yukang/fix-106261-formater, r=jyn514
Formatter should not try to format non-Rust files

Fixes #106261
2022-12-29 18:24:34 +01:00
Matthias Krüger
caa33bfc75
Rollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomez
Fix index out of bounds issues in rustdoc

Fixes #106213
r? `@matthiaskrgr`
2022-12-29 18:24:33 +01:00
Matthias Krüger
b75b0a8f94
Rollup merge of #106259 - flip1995:clippyup, r=matthiaskrgr
Update Clippy

r? `@Manishearth`

I think this was the very first sync with no conflicts whatsoever. I love this time of the year :D
2022-12-29 18:24:32 +01:00
Matthias Krüger
51534b897e
Rollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomez
docs/test: add docs and a UI test for `E0514` and `E0519`

No UI test on `E0514`, it would need to compile with a different `rustc` version.

r? `@GuillaumeGomez`
2022-12-29 18:24:32 +01:00
Matthias Krüger
0e953ed69a
Rollup merge of #106234 - notriddle:notriddle/button-width, r=GuillaumeGomez
rustdoc: simplify settings, help, and copy button CSS by not reusing

Since there remains only one common CSS rule shared between them, there's no point to it: the block and selector costs more than the single `width` rule saves.
2022-12-29 18:24:31 +01:00
Matthias Krüger
6b792e9178
Rollup merge of #106202 - estebank:trim-paths, r=Nilstrieb
Trim more paths in obligation types
2022-12-29 18:24:31 +01:00
Matthias Krüger
be56dc037f
Rollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726
Account for multiple multiline spans with empty padding

Instead of

```
LL |    fn oom(
   |  __^
   | | _|
   | ||
LL | || ) {
   | ||_-
LL | |  }
   | |__^
```

emit

```
LL | // fn oom(
LL | || ) {
   | ||_-
LL | |  }
   | |__^
   ```
2022-12-29 18:24:30 +01:00
Matthias Krüger
10374d3807
Rollup merge of #105899 - lukas-code:stage-1-docs, r=jyn514
`./x doc library --open` opens `std`

fix https://github.com/rust-lang/rust/issues/105898
2022-12-29 18:24:30 +01:00
Matthias Krüger
81c2b7280f
Rollup merge of #104531 - ohno418:recover-fn-traits-with-lifetime-params, r=estebank
Provide a better error and a suggestion for `Fn` traits with lifetime params

Given `Fn`-family traits with lifetime params in trait bounds like `fn f(_: impl Fn<'a>(&'a str) -> bool)`, we currently produce many unhelpful errors.

This PR allows these situations to suggest simply using Higher-Rank Trait Bounds like `for<'a> Fn(&'a str) -> bool`.

Fixes https://github.com/rust-lang/rust/issues/103490.
2022-12-29 18:24:29 +01:00
Esteban Küber
af74ca0666 Account for multiple multiline spans with empty padding
Instead of

```
LL |    fn oom(
   |  __^
   | | _|
   | ||
LL | || ) {
   | ||_-
LL | |  }
   | |__^
```

emit

```
LL | // fn oom(
LL | || ) {
   | ||_-
LL | |  }
   | |__^
   ```
2022-12-29 09:13:40 -08:00
joboet
3076f4ec30
std: pass hint to id-based parking functions 2022-12-29 17:54:09 +01:00
bors
e37ff7e71a Auto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #106208 (Make trait/impl `where` clause mismatch on region error a bit more actionable)
 - #106216 (Powershell: Use `WaitForExit` instead of `-Wait`)
 - #106217 (rustdoc: remove unnecessary `.tooltip::after { text-align: center }`)
 - #106218 (Migrate css var scraped examples)
 - #106221 (Rename `Rptr` to `Ref` in AST and HIR)
 - #106223 (On unsized locals with explicit types suggest `&`)
 - #106225 (Remove CraftSpider from review rotation)
 - #106229 (update Miri)
 - #106242 (Detect diff markers in the parser)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-29 16:46:08 +00:00
joboet
a9e5c1a309
std: unify id-based thread parking implementations 2022-12-29 17:45:07 +01:00
yukang
7ebcc786b8 fix #106261, formater should not try to format non-Rust files 2022-12-30 00:00:08 +08:00
bors
29d76cc6f5 Auto merge of #106196 - Mark-Simulacrum:bump-installer, r=jyn514
Bump rust-installer

`--without=component-a,component-b` now requires full component names. This fixes rust-lang/rust#105755 (rust-lang/rust-installer#119).

dev-static build succeeded, and installer script seems to work (see comment in thread).
2022-12-29 13:48:46 +00:00
yukang
c6b90d2800 Fix index out of bounds issues in rustdoc 2022-12-29 21:48:40 +08:00
Philipp Krones
56ab392f02
Merge commit '4f3ab69ea0a0908260944443c739426cc384ae1a' into clippyup 2022-12-29 14:28:34 +01:00
bors
4f3ab69ea0 Auto merge of #10126 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

Love this time of the year. No conflicts, because no one merges anything.

changelog: none
2022-12-29 13:26:43 +00:00
Philipp Krones
1f971866d1
Bump nightly version -> 2022-12-29 2022-12-29 14:24:44 +01:00
Philipp Krones
08535408e8
Merge remote-tracking branch 'upstream/master' into rustup 2022-12-29 14:24:30 +01:00
Lukas Markeffsky
50a8ca56be ./x doc library --open opens std 2022-12-29 13:31:45 +01:00