Commit Graph

213008 Commits

Author SHA1 Message Date
Matthias Krüger
c16b969f1d
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`
2022-12-18 18:57:03 +01:00
Matthias Krüger
f2f297a4f8
Rollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegen
Remove dead code after destination propagation

Fixes #105428.

cc `@JakobDegen`
2022-12-18 18:57:03 +01:00
Matthias Krüger
3fb5d8e5dd
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!
2022-12-18 18:57:02 +01:00
Albert Larsan
8348e05644
Make x use the x and x.ps1 scripts
This removes another python search from bootstrap.
2022-12-18 18:07:48 +01:00
bors
35a99eef32 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 72bea68af4~~

~~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`
2022-12-18 08:53:49 +00:00
bors
48b3c46126 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.
2022-12-18 05:04:04 +00:00
bors
ff016a55c2 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)`
2022-12-18 02:17:54 +00:00
bors
24368ecdc4 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
2022-12-17 23:27:53 +00:00
Benjamin Tong
fca829075f Remove special cases for setup subcommand
- Remove setup special-casing in Flags::parse
2022-12-17 16:59:03 -06:00
Matthias Krüger
8fc1a72e56
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();
```
2022-12-17 23:44:29 +01:00
Matthias Krüger
cf08eda0b3
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
```
2022-12-17 23:44:29 +01:00
Matthias Krüger
eaf2f26ecc
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``
2022-12-17 23:44:28 +01:00
Matthias Krüger
a8ad7f64a1
Rollup merge of #105792 - Ezrashaw:add-e0320-long-docs, r=GuillaumeGomez
docs: add long error explanation for error E0320

Continuation of #105791

r? ``@GuillaumeGomez``
2022-12-17 23:44:28 +01:00
Matthias Krüger
2835b668d9
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.
2022-12-17 23:44:27 +01:00
Matthias Krüger
c6be9a705f
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`.
2022-12-17 23:44:26 +01:00
Matthias Krüger
6d1cdcaee5
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.
2022-12-17 23:44:26 +01:00
Matthias Krüger
5dc0b6ff6d
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.
2022-12-17 23:44:25 +01:00
Joshua Nelson
6f0fc2fd33 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.
2022-12-17 14:56:37 -06:00
bors
0468a00ae3 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>
2022-12-17 20:47:14 +00:00
mejrs
f7e894c000 Try to fix ICE 2022-12-17 20:11:25 +01:00
Evan Jones
ab2151cbf8 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();
2022-12-17 13:43:08 -05:00
mejrs
6749ee4d7b Remove (eager) 2022-12-17 19:20:44 +01:00
mejrs
1bdf112529 Resolve various merge conflicts 2022-12-17 19:08:25 +01:00
TheOddGarlic
e71a722fa6 Migrate multiple mut borrows diagnostic 2022-12-17 19:08:25 +01:00
TheOddGarlic
3a9a06311d Migrate borrow of moved value diagnostic 2022-12-17 19:08:25 +01:00
TheOddGarlic
eeef05b318 Migrate irrefutable let pattern diagnostics 2022-12-17 19:08:25 +01:00
TheOddGarlic
e1c5073c07 Migrate pattern bindings with variant name lint 2022-12-17 19:08:25 +01:00
TheOddGarlic
6f82a00aa1 Migrate leading/trailing irrefutable let pattern diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
4b70784176 Migrate lower range bound diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
513e3995e0 Migrate "could not evaluate const pattern" diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
d5f821eeb0 Migrate "constant pattern depends on generic parameter" diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
b694e6649e Migrate unreachable pattern diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
98442b6905 Migrate pattern inlining error diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
c7bfd00719 Migrate "non-exhaustive patterns: type is non-empty" diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
71a9cb9b7e Migrate "unused unsafe" lint 2022-12-17 19:08:24 +01:00
TheOddGarlic
64f3e4f195 Migrate "requires unsafe" diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
71fe52fed0 Migrate "unsafe_op_in_unsafe_fn" lints 2022-12-17 19:08:24 +01:00
TheOddGarlic
82f05446a5 Migrate "function cannot return without recursing" diagnostic 2022-12-17 19:08:24 +01:00
bors
2d76a9df5d Auto merge of #105827 - flip1995:clippyup, r=matthiaskrgr
Update Clippy

r? `@Manishearth`
2022-12-17 18:06:32 +00:00
bors
65c53c3bb6 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`](9c07efe84f/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.
2022-12-17 14:51:10 +00:00
The 8472
ab7d769651 poll rustfmt child processes 2022-12-17 14:32:13 +01:00
The 8472
5620afc4e0 poll tidy threads for completion before waiting 2022-12-17 14:32:13 +01:00
The 8472
f7bfc48793 optimize line-by-line style checks in tidy 2022-12-17 14:32:12 +01:00
Philipp Krones
10f2a6de75
Update Cargo.lock 2022-12-17 14:21:37 +01:00
Philipp Krones
adb8ba3cfe
Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyup 2022-12-17 14:12:54 +01:00
bors
4bdfb0741d 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 -->
2022-12-17 13:08:47 +00:00
Philipp Krones
7198989d45
Bump nightly version -> 2022-12-17 2022-12-17 13:57:48 +01:00
Philipp Krones
1f1d23cf51
Bump Clippy version -> 0.1.68 2022-12-17 13:57:41 +01:00
Philipp Krones
d6488ae144
Merge remote-tracking branch 'upstream/master' into rustup 2022-12-17 13:56:32 +01:00
bors
391b2a6fac 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
2022-12-17 12:35:26 +00:00