]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agobootstrap: Get rid of `tail_args` in `stream_cargo`
Joshua Nelson [Fri, 30 Dec 2022 20:36:31 +0000 (20:36 +0000)]
bootstrap: Get rid of `tail_args` in `stream_cargo`

18 months agoUse more consistent progress messages in bootstrap
Joshua Nelson [Fri, 30 Dec 2022 20:03:24 +0000 (20:03 +0000)]
Use more consistent progress messages in bootstrap

Before:
```
Testing ["rustc_interface"] stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

After:
```
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

Note there is a slight consistency between `build` and `test`: The
former doesn't print "compiler artifacts". It would be annoying to fix
and doesn't hurt anything, so I left it be.

```
; x t rustc_interface --stage 0 --dry-run
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
; x b rustc_interface --stage 0 --dry-run
Building {rustc_interface} stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

18 months agoSupport `x clean --stage 1 rustc_query_impl`
Joshua Nelson [Thu, 29 Dec 2022 20:57:54 +0000 (20:57 +0000)]
Support `x clean --stage 1 rustc_query_impl`

Previously, clean only supported `--stage 0` for specific crates.

The new `crate_description` function generates a string that looks
like
```
: {rustc_query_impl}
```

18 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

18 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).

18 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.

18 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. :)

18 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.

18 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.

18 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.

18 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``

18 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.

18 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``

18 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

18 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

18 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

18 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

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

18 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.

18 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

18 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.

18 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`

18 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

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

18 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

18 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

18 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

18 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..

18 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

18 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.

18 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.

18 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.

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

18 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

18 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.

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

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

18 months agoMake trait/impl where clause mismatch on region error a bit more actionable
Michael Goulet [Wed, 28 Dec 2022 06:35:34 +0000 (06:35 +0000)]
Make trait/impl where clause mismatch on region error a bit more actionable

18 months agoRemove CraftSpider from review rotation
Eric Huss [Wed, 28 Dec 2022 18:08:48 +0000 (10:08 -0800)]
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.

18 months agoRename `Rptr` to `Ref` in AST and HIR
Nilstrieb [Wed, 28 Dec 2022 17:06:11 +0000 (18:06 +0100)]
Rename `Rptr` to `Ref` in AST and HIR

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

18 months agorustdoc: remove unnecessary `.tooltip::after { text-align: center }`
Michael Howell [Wed, 28 Dec 2022 15:47:45 +0000 (08:47 -0700)]
rustdoc: remove unnecessary `.tooltip::after { text-align: center }`

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

18 months agoAuto merge of #2744 - RalfJung:json, r=RalfJung
bors [Wed, 28 Dec 2022 17:01:52 +0000 (17:01 +0000)]
Auto merge of #2744 - RalfJung:json, r=RalfJung

support using a JSON target file

Fixes https://github.com/rust-lang/miri/issues/2053

18 months agono need to do a no_std build for wasi
Ralf Jung [Wed, 28 Dec 2022 16:49:03 +0000 (17:49 +0100)]
no need to do a no_std build for wasi

18 months agotest using a JSON target file
Ralf Jung [Wed, 28 Dec 2022 16:24:28 +0000 (17:24 +0100)]
test using a JSON target file

18 months agoAuto merge of #106215 - matthiaskrgr:rollup-53r89ww, r=matthiaskrgr
bors [Wed, 28 Dec 2022 17:00:00 +0000 (17:00 +0000)]
Auto merge of #106215 - matthiaskrgr:rollup-53r89ww, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #106028 (docs/test: add UI test and long-form error docs for `E0461`)
 - #106172 (Suggest `impl Iterator` when possible for `_` return type)
 - #106173 (Deduplicate `op` methods)
 - #106176 (Recover `fn` keyword as `Fn` trait in bounds)
 - #106194 (rustdoc: combine common sidebar background color CSS rules)
 - #106199 (Silence knock-down errors on `[type error]` bindings)

Failed merges:

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

18 months agoAdd enum for `find_width_map_from_snippet`
Nilstrieb [Tue, 27 Dec 2022 22:00:03 +0000 (23:00 +0100)]
Add enum for `find_width_map_from_snippet`

This makes the relationship between the vec and the boolean clearer.

18 months agoImprove heuristics whether `format_args` string is a source literal
Nilstrieb [Tue, 27 Dec 2022 21:15:25 +0000 (22:15 +0100)]
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.

18 months agobump dependencies
Ralf Jung [Wed, 28 Dec 2022 16:19:53 +0000 (17:19 +0100)]
bump dependencies

18 months agoprint sysroot build failure error
Ralf Jung [Wed, 28 Dec 2022 16:18:03 +0000 (17:18 +0100)]
print sysroot build failure error

18 months agoAdd GUI test for scraped examples colors
Guillaume Gomez [Wed, 28 Dec 2022 16:15:09 +0000 (17:15 +0100)]
Add GUI test for scraped examples colors

18 months agoMigrate scraped examples higlight CSS to variables
Guillaume Gomez [Wed, 28 Dec 2022 16:14:17 +0000 (17:14 +0100)]
Migrate scraped examples higlight CSS to variables

18 months agoClarify catch_unwind docs about panic hooks
Albert Larsan [Fri, 9 Dec 2022 13:57:57 +0000 (14:57 +0100)]
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.

18 months agoPowershell: Use `WaitForExit` instead of `-Wait`
Chris Denton [Wed, 28 Dec 2022 15:41:46 +0000 (15:41 +0000)]
Powershell: Use `WaitForExit` instead of `-Wait`

18 months ago-Zrustdoc-scrape-examples no longer takes arguments
Mark Rousskov [Wed, 28 Dec 2022 14:20:57 +0000 (09:20 -0500)]
-Zrustdoc-scrape-examples no longer takes arguments

18 months agofix custom mir doc tests
Lukas Markeffsky [Mon, 26 Dec 2022 21:40:14 +0000 (22:40 +0100)]
fix custom mir doc tests

18 months agofix documenting private items of standard library
Lukas Markeffsky [Mon, 19 Dec 2022 13:57:29 +0000 (14:57 +0100)]
fix documenting private items of standard library

18 months agodelete more `cfg(bootstrap)`
Lukas Markeffsky [Mon, 26 Dec 2022 21:01:53 +0000 (22:01 +0100)]
delete more `cfg(bootstrap)`

18 months agoUpdate bootstrap cfg
Pietro Albini [Thu, 15 Dec 2022 08:52:32 +0000 (09:52 +0100)]
Update bootstrap cfg

18 months agobump stage0
Pietro Albini [Thu, 15 Dec 2022 08:25:27 +0000 (09:25 +0100)]
bump stage0

18 months agoupdate stabilization version numbers
Pietro Albini [Mon, 12 Dec 2022 12:50:00 +0000 (13:50 +0100)]
update stabilization version numbers

18 months agoRollup merge of #106199 - estebank:quiet-type-err-in-binding, r=compiler-errors
Matthias Krüger [Wed, 28 Dec 2022 13:40:03 +0000 (14:40 +0100)]
Rollup merge of #106199 - estebank:quiet-type-err-in-binding, r=compiler-errors

Silence knock-down errors on `[type error]` bindings

Fix #56036, fix #76589.

18 months agoRollup merge of #106194 - notriddle:notriddle/sidebar-background, r=GuillaumeGomez
Matthias Krüger [Wed, 28 Dec 2022 13:40:02 +0000 (14:40 +0100)]
Rollup merge of #106194 - notriddle:notriddle/sidebar-background, r=GuillaumeGomez

rustdoc: combine common sidebar background color CSS rules

18 months agoRollup merge of #106176 - compiler-errors:fn-kw-as-fn-trait, r=estebank
Matthias Krüger [Wed, 28 Dec 2022 13:40:01 +0000 (14:40 +0100)]
Rollup merge of #106176 - compiler-errors:fn-kw-as-fn-trait, r=estebank

Recover `fn` keyword as `Fn` trait in bounds

`impl fn()` -> `impl Fn()`

Fixes #82515

18 months agoRollup merge of #106173 - compiler-errors:deduplicate-op-methods, r=jackh726
Matthias Krüger [Wed, 28 Dec 2022 13:40:01 +0000 (14:40 +0100)]
Rollup merge of #106173 - compiler-errors:deduplicate-op-methods, r=jackh726

Deduplicate `op` methods

There are some operator-checking flavored methods in `FnCtxt` that can be deduplicated.

18 months agoRollup merge of #106172 - estebank:suggest-impl-trait, r=compiler-errors
Matthias Krüger [Wed, 28 Dec 2022 13:40:00 +0000 (14:40 +0100)]
Rollup merge of #106172 - estebank:suggest-impl-trait, r=compiler-errors

Suggest `impl Iterator` when possible for `_` return type

Address #106096.

18 months agoRollup merge of #106028 - Ezrashaw:add-docs+test-e0461, r=GuillaumeGomez
Matthias Krüger [Wed, 28 Dec 2022 13:40:00 +0000 (14:40 +0100)]
Rollup merge of #106028 - Ezrashaw:add-docs+test-e0461, r=GuillaumeGomez

docs/test: add UI test and long-form error docs for `E0461`

Might take a couple of tries to pass CI. The UI test is x86-linux only; I'm not sure how to generalize it to other architectures.

r? ``@GuillaumeGomez``

18 months agoAuto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwU
bors [Wed, 28 Dec 2022 13:07:30 +0000 (13:07 +0000)]
Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwU

Some `compare_method` tweaks

1. Make some of the comparison functions' names more regular
2. Reduce pub scope of some of the things in `compare_method`
~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~
  * moved to a different PR
4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test.
5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :)
6. Rename `collect_trait_impl_trait_tys`

18 months agoAuto merge of #2743 - RalfJung:path-join, r=RalfJung
bors [Wed, 28 Dec 2022 11:45:18 +0000 (11:45 +0000)]
Auto merge of #2743 - RalfJung:path-join, r=RalfJung

simplify path joining code a bit

18 months agosimplify path joining code a bit
Ralf Jung [Wed, 28 Dec 2022 11:44:41 +0000 (12:44 +0100)]
simplify path joining code a bit

18 months agoAuto merge of #106209 - fee1-dead-contrib:rollup-47ysdcu, r=fee1-dead
bors [Wed, 28 Dec 2022 10:10:09 +0000 (10:10 +0000)]
Auto merge of #106209 - fee1-dead-contrib:rollup-47ysdcu, r=fee1-dead

Rollup of 9 pull requests

Successful merges:

 - #94145 (Test leaking of BinaryHeap Drain iterators)
 - #103945 (Remove `iter::Empty` hack)
 - #104024 (Fix `unused_must_use` warning for `Box::from_raw`)
 - #104708 (Fix backoff doc to match implementation)
 - #105347 (Account for `match` expr in single line)
 - #105484 (Implement allow-by-default `multiple_supertrait_upcastable` lint)
 - #106184 (Fix `core::any` docs)
 - #106201 (Emit fewer errors on invalid `#[repr(transparent)]` on `enum`)
 - #106205 (Remove some totally duplicated files in `rustc_infer`)

Failed merges:

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

18 months agoAuto merge of #2742 - RalfJung:targets, r=RalfJung
bors [Wed, 28 Dec 2022 09:51:40 +0000 (09:51 +0000)]
Auto merge of #2742 - RalfJung:targets, r=RalfJung

handle unknown targets more gracefully

In particular don't require a list of all OSes in the TLS machinery. Instead just fall back to doing nothing.

18 months agohandle unknown targets more gracefully
Ralf Jung [Tue, 27 Dec 2022 22:27:16 +0000 (23:27 +0100)]
handle unknown targets more gracefully

18 months agoadjust message on non-unwinding panic
Ralf Jung [Wed, 21 Dec 2022 12:55:54 +0000 (13:55 +0100)]
adjust message on non-unwinding panic

18 months agoRollup merge of #106205 - compiler-errors:oopsy, r=fee1-dead
fee1-dead [Wed, 28 Dec 2022 07:51:43 +0000 (15:51 +0800)]
Rollup merge of #106205 - compiler-errors:oopsy, r=fee1-dead

Remove some totally duplicated files in `rustc_infer`

I have no idea why or how I duplicated these files from `compiler/rustc_infer/src/infer/error_reporting/note.rs`, but I did by accident, and nothing caught it :facepalm:

18 months agoRollup merge of #106201 - estebank:verbose-transparent, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:42 +0000 (15:51 +0800)]
Rollup merge of #106201 - estebank:verbose-transparent, r=compiler-errors

Emit fewer errors on invalid `#[repr(transparent)]` on `enum`

Fix #68420.

18 months agoRollup merge of #106184 - albertlarsan68:docs-106154, r=Nilstrieb
fee1-dead [Wed, 28 Dec 2022 07:51:42 +0000 (15:51 +0800)]
Rollup merge of #106184 - albertlarsan68:docs-106154, r=Nilstrieb

Fix `core::any` docs

Thanks to ``@pbevin`` in #106154

Closes #106154

``@rustbot`` labels +A-docs

18 months agoRollup merge of #105484 - nbdd0121:upcast, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:41 +0000 (15:51 +0800)]
Rollup merge of #105484 - nbdd0121:upcast, r=compiler-errors

Implement allow-by-default `multiple_supertrait_upcastable` lint

The lint detects when an object-safe trait has multiple supertraits.

Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them.

r? `@nikomatsakis`

18 months agoRollup merge of #105347 - estebank:single-line-match, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:40 +0000 (15:51 +0800)]
Rollup merge of #105347 - estebank:single-line-match, r=compiler-errors

Account for `match` expr in single line

When encountering `match Some(42) { Some(x) => x, None => "" };`, output

```
error[E0308]: `match` arms have incompatible types
 --> f53.rs:2:52
  |
2 |     let _ = match Some(42) { Some(x) => x, None => "" };
  |             --------------              -          ^^ expected integer, found `&str`
  |             |                           |
  |             |                           this is found to be of type `{integer}`
  |             `match` arms have incompatible types
  ```

18 months agoRollup merge of #104708 - jonasspinner:fix-backoff-doc-to-match-implementation, r...
fee1-dead [Wed, 28 Dec 2022 07:51:40 +0000 (15:51 +0800)]
Rollup merge of #104708 - jonasspinner:fix-backoff-doc-to-match-implementation, r=compiler-errors

Fix backoff doc to match implementation

The commit 8dddb2294310ad3e8ce0b2af735a702ad72a9a99 in the crossbeam-channel PR (#93563) changed the backoff strategy to be quadratic instead of exponential. This updates the doc to prevent confusion.

18 months agoRollup merge of #104024 - noeddl:unused-must-use, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:39 +0000 (15:51 +0800)]
Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errors

Fix `unused_must_use` warning for `Box::from_raw`

18 months agoRollup merge of #103945 - H4x5:remove-iter-empty-hack, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:38 +0000 (15:51 +0800)]
Rollup merge of #103945 - H4x5:remove-iter-empty-hack, r=compiler-errors

Remove `iter::Empty` hack

`iter::Empty` uses a newtype to work around `#![feature(const_fn_fn_ptr_basics)]`, which has been stable since 1.61.0.

18 months agoRollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514
fee1-dead [Wed, 28 Dec 2022 07:51:37 +0000 (15:51 +0800)]
Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514

Test leaking of BinaryHeap Drain iterators

Add test cases about forgetting the `BinaryHeap::Drain` iterator, and slightly fortifies some other test cases.

Consists of separate commits that I don't think are relevant on their own (but I'll happily turn these into more PRs if desired).

18 months agoAuto merge of #103881 - ChayimFriedman2:patch-2, r=compiler-errors
bors [Wed, 28 Dec 2022 06:56:02 +0000 (06:56 +0000)]
Auto merge of #103881 - ChayimFriedman2:patch-2, r=compiler-errors

Clarify docs of `RefCell`

Comparison operators only panic if the `RefCell` is mutably borrowed, and `RefCell::swap()` can also panic if swapping a `RefCell` with itself.

18 months agoRemove some totally duplicated files
Michael Goulet [Wed, 28 Dec 2022 05:45:12 +0000 (05:45 +0000)]
Remove some totally duplicated files

18 months agobetter names and a comment
Michael Goulet [Wed, 28 Dec 2022 04:16:36 +0000 (04:16 +0000)]
better names and a comment

18 months agoRename module compare_method -> compare_impl_item
Michael Goulet [Sat, 24 Dec 2022 21:36:07 +0000 (21:36 +0000)]
Rename module compare_method -> compare_impl_item

18 months agomake some things less pub
Michael Goulet [Sat, 24 Dec 2022 21:35:11 +0000 (21:35 +0000)]
make some things less pub

18 months agoAuto merge of #100539 - joboet:horizon_timeout_clock, r=thomcc
bors [Wed, 28 Dec 2022 03:56:46 +0000 (03:56 +0000)]
Auto merge of #100539 - joboet:horizon_timeout_clock, r=thomcc

Use correct clock in `park_timeout` on Horizon

Horizon does not support using `CLOCK_MONOTONIC` with condition variables, so use the system time instead.

18 months agoEmit fewer errors on invalid `#[repr(transparent)]` on `enum`
Esteban Küber [Wed, 28 Dec 2022 02:28:02 +0000 (18:28 -0800)]
Emit fewer errors on invalid `#[repr(transparent)]` on `enum`

Fix #68420.

18 months agoSilence knock-down errors on `[type error]` bindings
Esteban Küber [Wed, 28 Dec 2022 01:57:39 +0000 (17:57 -0800)]
Silence knock-down errors on `[type error]` bindings

Fix #56036, fix #76589.

18 months agoAccount for `match` expr in single line
Esteban Küber [Tue, 6 Dec 2022 03:42:21 +0000 (19:42 -0800)]
Account for `match` expr in single line

When encountering `match Some(42) { Some(x) => x, None => "" };`, output

```
error[E0308]: `match` arms have incompatible types
 --> f53.rs:2:52
  |
2 |     let _ = match Some(42) { Some(x) => x, None => "" };
  |             --------------              -          ^^ expected integer, found `&str`
  |             |                           |
  |             |                           this is found to be of type `{integer}`
  |             `match` arms have incompatible types
  ```

18 months agoShorten type in note
Esteban Küber [Tue, 27 Dec 2022 22:11:41 +0000 (14:11 -0800)]
Shorten type in note

18 months agoreview comments
Esteban Küber [Tue, 27 Dec 2022 21:44:39 +0000 (13:44 -0800)]
review comments

18 months agoBump rust-installer
Mark Rousskov [Tue, 27 Dec 2022 21:27:27 +0000 (16:27 -0500)]
Bump rust-installer

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

18 months agoAdd changelog entry
Albert Larsan [Tue, 27 Dec 2022 21:19:56 +0000 (22:19 +0100)]
Add changelog entry

18 months agoImprove debug logs of `find_width_of_character_at_span`
Nilstrieb [Tue, 27 Dec 2022 20:24:35 +0000 (21:24 +0100)]
Improve debug logs of `find_width_of_character_at_span`

18 months agorustdoc: combine common sidebar background color CSS rules
Michael Howell [Tue, 27 Dec 2022 20:59:00 +0000 (13:59 -0700)]
rustdoc: combine common sidebar background color CSS rules

18 months agoAuto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errors
bors [Tue, 27 Dec 2022 20:54:06 +0000 (20:54 +0000)]
Auto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #103718 (More inference-friendly API for lazy)
 - #105765 (Detect likely `.` -> `..` typo in method calls)
 - #105852 (Suggest rewriting a malformed hex literal if we expect a float)
 - #105965 (Provide local extern function arg names)
 - #106064 (Partially fix `explicit_outlives_requirements` lint in macros)
 - #106179 (Fix a formatting error in Iterator::for_each docs)
 - #106181 (Fix doc comment parsing description in book)
 - #106187 (Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`)
 - #106189 (Fix UnsafeCell Documentation Spelling Error)

Failed merges:

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

18 months agoFix `core::any` mod-level docs
Albert Larsan [Tue, 27 Dec 2022 15:16:22 +0000 (16:16 +0100)]
Fix `core::any` mod-level docs

18 months agoRollup merge of #106189 - alexhrao:master, r=Nilstrieb
Michael Goulet [Tue, 27 Dec 2022 20:33:38 +0000 (12:33 -0800)]
Rollup merge of #106189 - alexhrao:master, r=Nilstrieb

Fix UnsafeCell Documentation Spelling Error

This fixes the spelling of "deallocated" (instead of the original "deallocted") In the `cell.rs` source file. Honestly probably not worth the time to evaluate, but since it doesn't involve any code change, I figure why not?