Commit Graph

213698 Commits

Author SHA1 Message Date
Michael Goulet
f6b45e399e Suppress errors due to TypeError not coercing with inference variables 2022-12-30 19:53:34 +00: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
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
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
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
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
Matthias Krüger
031a2143f0
Rollup merge of #106242 - estebank:diff-markers, r=jyn514
Detect diff markers in the parser

Partly address #32059.
2022-12-29 13:16:06 +01:00
Matthias Krüger
98f2409c82
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. :)
2022-12-29 13:16:05 +01:00
Matthias Krüger
d08af68f22
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.
2022-12-29 13:16:05 +01:00
Matthias Krüger
313541c766
Rollup merge of #106223 - estebank:suggest-let-ty-borrow, r=compiler-errors
On unsized locals with explicit types suggest `&`

Fix #72742.
2022-12-29 13:16:04 +01:00
Matthias Krüger
c610aeb592
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.
2022-12-29 13:16:04 +01:00
Matthias Krüger
2c4560cb12
Rollup merge of #106218 - GuillaumeGomez:migrate-css-var-scraped-examples, r=notriddle
Migrate css var scraped examples

r? ``@notriddle``
2022-12-29 13:16:03 +01:00
Matthias Krüger
bdf37b7bbb
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.
2022-12-29 13:16:03 +01:00
Matthias Krüger
e7823145f9
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``
2022-12-29 13:16:02 +01:00
Matthias Krüger
497d21412a
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
2022-12-29 13:16:02 +01:00
bors
0c0b403f19 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
2022-12-29 11:20:50 +00:00
Guillaume Gomez
4b5c0923c7 Extend rustdoc GUI test for scraped examples 2022-12-29 12:10:39 +01:00
Guillaume Gomez
5494da23af Migrate more scraped examples CSS rules to CSS variables 2022-12-29 12:10:24 +01:00
bors
22af8fe683 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 -->
2022-12-29 09:23:03 +00:00
bors
11a338ab66 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
2022-12-29 08:06:03 +00:00
Yutaro Ohno
e5281c389d 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`.
2022-12-29 15:08:30 +09:00
Esteban Küber
62c8e3144a Add support for diff3 format 2022-12-28 20:55:46 -08:00
Esteban Küber
698ebe357f Tweak wording 2022-12-28 20:45:07 -08:00
bors
6ad8383451 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.
2022-12-29 04:22:25 +00:00
Esteban Küber
38fd5a9acf Account for ADT bodies and struct expressions 2022-12-28 18:30:18 -08:00
Esteban Küber
375f025805 Detect diff markers in the parser
Partly address #32059.
2022-12-28 17:56:22 -08:00