]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoRollup merge of #106295 - GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle
Michael Goulet [Sat, 31 Dec 2022 05:26:35 +0000 (21:26 -0800)]
Rollup merge of #106295 - GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle

Extend scraped examples layout GUI test for position of buttons

This is a regression test for https://github.com/rust-lang/rust/pull/106279.

r? ````@notriddle````

17 months agoRollup merge of #106286 - Nilstrieb:tidy-cowows, r=jyn514
Michael Goulet [Sat, 31 Dec 2022 05:26:34 +0000 (21:26 -0800)]
Rollup merge of #106286 - Nilstrieb:tidy-cowows, r=jyn514

Make tidy errors red

This makes it easier to see them (and makes people go owo).

I also changes the error codes check to not print too many things and use `tidy_error`.

r? ```@jyn514```

17 months agoRollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726
Michael Goulet [Sat, 31 Dec 2022 05:26:34 +0000 (21:26 -0800)]
Rollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726

Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint"

This is a clean revert of #105484.

I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe.

FYI `@nbdd0121` `@compiler-errors`

17 months agoRollup merge of #106232 - maurer:transparent-subst, r=rcvalle
Michael Goulet [Sat, 31 Dec 2022 05:26:33 +0000 (21:26 -0800)]
Rollup merge of #106232 - maurer:transparent-subst, r=rcvalle

CFI: Monomorphize transparent ADTs before typeid

Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String.

`#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution.

Fixes #106230

17 months agoRollup merge of #105903 - joboet:unify_parking, r=m-ou-se
Michael Goulet [Sat, 31 Dec 2022 05:26:33 +0000 (21:26 -0800)]
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.

17 months agoAuto merge of #106320 - jyn514:revert-merge-check, r=jyn514
bors [Sat, 31 Dec 2022 01:58:51 +0000 (01:58 +0000)]
Auto merge of #106320 - jyn514:revert-merge-check, r=jyn514

Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits, r=jyn514"

This reverts commit 4839886f0abe208ab8f2bb73a3076a59fe2ab60c, reversing changes made to ce85c98575e3016cf2007d90a85be321e592aa96.

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

r? `@jyn514`

17 months agoRevert "Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allow...
Joshua Nelson [Sat, 31 Dec 2022 01:55:24 +0000 (01:55 +0000)]
Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514"

This reverts commit 4839886f0abe208ab8f2bb73a3076a59fe2ab60c, reversing
changes made to ce85c98575e3016cf2007d90a85be321e592aa96.

17 months agoAuto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to...
bors [Fri, 30 Dec 2022 22:55:51 +0000 (22:55 +0000)]
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`

17 months agoMake tidy errors red
Nilstrieb [Fri, 30 Dec 2022 11:23:05 +0000 (12:23 +0100)]
Make tidy errors red

This makes it easier to see them (and makes people go owo).

17 months agoAdd `build_helper` crate to share code between tidy and bootstrap
Nilstrieb [Fri, 30 Dec 2022 10:11:33 +0000 (11:11 +0100)]
Add `build_helper` crate to share code between tidy and bootstrap

17 months agoAuto merge of #105651 - tgross35:once-cell-inline, r=m-ou-se
bors [Fri, 30 Dec 2022 19:22:33 +0000 (19:22 +0000)]
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

17 months agoRegression test for issue 106247
Gary Guo [Thu, 29 Dec 2022 09:59:49 +0000 (09:59 +0000)]
Regression test for issue 106247

17 months agoAuto merge of #106296 - matthiaskrgr:rollup-ukdbqwx, r=matthiaskrgr
bors [Fri, 30 Dec 2022 16:10:00 +0000 (16:10 +0000)]
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

17 months agoRollup merge of #106273 - notriddle:notriddle/source-content-overflow, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Dec 2022 16:01:40 +0000 (17:01 +0100)]
Rollup merge of #106273 - notriddle:notriddle/source-content-overflow, r=GuillaumeGomez

rustdoc: remove redundant CSS `.source .content { overflow: visible }`

When added in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99 / #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.

17 months agoRollup merge of #104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:39 +0000 (17:01 +0100)]
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.

17 months agoRollup merge of #103707 - jonathanCogan:master, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:39 +0000 (17:01 +0100)]
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.

17 months agoRollup merge of #99244 - gthb:doc-improve-iterator-scan, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:38 +0000 (17:01 +0100)]
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`.

17 months agoExtend scraped examples layout GUI test for position of buttons
Guillaume Gomez [Fri, 30 Dec 2022 15:27:56 +0000 (16:27 +0100)]
Extend scraped examples layout GUI test for position of buttons

17 months agostd: remove unnecessary `#[cfg]` on NetBSD
joboet [Fri, 30 Dec 2022 14:50:31 +0000 (15:50 +0100)]
std: remove unnecessary `#[cfg]` on NetBSD

17 months agostd: rename `Parker::new` to `Parker::new_in_place`, add safe `Parker::new` construct...
joboet [Fri, 30 Dec 2022 14:49:47 +0000 (15:49 +0100)]
std: rename `Parker::new` to `Parker::new_in_place`, add safe `Parker::new` constructor for SGX

17 months agoUpdate paths in comments.
jonathanCogan [Thu, 3 Nov 2022 22:59:23 +0000 (15:59 -0700)]
Update paths in comments.

17 months agoReplace libstd, libcore, liballoc in line comments.
jonathanCogan [Fri, 28 Oct 2022 23:48:00 +0000 (16:48 -0700)]
Replace libstd, libcore, liballoc in line comments.

17 months agoReplace libstd, libcore, liballoc in docs.
jonathanCogan [Fri, 28 Oct 2022 22:34:29 +0000 (15:34 -0700)]
Replace libstd, libcore, liballoc in docs.

17 months agoAuto merge of #105426 - flba-eb:fix_tls_destructor_unwinding, r=m-ou-se
bors [Fri, 30 Dec 2022 12:58:50 +0000 (12:58 +0000)]
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.

17 months agoTidy up tidy error codes check
Nilstrieb [Fri, 30 Dec 2022 11:11:05 +0000 (12:11 +0100)]
Tidy up tidy error codes check

17 months agoCheckout `master` branch in CI
Nilstrieb [Fri, 23 Dec 2022 13:58:32 +0000 (14:58 +0100)]
Checkout `master` branch in CI

17 months agoAdd tidy check to deny merge commits
Nilstrieb [Wed, 14 Dec 2022 19:22:03 +0000 (20:22 +0100)]
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.

17 months agoAuto merge of #106264 - Swatinem:higher-lifetime-regression, r=petrochenkov
bors [Fri, 30 Dec 2022 09:47:19 +0000 (09:47 +0000)]
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.

17 months agoAdd regression test for #105501
Arpad Borsos [Thu, 29 Dec 2022 16:25:40 +0000 (17:25 +0100)]
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`

17 months agoAuto merge of #106268 - kraktus:patch-2, r=Nilstrieb
bors [Fri, 30 Dec 2022 06:59:13 +0000 (06:59 +0000)]
Auto merge of #106268 - kraktus:patch-2, r=Nilstrieb

fix comment for `TokenCursor::desugar`

the hashes of the text were forgotten.

17 months agoAuto merge of #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, r=notriddle
bors [Fri, 30 Dec 2022 03:58:49 +0000 (03:58 +0000)]
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`

17 months agoAuto merge of #106210 - fee1-dead-contrib:const-closure-trait-method, r=compiler...
bors [Fri, 30 Dec 2022 01:09:31 +0000 (01:09 +0000)]
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`

17 months agoAuto merge of #105920 - MarcusCalhoun-Lopez:respect_set, r=jyn514
bors [Thu, 29 Dec 2022 22:21:16 +0000 (22:21 +0000)]
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
https://github.com/rust-lang/rust/commit/d1291dc8b4ac9a98ff1d286402559e4ba5d68488 and
https://github.com/rust-lang/rust/commit/1532fd8cd0db93f469e414f9da31ef083a44fcba

17 months agorustdoc: remove redundant CSS `.source .content { overflow: visible }`
Michael Howell [Thu, 29 Dec 2022 21:16:33 +0000 (14:16 -0700)]
rustdoc: remove redundant CSS `.source .content { overflow: visible }`

When added in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99 / #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.

17 months agoAuto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgr
bors [Thu, 29 Dec 2022 19:40:06 +0000 (19:40 +0000)]
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

17 months agoRespect --set=target.platform during build
Marcus Calhoun-Lopez [Mon, 26 Dec 2022 03:52:14 +0000 (20:52 -0700)]
Respect --set=target.platform during build

Avoid quoting targets that do not contain a period.
See https://github.com/rust-lang/rust/commit/1532fd8cd0db93f469e414f9da31ef083a44fcba

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of https://github.com/rust-lang/rust/commit/d1291dc8b4ac9a98ff1d286402559e4ba5d68488

17 months agofix comment for `TokenCursor::desugar`
kraktus [Thu, 29 Dec 2022 18:45:31 +0000 (19:45 +0100)]
fix comment for `TokenCursor::desugar`

the hashes of the text were forgotten.

17 months agoCFI: Monomorphize transparent ADTs before typeid
Matthew Maurer [Wed, 28 Dec 2022 22:31:31 +0000 (14:31 -0800)]
CFI: Monomorphize transparent ADTs before typeid

Monomorphise `#[repr(transparent)]` parameterized ADTs before turning
them into an Itanium mangled String.

`#[repr(transparent)]` ADTs currently use the single field to represent
them in their CFI type ID to ensure that they are compatible. However,
if that type involves a type parameter instantiated at the ADT level, as
in `ManuallyDrop`, this will currently ICE as the `Parameter` type
cannot be mangled. Since this happens at lowering time, it should always
be concrete after substitution.

Fixes #106230

17 months agoRollup merge of #106263 - chenyukang:yukang/fix-106261-formater, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 17:24:34 +0000 (18:24 +0100)]
Rollup merge of #106263 - chenyukang:yukang/fix-106261-formater, r=jyn514

Formatter should not try to format non-Rust files

Fixes #106261

17 months agoRollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:33 +0000 (18:24 +0100)]
Rollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomez

Fix index out of bounds issues in rustdoc

Fixes #106213
r? `@matthiaskrgr`

17 months agoRollup merge of #106259 - flip1995:clippyup, r=matthiaskrgr
Matthias Krüger [Thu, 29 Dec 2022 17:24:32 +0000 (18:24 +0100)]
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

17 months agoRollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:32 +0000 (18:24 +0100)]
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`

17 months agoRollup merge of #106234 - notriddle:notriddle/button-width, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:31 +0000 (18:24 +0100)]
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.

17 months agoRollup merge of #106202 - estebank:trim-paths, r=Nilstrieb
Matthias Krüger [Thu, 29 Dec 2022 17:24:31 +0000 (18:24 +0100)]
Rollup merge of #106202 - estebank:trim-paths, r=Nilstrieb

Trim more paths in obligation types

17 months agoRollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726
Matthias Krüger [Thu, 29 Dec 2022 17:24:30 +0000 (18:24 +0100)]
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 | |  }
   | |__^
   ```

17 months agoRollup merge of #105899 - lukas-code:stage-1-docs, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 17:24:30 +0000 (18:24 +0100)]
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

17 months agoRollup merge of #104531 - ohno418:recover-fn-traits-with-lifetime-params, r=estebank
Matthias Krüger [Thu, 29 Dec 2022 17:24:29 +0000 (18:24 +0100)]
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.

17 months agoAccount for multiple multiline spans with empty padding
Esteban Küber [Tue, 27 Dec 2022 19:03:59 +0000 (11:03 -0800)]
Account for multiple multiline spans with empty padding

Instead of

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

emit

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

17 months agostd: pass hint to id-based parking functions
joboet [Thu, 29 Dec 2022 16:54:09 +0000 (17:54 +0100)]
std: pass hint to id-based parking functions

17 months agoAuto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgr
bors [Thu, 29 Dec 2022 16:46:08 +0000 (16:46 +0000)]
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

17 months agostd: unify id-based thread parking implementations
joboet [Mon, 19 Dec 2022 14:59:00 +0000 (15:59 +0100)]
std: unify id-based thread parking implementations

17 months agofix #106261, formater should not try to format non-Rust files
yukang [Thu, 29 Dec 2022 15:38:46 +0000 (23:38 +0800)]
fix #106261, formater should not try to format non-Rust files

17 months agoAuto merge of #106196 - Mark-Simulacrum:bump-installer, r=jyn514
bors [Thu, 29 Dec 2022 13:48:46 +0000 (13:48 +0000)]
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).

17 months agoFix index out of bounds issues in rustdoc
yukang [Thu, 29 Dec 2022 13:48:40 +0000 (21:48 +0800)]
Fix index out of bounds issues in rustdoc

17 months agoMerge commit '4f3ab69ea0a0908260944443c739426cc384ae1a' into clippyup
Philipp Krones [Thu, 29 Dec 2022 13:28:34 +0000 (14:28 +0100)]
Merge commit '4f3ab69ea0a0908260944443c739426cc384ae1a' into clippyup

17 months agoAuto merge of #10126 - flip1995:rustup, r=flip1995
bors [Thu, 29 Dec 2022 13:26:43 +0000 (13:26 +0000)]
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

17 months agoBump nightly version -> 2022-12-29
Philipp Krones [Thu, 29 Dec 2022 13:24:44 +0000 (14:24 +0100)]
Bump nightly version -> 2022-12-29

17 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 29 Dec 2022 13:24:30 +0000 (14:24 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

17 months ago`./x doc library --open` opens `std`
Lukas Markeffsky [Mon, 19 Dec 2022 14:03:04 +0000 (15:03 +0100)]
`./x doc library --open` opens `std`

17 months agoRollup merge of #106242 - estebank:diff-markers, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 12:16:06 +0000 (13:16 +0100)]
Rollup merge of #106242 - estebank:diff-markers, r=jyn514

Detect diff markers in the parser

Partly address #32059.

17 months agoRollup merge of #106229 - RalfJung:miri, r=RalfJung
Matthias Krüger [Thu, 29 Dec 2022 12:16:05 +0000 (13:16 +0100)]
Rollup merge of #106229 - RalfJung:miri, r=RalfJung

update Miri

Main PRs:
- https://github.com/rust-lang/miri/pull/2741
- https://github.com/rust-lang/miri/pull/2744

This should help quite a bit with Miri support for less common targets. :)

17 months agoRollup merge of #106225 - ehuss:ehuss-patch-1, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 12:16:05 +0000 (13:16 +0100)]
Rollup merge of #106225 - ehuss:ehuss-patch-1, r=GuillaumeGomez

Remove CraftSpider from review rotation

CraftSpider was removed from the rustdoc team in https://github.com/rust-lang/team/pull/897 and can no longer be assigned.

17 months agoRollup merge of #106223 - estebank:suggest-let-ty-borrow, r=compiler-errors
Matthias Krüger [Thu, 29 Dec 2022 12:16:04 +0000 (13:16 +0100)]
Rollup merge of #106223 - estebank:suggest-let-ty-borrow, r=compiler-errors

On unsized locals with explicit types suggest `&`

Fix #72742.

17 months agoRollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, r=compiler-errors
Matthias Krüger [Thu, 29 Dec 2022 12:16:04 +0000 (13:16 +0100)]
Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, r=compiler-errors

Rename `Rptr` to `Ref` in AST and HIR

The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.

17 months agoRollup merge of #106218 - GuillaumeGomez:migrate-css-var-scraped-examples, r=notriddle
Matthias Krüger [Thu, 29 Dec 2022 12:16:03 +0000 (13:16 +0100)]
Rollup merge of #106218 - GuillaumeGomez:migrate-css-var-scraped-examples, r=notriddle

Migrate css var scraped examples

r? ``@notriddle``

17 months agoRollup merge of #106217 - notriddle:notriddle/tooltip-center, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 12:16:03 +0000 (13:16 +0100)]
Rollup merge of #106217 - notriddle:notriddle/tooltip-center, r=GuillaumeGomez

rustdoc: remove unnecessary `.tooltip::after { text-align: center }`

This doesn't have an effect, since these tooltip are only one line anyway.

17 months agoRollup merge of #106216 - ChrisDenton:ps-go-faster, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 12:16:02 +0000 (13:16 +0100)]
Rollup merge of #106216 - ChrisDenton:ps-go-faster, r=jyn514

Powershell: Use `WaitForExit` instead of `-Wait`

Using the method `WaitForExit` instead of the parameter `-Wait` results in a notable speed up of the `x.ps1` script (~350ms, fairly consistently).

Results:
```
milliseconds before: 1127.7576
milliseconds after:   779.0467
```

I think there are opportunities for further speed up by calling `Get-Command` only once with the pattern `py*` then filtering the returned list.

But I'll leave that for another time (or someone else).

r? ``@jyn514``

17 months agoRollup merge of #106208 - compiler-errors:compare-item-region-err, r=estebank
Matthias Krüger [Thu, 29 Dec 2022 12:16:02 +0000 (13:16 +0100)]
Rollup merge of #106208 - compiler-errors:compare-item-region-err, r=estebank

Make trait/impl `where` clause mismatch on region error a bit more actionable

Improve `where` clause suggestions for GATs/methods that have incompatible region predicates in their `where` clauses.

Also addresses this diagnostic that went away https://github.com/rust-lang/rust/pull/106129#discussion_r1056875772

17 months agoAuto merge of #106195 - Nilstrieb:no-more-being-clueless-whether-it-really-is-a-liter...
bors [Thu, 29 Dec 2022 11:20:50 +0000 (11:20 +0000)]
Auto merge of #106195 - Nilstrieb:no-more-being-clueless-whether-it-really-is-a-literal, r=compiler-errors

Improve heuristics whether `format_args` string is a source literal

Previously, it only checked whether there was _a_ literal at the span of the first argument, not whether the literal actually matched up. This caused issues when a proc macro was generating a different literal with the same span.

This requires an annoying special case for literals ending in `\n` because otherwise `println` wouldn't give detailed diagnostics anymore which would be bad.

Fixes #106191

17 months agoExtend rustdoc GUI test for scraped examples
Guillaume Gomez [Thu, 29 Dec 2022 11:10:39 +0000 (12:10 +0100)]
Extend rustdoc GUI test for scraped examples

17 months agoMigrate more scraped examples CSS rules to CSS variables
Guillaume Gomez [Thu, 29 Dec 2022 11:10:24 +0000 (12:10 +0100)]
Migrate more scraped examples CSS rules to CSS variables

17 months agoAuto merge of #10060 - alex-semenyuk:match_single_binding_fix, r=llogiq
bors [Thu, 29 Dec 2022 09:23:03 +0000 (09:23 +0000)]
Auto merge of #10060 - alex-semenyuk:match_single_binding_fix, r=llogiq

 Fix [match_single_binding] suggestion introduced an extra semicolon

Fix #9725

---

changelog: [`match_single_binding`]: suggestion no longer introduces unneeded semicolons
[#10060](https://github.com/rust-lang/rust-clippy/pull/10060)
<!-- changelog_checked -->

17 months agoRevert "Implement allow-by-default multiple_supertrait_upcastable lint"
David Tolnay [Thu, 29 Dec 2022 08:47:23 +0000 (00:47 -0800)]
Revert "Implement allow-by-default multiple_supertrait_upcastable lint"

This reverts commit 5e44a65517bfcccbe6624a70b54b9f192baa94f3.

17 months agoRevert "Add tests"
David Tolnay [Thu, 29 Dec 2022 08:47:18 +0000 (00:47 -0800)]
Revert "Add tests"

This reverts commit b656e2413022de1863b9ea8db87454477b816042.

17 months agoAuto merge of #106139 - cjgillot:mir-inline-location, r=eholk
bors [Thu, 29 Dec 2022 08:06:03 +0000 (08:06 +0000)]
Auto merge of #106139 - cjgillot:mir-inline-location, r=eholk

Give the correct track-caller location with MIR inlining.

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

17 months agoProvide a better error for `Fn` traits with lifetime params
Yutaro Ohno [Thu, 17 Nov 2022 11:38:40 +0000 (20:38 +0900)]
Provide a better error for `Fn` traits with lifetime params

Currently, given `Fn`-family traits with lifetime params like
`Fn<'a>(&'a str) -> bool`, many unhelpful errors show up. These are a
bit confusing.

This commit allows these situations to suggest simply using
higher-ranked trait bounds like `for<'a> Fn(&'a str) -> bool`.

17 months agoAdd support for diff3 format
Esteban Küber [Thu, 29 Dec 2022 04:55:46 +0000 (20:55 -0800)]
Add support for diff3 format

17 months agoTweak wording
Esteban Küber [Thu, 29 Dec 2022 02:46:20 +0000 (18:46 -0800)]
Tweak wording

17 months agoAuto merge of #105590 - solid-rs:patch/kmc-solid/thread-lifecycle-ordering, r=m-ou-se
bors [Thu, 29 Dec 2022 04:22:25 +0000 (04:22 +0000)]
Auto merge of #105590 - solid-rs:patch/kmc-solid/thread-lifecycle-ordering, r=m-ou-se

kmc-solid: Fix memory ordering in thread operations

Fixes two memory ordering issues in the thread state machine (`ThreadInner::lifecycle`) of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.

1. When detaching a thread that is still running (i.e., the owner updates `lifecycle` first, and the child updates it next), the first update did not synchronize-with the second update, resulting in a data race between the first update and the deallocation of `ThreadInner` by the child thread.
2. When joining on a thread, the joiner has to pass its own task ID to the joinee in order to be woken up later, but in doing so, it did not synchronize-with the read operation, creating possible sequences of execution where the joinee wakes up an incorrect or non-existent task.

Both issue are theoretical and most likely have never manifested in practice because of the stronger guarantees provided by the Arm memory model (particularly due to its barrier-based definition). Compiler optimizations could have subverted this, but the inspection of compiled code did not reveal such optimizations taking place.

17 months agoAccount for ADT bodies and struct expressions
Esteban Küber [Thu, 29 Dec 2022 02:26:59 +0000 (18:26 -0800)]
Account for ADT bodies and struct expressions

17 months agoDetect diff markers in the parser
Esteban Küber [Thu, 29 Dec 2022 01:56:22 +0000 (17:56 -0800)]
Detect diff markers in the parser

Partly address #32059.

17 months agodocs: add long-form error docs for `E0514`
Ezra Shaw [Fri, 23 Dec 2022 00:11:50 +0000 (13:11 +1300)]
docs: add long-form error docs for `E0514`

17 months agoAuto merge of #105741 - pietroalbini:pa-1.68-nightly, r=Mark-Simulacrum
bors [Thu, 29 Dec 2022 01:24:26 +0000 (01:24 +0000)]
Auto merge of #105741 - pietroalbini:pa-1.68-nightly, r=Mark-Simulacrum

Bump master bootstrap compiler

This PR bumps the bootstrap compiler to the beta created earlier this week, cherry-picks the stabilization version number updates, and updates the `cfg(bootstrap)`s.

r? `@Mark-Simulacrum`

17 months agodocs/test: add UI test and long-form error docs for `E0519`
Ezra Shaw [Wed, 21 Dec 2022 00:48:12 +0000 (13:48 +1300)]
docs/test: add UI test and long-form error docs for `E0519`

17 months agorustdoc: simplify settings, help, and copy button CSS by not reusing
Michael Howell [Wed, 28 Dec 2022 23:04:57 +0000 (16:04 -0700)]
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.

17 months agoAuto merge of #106228 - matthiaskrgr:rollup-jsznhww, r=matthiaskrgr
bors [Wed, 28 Dec 2022 22:15:27 +0000 (22:15 +0000)]
Auto merge of #106228 - matthiaskrgr:rollup-jsznhww, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104402 (Move `ReentrantMutex` to `std::sync`)
 - #104493 (available_parallelism: Gracefully handle zero value cfs_period_us)
 - #105359 (Make sentinel value configurable in `library/std/src/sys_common/thread_local_key.rs`)
 - #105497 (Clarify `catch_unwind` docs about panic hooks)
 - #105570 (Properly calculate best failure in macro matching)
 - #105702 (Format only modified files)
 - #105998 (adjust message on non-unwinding panic)
 - #106161 (Iterator::find: link to Iterator::position in docs for discoverability)

Failed merges:

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

17 months agoupdate lockfile
Ralf Jung [Wed, 28 Dec 2022 21:47:42 +0000 (22:47 +0100)]
update lockfile

17 months agoRollup merge of #106161 - meithecatte:iter-find-position, r=Mark-Simulacrum
Matthias Krüger [Wed, 28 Dec 2022 21:22:21 +0000 (22:22 +0100)]
Rollup merge of #106161 - meithecatte:iter-find-position, r=Mark-Simulacrum

Iterator::find: link to Iterator::position in docs for discoverability

17 months agoRollup merge of #105998 - RalfJung:no-unwind-panic-msg, r=thomcc
Matthias Krüger [Wed, 28 Dec 2022 21:22:21 +0000 (22:22 +0100)]
Rollup merge of #105998 - RalfJung:no-unwind-panic-msg, r=thomcc

adjust message on non-unwinding panic

"thread panicked while panicking" is just plain wrong in case this is a non-unwinding panic, such as
- a panic out of a `nounwind` function
- the sanity checks we have in `mem::uninitialized` and `mem::zeroed`
- the optional debug assertion in various unsafe std library functions

17 months agoRollup merge of #105702 - albertlarsan68:x-fmt-opt, r=jyn514
Matthias Krüger [Wed, 28 Dec 2022 21:22:20 +0000 (22:22 +0100)]
Rollup merge of #105702 - albertlarsan68:x-fmt-opt, r=jyn514

Format only modified files

As discussed on #105688, this makes x fmt only format modified files.

Fixes #105688

17 months agoRollup merge of #105570 - Nilstrieb:actual-best-failure, r=compiler-errors
Matthias Krüger [Wed, 28 Dec 2022 21:22:19 +0000 (22:22 +0100)]
Rollup merge of #105570 - Nilstrieb:actual-best-failure, r=compiler-errors

Properly calculate best failure in macro matching

Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream.

We now try to properly use the location in the token stream.

This needs a little cleanup as the `best_failure` field is getting out of hand but it should be mostly good to go. I hope I didn't violate too many abstraction boundaries..

17 months agoRollup merge of #105497 - albertlarsan68:doc-panic-hook-and-catch-unwind, r=m-ou-se
Matthias Krüger [Wed, 28 Dec 2022 21:22:19 +0000 (22:22 +0100)]
Rollup merge of #105497 - albertlarsan68:doc-panic-hook-and-catch-unwind, r=m-ou-se

Clarify `catch_unwind` docs about panic hooks

Makes it clear from `catch_unwind` docs that the panic hook will be called before the panic is caught.

Fixes #105432

17 months agoRollup merge of #105359 - flba-eb:thread_local_key_sentinel_value, r=m-ou-se
Matthias Krüger [Wed, 28 Dec 2022 21:22:18 +0000 (22:22 +0100)]
Rollup merge of #105359 - flba-eb:thread_local_key_sentinel_value, r=m-ou-se

Make sentinel value configurable in `library/std/src/sys_common/thread_local_key.rs`

This is an excerpt of a changeset for the QNX/Neutrino OS. To make the patch for QNX smaller and easier to review, I've extracted this change (which is OS independent). I would be surprised if no other OS is also affected.

All this patch does is to define a `const` for a sentinel value instead of using it directly at several places.

There are OSs that always return the lowest free value. The algorithm in `lazy_init` always avoids keys with the sentinel value.
In affected OSs, this means that each call to `lazy_init` will always request two keys from the OS and returns/frees the first one (with sentinel value) immediately afterwards.

By making the sentinel value configurable, affected OSs can use a different value than zero to prevent this performance issue.

On QNX/Neutrino, it is planned to use a different sentinel value:
```rust
// Define a sentinel value that is unlikely to be returned
// as a TLS key (but it may be returned).
#[cfg(not(target_os = "nto"))]
const KEY_SENTVAL: usize = 0;
// On QNX/Neutrino, 0 is always returned when currently not in use.
// Using 0 would mean to always create two keys and remote the first
// one (with value of 0) immediately afterwards.
#[cfg(target_os = "nto")]
const KEY_SENTVAL: usize = libc::PTHREAD_KEYS_MAX + 1;
```

It seems like no other OS defines `PTHREAD_KEYS_MAX` in Rusts libc, but `limits.h` on unix systems does.

17 months agoRollup merge of #104493 - adamncasey:cgroupzeroperiod, r=m-ou-se
Matthias Krüger [Wed, 28 Dec 2022 21:22:18 +0000 (22:22 +0100)]
Rollup merge of #104493 - adamncasey:cgroupzeroperiod, r=m-ou-se

available_parallelism: Gracefully handle zero value cfs_period_us

There seem to be some scenarios where the cgroup cpu quota field `cpu.cfs_period_us` can contain `0`. This field is used to determine the "amount" of parallelism suggested by the function `std::thread::available_parallelism`

A zero value of this field cause a panic when `available_parallelism()` is invoked. This issue was detected by the call from binaries built by `cargo test`. I really don't feel like `0` is a good value for `cpu.cfs_period_us`, but I also don't think applications should panic if this value is seen.

This panic started happening with rust 1.64.0.

This case is gracefully handled by other projects which read this information: [num_cpus](https://github.com/seanmonstar/num_cpus/blob/e437b9d9083d717692e35d917de8674a7987dd06/src/linux.rs#L207-L210), [ninja](https://github.com/ninja-build/ninja/pull/2174/files), [dotnet](https://github.com/dotnet/runtime/blob/c4341d45acca3ea662cd8d71e7d71094450dd045/src/coreclr/pal/src/misc/cgroup.cpp#L481-L483)

Before this change, running `cargo test` in environments configured as described above would trigger this panic:
```
$ RUST_BACKTRACE=1 cargo test
    Finished test [unoptimized + debuginfo] target(s) in 3.55s
     Running unittests src/main.rs (target/debug/deps/x-9a42e145aca2934d)
thread 'main' panicked at 'attempt to divide by zero', library/std/src/sys/unix/thread.rs:546:70
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: std::sys::unix::thread::cgroups::quota
   4: std::sys::unix::thread::available_parallelism
   5: std::thread::available_parallelism
   6: test::helpers::concurrency::get_concurrency
   7: test::console::run_tests_console
   8: test::test_main
   9: test::test_main_static
  10: x::main
             at ./src/main.rs:1:1
  11: core::ops::function::FnOnce::call_once
             at /tmp/rust-1.64-1.64.0-1/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: test failed, to rerun pass '--bin x'
```

I've tested this change in an environment which has the bad (questionable?) setup and rebuilding the test executable against a fixed std library fixes the panic.

17 months agoRollup merge of #104402 - joboet:sync_remutex, r=m-ou-se
Matthias Krüger [Wed, 28 Dec 2022 21:22:17 +0000 (22:22 +0100)]
Rollup merge of #104402 - joboet:sync_remutex, r=m-ou-se

Move `ReentrantMutex` to `std::sync`

If I understand #84187 correctly, `sys_common` should not contain platform-independent code, even if it is private.

17 months agoSkip LTO in stage0 (again)
Mark Rousskov [Wed, 28 Dec 2022 20:28:09 +0000 (15:28 -0500)]
Skip LTO in stage0 (again)

17 months agoPowershell: Create a `Start-Process` wrapper
Chris Denton [Wed, 28 Dec 2022 19:41:42 +0000 (19:41 +0000)]
Powershell: Create a `Start-Process` wrapper

17 months agoOn unsized locals with explicit types suggest `&`
Esteban Küber [Wed, 28 Dec 2022 17:26:30 +0000 (09:26 -0800)]
On unsized locals with explicit types suggest `&`

Fix #72742.

17 months agoAddress review comments
Michael Goulet [Wed, 28 Dec 2022 18:35:16 +0000 (18:35 +0000)]
Address review comments

17 months agoAdd test for bad suggestion
Michael Goulet [Wed, 28 Dec 2022 06:44:29 +0000 (06:44 +0000)]
Add test for bad suggestion