]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoAuto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
bors [Mon, 19 Dec 2022 19:21:35 +0000 (19:21 +0000)]
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino

Address some `EarlyBinder` nits

18 months agoAuto merge of #105698 - joboet:unsupported_threads_once, r=thomcc
bors [Mon, 19 Dec 2022 16:46:57 +0000 (16:46 +0000)]
Auto merge of #105698 - joboet:unsupported_threads_once, r=thomcc

Use a more efficient `Once` on platforms without threads

The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.

18 months agoAuto merge of #105892 - Dylan-DPC:rollup-eozolx4, r=Dylan-DPC
bors [Mon, 19 Dec 2022 09:23:31 +0000 (09:23 +0000)]
Auto merge of #105892 - Dylan-DPC:rollup-eozolx4, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #105682 (Use `expose_addr()` in `fmt::Pointer`)
 - #105839 (Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators)
 - #105864 (clippy::complexity fixes)
 - #105882 (Don't ICE in closure arg borrow suggestion)
 - #105889 (Fix `uninlined_format_args` in libtest)

Failed merges:

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

18 months agoRollup merge of #105889 - Nilstrieb:fmt-libtest, r=thomcc
Dylan DPC [Mon, 19 Dec 2022 09:11:37 +0000 (14:41 +0530)]
Rollup merge of #105889 - Nilstrieb:fmt-libtest, r=thomcc

Fix `uninlined_format_args` in libtest

Done using clippy with a quick manual review.

18 months agoRollup merge of #105882 - compiler-errors:issue-105832, r=jackh726
Dylan DPC [Mon, 19 Dec 2022 09:11:36 +0000 (14:41 +0530)]
Rollup merge of #105882 - compiler-errors:issue-105832, r=jackh726

Don't ICE in closure arg borrow suggestion

Fixes #105832

18 months agoRollup merge of #105864 - matthiaskrgr:compl, r=Nilstrieb
Dylan DPC [Mon, 19 Dec 2022 09:11:35 +0000 (14:41 +0530)]
Rollup merge of #105864 - matthiaskrgr:compl, r=Nilstrieb

clippy::complexity fixes

filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool

r? `@compiler-errors`

18 months agoRollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnr
Dylan DPC [Mon, 19 Dec 2022 09:11:35 +0000 (14:41 +0530)]
Rollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnr

Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators

Right now, we suggest a `T: Sync` bound for both `&T` and `&mut T` upvars. A user on URLO [found this confusing](https://users.rust-lang.org/t/error-complains-about-missing-sync-but-send-is-whats-missing/86021), so I wrote this quick fix to look at the mutability before making the suggestion.

18 months agoRollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung
Dylan DPC [Mon, 19 Dec 2022 09:11:34 +0000 (14:41 +0530)]
Rollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung

Use `expose_addr()` in `fmt::Pointer`

Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided).

CC `@RalfJung`

18 months agoFix `uninlined_format_args` in libtest
nils [Mon, 19 Dec 2022 07:48:30 +0000 (08:48 +0100)]
Fix `uninlined_format_args` in libtest

18 months agoAuto merge of #105845 - lqd:revert-thinlto-revert, r=Mark-Simulacrum
bors [Mon, 19 Dec 2022 06:25:22 +0000 (06:25 +0000)]
Auto merge of #105845 - lqd:revert-thinlto-revert, r=Mark-Simulacrum

Re-enable ThinLTO for rustc on `x86_64-apple-darwin`

ThinLTO was disabled on x64 mac in https://github.com/rust-lang/rust/pull/105646 because of the https://github.com/rust-lang/rust/issues/105637 regression.

It was later discovered that the issue was present on other targets as well, as the mac revert was already landing. The linux/win reverts, however, did not land before the root cause was identified.

https://github.com/rust-lang/rust/pull/105800 fixed the underlying issue in `-Zdylib-lto` handling, and the x64 msvc and linux targets are now fixed, ICEs are using the correct `rustc_driver` panic hook.

This PR re-enables ThinLTO on mac for improved perf now that the issue should be fixed everywhere.

18 months agoAuto merge of #105884 - weihanglo:update-cargo, r=weihanglo
bors [Mon, 19 Dec 2022 03:36:34 +0000 (03:36 +0000)]
Auto merge of #105884 - weihanglo:update-cargo, r=weihanglo

Update cargo

11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415 2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)

r? `@ghost`

18 months agoAuto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgr
bors [Mon, 19 Dec 2022 01:13:58 +0000 (01:13 +0000)]
Auto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #105419 (Add tests for #41731)
 - #105447 (Add a test for #103095)
 - #105842 (print argument name in arg mismatch if possible)
 - #105863 (Update browser-ui-test version to reduce GUI tests flakyness)
 - #105867 (remove redundant fn params that were only "used" in recursion)
 - #105869 (don't clone Copy types)
 - #105873 (use &str / String literals instead of format!())
 - #105879 (Revert "Introduce lowering_arena to avoid creating AST nodes on the fly")

Failed merges:

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

18 months agoUpdate cargo
Weihang Lo [Sun, 18 Dec 2022 23:39:39 +0000 (23:39 +0000)]
Update cargo

11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415
2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)

18 months agoclippy::complexity fixes
Matthias Krüger [Sun, 18 Dec 2022 11:45:56 +0000 (12:45 +0100)]
clippy::complexity fixes

filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool

18 months agoRollup merge of #105879 - Nilstrieb:revert-hir-arena, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 22:03:08 +0000 (23:03 +0100)]
Rollup merge of #105879 - Nilstrieb:revert-hir-arena, r=oli-obk

Revert "Introduce lowering_arena to avoid creating AST nodes on the fly"

This reverts commit d9a1faaa9cff6eab069ea8e5cd7862d0ae48e231 (#101499).

This was originally part of #101345 which has now been closed as a different approach is taken now.

r? `@oli-obk`

cc `@spastorino`

18 months agoRollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb
Matthias Krüger [Sun, 18 Dec 2022 22:03:07 +0000 (23:03 +0100)]
Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb

use &str / String literals instead of format!()

18 months agoRollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 22:03:07 +0000 (23:03 +0100)]
Rollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errors

don't clone Copy types

18 months agoRollup merge of #105867 - matthiaskrgr:rec_param, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 22:03:06 +0000 (23:03 +0100)]
Rollup merge of #105867 - matthiaskrgr:rec_param, r=compiler-errors

remove redundant fn params that were only "used" in recursion

18 months agoRollup merge of #105863 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Matthias Krüger [Sun, 18 Dec 2022 22:03:06 +0000 (23:03 +0100)]
Rollup merge of #105863 - GuillaumeGomez:update-browser-ui-test, r=notriddle

Update browser-ui-test version to reduce GUI tests flakyness

Part of https://github.com/rust-lang/rust/issues/93784.

r? `@notriddle`

18 months agoRollup merge of #105842 - compiler-errors:arg-name-sugg, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:05 +0000 (23:03 +0100)]
Rollup merge of #105842 - compiler-errors:arg-name-sugg, r=petrochenkov

print argument name in arg mismatch if possible

A bit more contextual than just `/* value */`, at least when the argument is named something related to its context.

The UI test cases are... not super convincing, but also they're minimized tests.

18 months agoRollup merge of #105447 - TaKO8Ki:add-test-for-103095, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:05 +0000 (23:03 +0100)]
Rollup merge of #105447 - TaKO8Ki:add-test-for-103095, r=petrochenkov

Add a test for #103095

closes #103095

18 months agoRollup merge of #105419 - YC:issue-41731, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:04 +0000 (23:03 +0100)]
Rollup merge of #105419 - YC:issue-41731, r=petrochenkov

Add tests for #41731

Closes #41731

18 months agoAuto merge of #105446 - erikdesjardins:vt-size, r=nikic
bors [Sun, 18 Dec 2022 22:01:39 +0000 (22:01 +0000)]
Auto merge of #105446 - erikdesjardins:vt-size, r=nikic

Add 0..=isize::MAX range metadata to size loads from vtables

This is the (much belated) size counterpart to #91569.

Inspired by https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Range.20metadata.20for.20.60size_of_val.60.20and.20other.20isize.3A.3AMAX.20limits. This could help optimize layout computations based on the size of a dyn trait. Though, admittedly, adding this to vtables wouldn't be as beneficial as adding it to slice len, which is used much more often.

Miri detects this UB already: https://github.com/rust-lang/rust/blob/b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573/compiler/rustc_const_eval/src/interpret/traits.rs#L119-L121
(In fact Miri goes further, [assuming a 48-bit address space on 64-bit platforms](https://github.com/rust-lang/rust/blob/9db224fc908059986c179fc6ec433944e9cfce50/compiler/rustc_abi/src/lib.rs#L312-L331), but I don't think we can assume that in an optimization.)

18 months agoDon't ICE in closure arg borrow suggestion
Michael Goulet [Sun, 18 Dec 2022 21:41:08 +0000 (21:41 +0000)]
Don't ICE in closure arg borrow suggestion

18 months agoRevert "Introduce lowering_arena to avoid creating AST nodes on the fly"
Nilstrieb [Sun, 18 Dec 2022 19:28:59 +0000 (20:28 +0100)]
Revert "Introduce lowering_arena to avoid creating AST nodes on the fly"

This reverts commit d9a1faaa9cff6eab069ea8e5cd7862d0ae48e231.

This was originally part of a larger PR that has now been closed as a
different approach is taken now.

18 months agoAuto merge of #105876 - matthiaskrgr:rollup-a9dgzjt, r=matthiaskrgr
bors [Sun, 18 Dec 2022 18:44:37 +0000 (18:44 +0000)]
Auto merge of #105876 - matthiaskrgr:rollup-a9dgzjt, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #96584 (Fix `x setup -h -v` should work)
 - #105420 (Remove dead code after destination propagation)
 - #105844 (Make the x tool use the x and x.ps1 scripts)
 - #105854 (remove redundant clone)
 - #105858 (Another `as_chunks` example)
 - #105870 (avoid .into() conversion to identical types)
 - #105875 (don't destuct references just to reborrow)

Failed merges:

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

18 months agoRollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 17:57:05 +0000 (18:57 +0100)]
Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obk

don't destuct references just to reborrow

18 months agoRollup merge of #105870 - matthiaskrgr:useless_conv, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 17:57:05 +0000 (18:57 +0100)]
Rollup merge of #105870 - matthiaskrgr:useless_conv, r=oli-obk

avoid .into() conversion to identical types

18 months agoRollup merge of #105858 - scottmcm:extra-as-chunks-example, r=the8472
Matthias Krüger [Sun, 18 Dec 2022 17:57:04 +0000 (18:57 +0100)]
Rollup merge of #105858 - scottmcm:extra-as-chunks-example, r=the8472

Another `as_chunks` example

I really liked this structure that dtolney brought up in #105316, so wanted to put it in the docs to help others use it.

18 months agoRollup merge of #105854 - matthiaskrgr:rmclone, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105854 - matthiaskrgr:rmclone, r=compiler-errors

remove redundant clone

18 months agoRollup merge of #105844 - albertlarsan68:x-rewrite, r=jyn514
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105844 - albertlarsan68:x-rewrite, r=jyn514

Make the x tool use the x and x.ps1 scripts

This removes another python search from bootstrap.

r? `@jyn514`

18 months agoRollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegen
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegen

Remove dead code after destination propagation

Fixes #105428.

cc `@JakobDegen`

18 months agoRollup merge of #96584 - bentongxyz:x-setup-h-v-should-work, r=jyn514
Matthias Krüger [Sun, 18 Dec 2022 17:57:02 +0000 (18:57 +0100)]
Rollup merge of #96584 - bentongxyz:x-setup-h-v-should-work, r=jyn514

Fix `x setup -h -v` should work

r? `@jyn514`

I have to convert profile to path and back in order to remove special-casing in bootstrap. I also check for `dry_run` so that `config.toml` and/ or `.git/hooks/pre-push` will not be created if `--dry-run` is specified.

Please help me see if this is ok, thanks alot!

18 months agoUpdate browser-ui-test version to reduce GUI tests flakyness
Guillaume Gomez [Sun, 18 Dec 2022 10:42:30 +0000 (11:42 +0100)]
Update browser-ui-test version to reduce GUI tests flakyness

18 months agoMake x use the x and x.ps1 scripts
Albert Larsan [Sun, 18 Dec 2022 17:07:48 +0000 (18:07 +0100)]
Make x use the x and x.ps1 scripts

This removes another python search from bootstrap.

18 months agodon't restuct references just to reborrow
Matthias Krüger [Sun, 18 Dec 2022 16:01:58 +0000 (17:01 +0100)]
don't restuct references just to reborrow

18 months agoAuto merge of #105714 - jyn514:tidy-first, r=Mark-Simulacrum
bors [Sun, 18 Dec 2022 16:03:46 +0000 (16:03 +0000)]
Auto merge of #105714 - jyn514:tidy-first, r=Mark-Simulacrum

Run `x test tidy` sooner in mingw-check

It takes less time to run than the other tests and is more likely to fail. `expand-yaml-anchors` is still run first to make sure the CI files are internally consistent.

Note that changing to `--stage 0` doesn't actually do anything since bootstrap tools are always built with the bootstrap compiler, this just makes it less confusing.

cc https://github.com/rust-lang/rust/pull/105058/commits/83bab41b5b2d4752d187dd91b05c88ac74cf3783

18 months agoavoid .into() conversion to identical types
Matthias Krüger [Sun, 18 Dec 2022 14:01:26 +0000 (15:01 +0100)]
avoid .into() conversion to identical types

18 months agouse &str / String literals instead of format!()
Matthias Krüger [Sun, 18 Dec 2022 15:17:46 +0000 (16:17 +0100)]
use &str / String literals instead of format!()

18 months agoremove redundant fn params that were only "used" in recursion
Matthias Krüger [Sun, 18 Dec 2022 12:51:40 +0000 (13:51 +0100)]
remove redundant fn params that were only "used" in recursion

18 months agodon't clone Copy types
Matthias Krüger [Sun, 18 Dec 2022 13:25:55 +0000 (14:25 +0100)]
don't clone Copy types

18 months agoAuto merge of #104417 - mejrs:mir_build, r=davidtwco
bors [Sun, 18 Dec 2022 08:53:49 +0000 (08:53 +0000)]
Auto merge of #104417 - mejrs:mir_build, r=davidtwco

Migrate rustc_mir_build diagnostics

Rebases https://github.com/rust-lang/rust/pull/100854

~~The remaining issue is how to better resolve https://github.com/rust-lang/rust/commit/72bea68af4ee2a41c44998916f6a789163f12e7d~~

~~The diagnostic macros seems to generate a broken diagnostic, and I couldn't figure out how to manually format the fluent message, so I hardcoded the format string for now. I'd like pointers to a better fix for this.~~

Also, I'm not 100% sure I didn't mess up a rebase somewhere 🙂

r? `@davidtwco`

18 months agoAuto merge of #105638 - tavianator:fix-50619-again, r=Mark-Simulacrum
bors [Sun, 18 Dec 2022 05:04:04 +0000 (05:04 +0000)]
Auto merge of #105638 - tavianator:fix-50619-again, r=Mark-Simulacrum

fs: Fix #50619 (again) and add a regression test

Bug #50619 was fixed by adding an end_of_stream flag in #50630.
Unfortunately, that fix only applied to the readdir_r() path.  When I
switched Linux to use readdir() in #92778, I inadvertently reintroduced
the bug on that platform.  Other platforms that had always used
readdir() were presumably never fixed.

This patch enables end_of_stream for all platforms, and adds a
Linux-specific regression test that should hopefully prevent the bug
from being reintroduced again.

18 months agoAnother `as_chunks` example
Scott McMurray [Sun, 18 Dec 2022 02:41:14 +0000 (18:41 -0800)]
Another `as_chunks` example

I really liked this structure that dtolney brought up in #105316, so wanted to put it in the docs to help others use it.

18 months agoAuto merge of #105617 - bjorn3:update_crossbeam, r=Mark-Simulacrum
bors [Sun, 18 Dec 2022 02:17:54 +0000 (02:17 +0000)]
Auto merge of #105617 - bjorn3:update_crossbeam, r=Mark-Simulacrum

Update crossbeam

This fixes builds for Gentoo

This should fix https://github.com/rust-lang/rust/issues/104866 (cc `@stefson)`

18 months agoremove redundant clone
Matthias Krüger [Sat, 17 Dec 2022 23:29:25 +0000 (00:29 +0100)]
remove redundant clone

18 months agoAuto merge of #105849 - matthiaskrgr:rollup-ya4s1n2, r=matthiaskrgr
bors [Sat, 17 Dec 2022 23:27:53 +0000 (23:27 +0000)]
Auto merge of #105849 - matthiaskrgr:rollup-ya4s1n2, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104854 (Symlink `build/host` -> `build/$HOST_TRIPLE`)
 - #105458 (Allow blocking `Command::output`)
 - #105559 (bootstrap: Allow installing `llvm-tools`)
 - #105789 (rustdoc: clean up margin CSS for scraped examples)
 - #105792 (docs: add long error explanation for error E0320)
 - #105814 (Support call and drop terminators in custom mir)
 - #105829 (Speed up tidy)
 - #105836 (std::fmt: Use args directly in example code)

Failed merges:

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

18 months agoRemove special cases for setup subcommand
Benjamin Tong [Sat, 30 Apr 2022 16:50:00 +0000 (00:50 +0800)]
Remove special cases for setup subcommand

- Remove setup special-casing in Flags::parse

18 months agoRollup merge of #105836 - evanj:fmt-doc-use-variables, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Dec 2022 22:44:29 +0000 (23:44 +0100)]
Rollup merge of #105836 - evanj:fmt-doc-use-variables, r=Mark-Simulacrum

std::fmt: Use args directly in example code

The lint "clippy::uninlined_format_args" recommends inline variables in format strings. Fix two places in the docs that do not do this. I noticed this because I copy/pasted one example in to my project, then noticed this lint error. This fixes:

```
error: variables can be used directly in the `format!` string
  --> src/main.rs:30:22
   |
30 |         let string = format!("{:.*}", decimals, magnitude);
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: variables can be used directly in the `format!` string
  --> src/main.rs:39:2
   |
39 |  write!(&mut io::stdout(), "{}", args).unwrap();
```

18 months agoRollup merge of #105829 - the8472:tidy-style, r=jyn514
Matthias Krüger [Sat, 17 Dec 2022 22:44:29 +0000 (23:44 +0100)]
Rollup merge of #105829 - the8472:tidy-style, r=jyn514

Speed up tidy

This can be reviewed commit by commit since they contain separate optimizations.

```
# master
$ taskset -c 0-5 hyperfine './x test tidy'
Benchmark #1: ./x test tidy
  Time (mean ± σ):      4.857 s ±  0.064 s    [User: 12.967 s, System: 2.014 s]
  Range (min … max):    4.779 s …  4.997 s    10 runs

# PR
$ taskset -c 0-5 hyperfine './x test tidy'
Benchmark #1: ./x test tidy
  Time (mean ± σ):      3.672 s ±  0.035 s    [User: 10.524 s, System: 2.029 s]
  Range (min … max):    3.610 s …  3.725 s    10 runs
```

18 months agoRollup merge of #105814 - JakobDegen:custom-mir-terms, r=oli-obk
Matthias Krüger [Sat, 17 Dec 2022 22:44:28 +0000 (23:44 +0100)]
Rollup merge of #105814 - JakobDegen:custom-mir-terms, r=oli-obk

Support call and drop terminators in custom mir

The only caveat with this change is that cleanup blocks are not supported. I would like to add them, but it's not quite clear to me what the best way to do that is, so I'll have to think about it some more.

r? ``@oli-obk``

18 months agoRollup merge of #105792 - Ezrashaw:add-e0320-long-docs, r=GuillaumeGomez
Matthias Krüger [Sat, 17 Dec 2022 22:44:28 +0000 (23:44 +0100)]
Rollup merge of #105792 - Ezrashaw:add-e0320-long-docs, r=GuillaumeGomez

docs: add long error explanation for error E0320

Continuation of #105791

r? ``@GuillaumeGomez``

18 months agoRollup merge of #105789 - notriddle:notriddle/examples-margin, r=GuillaumeGomez
Matthias Krüger [Sat, 17 Dec 2022 22:44:27 +0000 (23:44 +0100)]
Rollup merge of #105789 - notriddle:notriddle/examples-margin, r=GuillaumeGomez

rustdoc: clean up margin CSS for scraped examples

* This stops applying a margin to the additional example links. Because these links are `display: inline`, it doesn't actually do anything.
* This switches from using a margin-bottom with a special exception for the examples themselves, plus an additional margin on the hide button, to instead using just margin-top on the examples, with an exception for the first one.

No user-visible changes should result from this.

18 months agoRollup merge of #105559 - mkroening:install-llvm-tools, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Dec 2022 22:44:26 +0000 (23:44 +0100)]
Rollup merge of #105559 - mkroening:install-llvm-tools, r=Mark-Simulacrum

bootstrap: Allow installing `llvm-tools`

This PR allows installing the `llvm-tools` dist tarball using `./x.py install`.

18 months agoRollup merge of #105458 - Ayush1325:blocking_spawn, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Dec 2022 22:44:26 +0000 (23:44 +0100)]
Rollup merge of #105458 - Ayush1325:blocking_spawn, r=Mark-Simulacrum

Allow blocking `Command::output`

### Problem
Currently, `Command::output` is internally implemented using `Command::spawn`. This is problematic because some targets (like UEFI) do not actually support multitasking and thus block while the program is executing. This coupling does not make much sense as `Command::output` is supposed to block until the execution is complete anyway and thus does not need to rely on a non-blocking `Child` or any other intermediate.

### Solution
This PR moves the implementation of `Command::output` to `std::sys`. This means targets can choose to implement only `Command::output` without having to implement `Command::spawn`.

### Additional Information

This was originally conceived when working on https://github.com/rust-lang/rust/pull/100316. Currently, the only target I know about that will benefit from this change is UEFI.

This PR can also be used to implement more efficient `Command::output` since the intermediate `Process` is not actually needed anymore, but that is outside the scope of this PR.

Since this is not a public API change, I'm not sure if an RFC is needed or not.

18 months agoRollup merge of #104854 - jyn514:sysroot-symlink, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Dec 2022 22:44:25 +0000 (23:44 +0100)]
Rollup merge of #104854 - jyn514:sysroot-symlink, r=Mark-Simulacrum

Symlink `build/host` -> `build/$HOST_TRIPLE`

(as appropriate per target)

This allows us to use a consistent path in the documentation, without having to worry about which platform people are using.

18 months agoRe-enable ThinLTO for rustc on x86_64-apple-darwin dist builds
Rémy Rakic [Sat, 17 Dec 2022 21:55:08 +0000 (21:55 +0000)]
Re-enable ThinLTO for rustc on x86_64-apple-darwin dist builds

This reverts commit ddb6fe2e1d270d23ec09c2cb435c22229830e97c.

18 months agoprint argument name in arg mismatch if possible
Michael Goulet [Sat, 17 Dec 2022 20:59:23 +0000 (20:59 +0000)]
print argument name in arg mismatch if possible

18 months agoSymlink `build/host` -> `build/x86_64-unknown-linux-gnu` (as appropriate per target)
Joshua Nelson [Fri, 25 Nov 2022 01:39:40 +0000 (20:39 -0500)]
Symlink `build/host` -> `build/x86_64-unknown-linux-gnu` (as appropriate per target)

This allows us to use a consistent path in the documentation, without having to worry about which platform people are using.

18 months agoAuto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
bors [Sat, 17 Dec 2022 20:47:14 +0000 (20:47 +0000)]
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum

Add batch flag to remote-test-server

When using this flag, the stdout and stderr are sent in a single batch instead of being streamed. It also used `Command::output` instead of `Command::spawn`. This is useful for targets that might support std but not threading (Eg: UEFI).

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
18 months agoSuggest a `T: Send` bound for `&mut T` upvars in `Send` generators
Matthew House [Sat, 17 Dec 2022 20:15:57 +0000 (15:15 -0500)]
Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators

18 months agoMake `RUN_CHECK_WITH_PARALLEL_QUERIES` the last thing to run
Joshua Nelson [Wed, 14 Dec 2022 19:48:44 +0000 (13:48 -0600)]
Make `RUN_CHECK_WITH_PARALLEL_QUERIES` the last thing to run

This takes a long time and rarely fails. It also interferes with `retry make prepare`, the retry is unhelpful since `make prepare` turns into a no-op

18 months agoTry to fix ICE
mejrs [Sat, 17 Dec 2022 19:11:25 +0000 (20:11 +0100)]
Try to fix ICE

18 months agostd::fmt: Use args directly in example code
Evan Jones [Sat, 17 Dec 2022 18:43:08 +0000 (13:43 -0500)]
std::fmt: Use args directly in example code

The lint "clippy::uninlined_format_args" recommends inline
variables in format strings. Fix two places in the docs that do
not do this. I noticed this because I copy/pasted one example in
to my project, then noticed this lint error. This fixes:

error: variables can be used directly in the `format!` string
  --> src/main.rs:30:22
   |
30 |         let string = format!("{:.*}", decimals, magnitude);
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: variables can be used directly in the `format!` string
  --> src/main.rs:39:2
   |
39 |  write!(&mut io::stdout(), "{}", args).unwrap();

18 months agoRemove (eager)
mejrs [Sat, 17 Dec 2022 18:20:44 +0000 (19:20 +0100)]
Remove (eager)

18 months agoResolve various merge conflicts
mejrs [Sat, 26 Nov 2022 20:22:49 +0000 (21:22 +0100)]
Resolve various merge conflicts

18 months agoMigrate multiple mut borrows diagnostic
TheOddGarlic [Tue, 30 Aug 2022 17:38:10 +0000 (20:38 +0300)]
Migrate multiple mut borrows diagnostic

18 months agoMigrate borrow of moved value diagnostic
TheOddGarlic [Tue, 30 Aug 2022 17:01:28 +0000 (20:01 +0300)]
Migrate borrow of moved value diagnostic

18 months agoMigrate irrefutable let pattern diagnostics
TheOddGarlic [Mon, 29 Aug 2022 08:21:25 +0000 (11:21 +0300)]
Migrate irrefutable let pattern diagnostics

18 months agoMigrate pattern bindings with variant name lint
TheOddGarlic [Mon, 29 Aug 2022 07:06:50 +0000 (10:06 +0300)]
Migrate pattern bindings with variant name lint

18 months agoMigrate leading/trailing irrefutable let pattern diagnostics
TheOddGarlic [Sun, 28 Aug 2022 18:48:09 +0000 (21:48 +0300)]
Migrate leading/trailing irrefutable let pattern diagnostics

18 months agoMigrate lower range bound diagnostics
TheOddGarlic [Sat, 27 Aug 2022 19:48:18 +0000 (22:48 +0300)]
Migrate lower range bound diagnostics

18 months agoMigrate "could not evaluate const pattern" diagnostic
TheOddGarlic [Sat, 27 Aug 2022 19:25:09 +0000 (22:25 +0300)]
Migrate "could not evaluate const pattern" diagnostic

18 months agoMigrate "constant pattern depends on generic parameter" diagnostic
TheOddGarlic [Sat, 27 Aug 2022 19:17:10 +0000 (22:17 +0300)]
Migrate "constant pattern depends on generic parameter" diagnostic

18 months agoMigrate unreachable pattern diagnostic
TheOddGarlic [Sat, 27 Aug 2022 19:06:06 +0000 (22:06 +0300)]
Migrate unreachable pattern diagnostic

18 months agoMigrate pattern inlining error diagnostics
TheOddGarlic [Fri, 26 Aug 2022 16:30:33 +0000 (19:30 +0300)]
Migrate pattern inlining error diagnostics

18 months agoMigrate "non-exhaustive patterns: type is non-empty" diagnostic
TheOddGarlic [Fri, 26 Aug 2022 13:38:21 +0000 (16:38 +0300)]
Migrate "non-exhaustive patterns: type is non-empty" diagnostic

18 months agoMigrate "unused unsafe" lint
TheOddGarlic [Wed, 24 Aug 2022 17:16:50 +0000 (20:16 +0300)]
Migrate "unused unsafe" lint

18 months agoMigrate "requires unsafe" diagnostics
TheOddGarlic [Wed, 24 Aug 2022 08:01:53 +0000 (11:01 +0300)]
Migrate "requires unsafe" diagnostics

18 months agoMigrate "unsafe_op_in_unsafe_fn" lints
TheOddGarlic [Sat, 20 Aug 2022 20:54:58 +0000 (23:54 +0300)]
Migrate "unsafe_op_in_unsafe_fn" lints

18 months agoMigrate "function cannot return without recursing" diagnostic
TheOddGarlic [Sat, 20 Aug 2022 11:28:43 +0000 (14:28 +0300)]
Migrate "function cannot return without recursing" diagnostic

18 months agoAuto merge of #105827 - flip1995:clippyup, r=matthiaskrgr
bors [Sat, 17 Dec 2022 18:06:32 +0000 (18:06 +0000)]
Auto merge of #105827 - flip1995:clippyup, r=matthiaskrgr

Update Clippy

r? `@Manishearth`

18 months agoAuto merge of #105800 - lqd:dylib-thinlto, r=bjorn3
bors [Sat, 17 Dec 2022 14:51:10 +0000 (14:51 +0000)]
Auto merge of #105800 - lqd:dylib-thinlto, r=bjorn3

Don't copy symbols from dylibs with `-Zdylib-lto`

When `rustc_driver` started being built with `-Zdylib-lto -Clto=thin`, some libstd symbols were copied by the LTO process into the dylib. That causes duplicate local symbols that are not present otherwise.

Depending on the situation (lib loading order apparently), the duplicated symbols could cause issues: `rustc_driver` overrode the panic hook, but it didn't apply to rustc main's hook (the default from libstd). This is the cause of #105637, in some situations the panic hook installed by `rustc_driver` isn't executed, and only libstd's backtrace is shown (and a double panic). The query stack, as well as the various notes to open a GH about the ICE, don't appear.

It's not clear exactly what is needed to trigger the issue, but I have simulated a reproducer [here](https://github.com/lqd/issue-105637) with cargo involved, the incorrect panic hook is executed on my machine. It is hard to reproduce in a unit test: `cargo run` + `rustup` involves LD_LIBRARY_PATH, which is not the case for `compiletest`. cargo also adds unconditional flags that are then overridden in [`bootstrap` when building rustc with `rust.lto = thin`](https://github.com/rust-lang/rust/blob/9c07efe84f28a44f3044237696acc295aa407ee5/src/bootstrap/compile.rs#L702-L714) as done on CI).

All this to say the compilation and execution environment in `bootstrap` leading to the bug building `rustc_driver` is different from our UI tests, and I believe one of the reasons it's hard to make an exact reproducer test. Thankfully there's _still_ a difference in the behavior though: although in the unit test the correct panic hook seems to be executed compared to my repro and the current nightly, only the fix removes the double panic here.

The `7e8277aefa12f1469fb1df01418ff5846a7854a9` `try` build:
- fixes the reproducer repo linked above
- restores the ICE messages from https://github.com/rust-lang/rust/issues/105321 back to the state in its OP compared to the description in https://github.com/rust-lang/rust/issues/105637
- restores the ICE message and the query stack from https://github.com/rust-lang/rust/issues/105777 compared to nightly

While I believe this technically fixes the P-critical issue https://github.com/rust-lang/rust/issues/105637, I would not want to close it yet as we may want to backport to beta/stable (if a point release happens, it would fix the ICEs reported on 1.66.0, which is built with ThinLTO on linux). Once this PR lands, I'll also open another PR to re-enable ThinLTO on x64 darwin's dist builder.

18 months agopoll rustfmt child processes
The 8472 [Mon, 21 Nov 2022 23:38:50 +0000 (00:38 +0100)]
poll rustfmt child processes

18 months agopoll tidy threads for completion before waiting
The 8472 [Mon, 21 Nov 2022 23:30:05 +0000 (00:30 +0100)]
poll tidy threads for completion before waiting

18 months agooptimize line-by-line style checks in tidy
The 8472 [Mon, 21 Nov 2022 23:25:43 +0000 (00:25 +0100)]
optimize line-by-line style checks in tidy

18 months agoUpdate Cargo.lock
Philipp Krones [Sat, 17 Dec 2022 13:21:37 +0000 (14:21 +0100)]
Update Cargo.lock

18 months agoMerge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyup
Philipp Krones [Sat, 17 Dec 2022 13:12:54 +0000 (14:12 +0100)]
Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyup

18 months agoAuto merge of #10097 - flip1995:rustup, r=flip1995
bors [Sat, 17 Dec 2022 13:08:47 +0000 (13:08 +0000)]
Auto merge of #10097 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

I'm on the train and my internet is too bad to download the necessary toolchain, so I have to use CI to find sync fallout.

changelog: none
<!-- changelog_checked -->

18 months agoBump nightly version -> 2022-12-17
Philipp Krones [Sat, 17 Dec 2022 12:57:48 +0000 (13:57 +0100)]
Bump nightly version -> 2022-12-17

18 months agoBump Clippy version -> 0.1.68
Philipp Krones [Sat, 17 Dec 2022 12:57:41 +0000 (13:57 +0100)]
Bump Clippy version -> 0.1.68

18 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Sat, 17 Dec 2022 12:14:57 +0000 (13:14 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

18 months agoAuto merge of #10096 - feniljain:fix-seek-rewind, r=xFrednet
bors [Sat, 17 Dec 2022 12:35:26 +0000 (12:35 +0000)]
Auto merge of #10096 - feniljain:fix-seek-rewind, r=xFrednet

fix: not suggest seek_to_start_instead_of_rewind when expr is used

changelog: [`seek_to_start_instead_of_rewind`]: No longer lints, if the return of `seek` is used.
[#10096](https://github.com/rust-lang/rust-clippy/pull/10096)
<!-- changelog_checked -->

Fixes #10065

18 months agoAuto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa
bors [Sat, 17 Dec 2022 12:10:27 +0000 (12:10 +0000)]
Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa

Check AArch64 branch-protection earlier in the pipeline.

As suggested in #93516.

r? `@nagisa`

18 months agofix: not suggest seek_to_start_instead_of_rewind when expr is used
feniljain [Sat, 17 Dec 2022 11:54:03 +0000 (17:24 +0530)]
fix: not suggest seek_to_start_instead_of_rewind when expr is used

18 months agoAuto merge of #10094 - EricWu2003:increment-visitor-fix, r=xFrednet
bors [Sat, 17 Dec 2022 11:36:50 +0000 (11:36 +0000)]
Auto merge of #10094 - EricWu2003:increment-visitor-fix, r=xFrednet

fix logic in IncrementVisitor

There used to be a logical bug where IncrementVisitor would completely stop checking an expression/block after seeing a continue statement.

I am a little unsure of whether my fix to `IncrementVisitor` is logically sound (I hope it makes sense). Let me know what you think, and thanks in advance for the review!

fixes #10058

---

changelog: FP: [`explicit_counter_loop`]: No longer ignores counter changes after `continue` expressions
[#10094](https://github.com/rust-lang/rust-clippy/pull/10094)
<!-- changelog_checked -->

18 months agoAuto merge of #105820 - matthiaskrgr:rollup-uzm1l8f, r=matthiaskrgr
bors [Sat, 17 Dec 2022 09:08:07 +0000 (09:08 +0000)]
Auto merge of #105820 - matthiaskrgr:rollup-uzm1l8f, r=matthiaskrgr

Rollup of 2 pull requests

Successful merges:

 - #105770 (Rename ConstS to ConstData)
 - #105785 (Add regression test for #55976)

Failed merges:

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

18 months agoRollup merge of #105785 - JohnTitor:issue-55976-2, r=compiler-errors
Matthias Krüger [Sat, 17 Dec 2022 08:25:53 +0000 (09:25 +0100)]
Rollup merge of #105785 - JohnTitor:issue-55976-2, r=compiler-errors

Add regression test for #55976

Closes #55976
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105770 - oli-obk:deref_all_the_things, r=compiler-errors
Matthias Krüger [Sat, 17 Dec 2022 08:25:53 +0000 (09:25 +0100)]
Rollup merge of #105770 - oli-obk:deref_all_the_things, r=compiler-errors

Rename ConstS to ConstData

just a style nit to get it in sync with all the other interned datastructures

18 months agoAuto merge of #105794 - ChrisDenton:internal-doc, r=jyn514
bors [Sat, 17 Dec 2022 06:27:30 +0000 (06:27 +0000)]
Auto merge of #105794 - ChrisDenton:internal-doc, r=jyn514

Add CI test for documentation of hidden items in std

Fixes #87844

r? `@jyn514`