Commit graph

258721 commits

Author SHA1 Message Date
Matthias Krüger 08d2fc7c51
Rollup merge of #126783 - tguichaoua:fix_tcplistener_into_incoming_issue_number, r=workingjubilee
Fix issue number for the `tcplistener_into_incoming` feature

As per [this comment](https://github.com/rust-lang/rust/pull/88339#discussion_r922899044), the issue number for the `tcplistener_into_incoming` feature is the one of the PR that implements it instead of the tracking issue.

- https://github.com/rust-lang/rust/pull/88339
- https://github.com/rust-lang/rust/issues/88373
2024-06-23 09:45:29 +02:00
Matthias Krüger 92af6703b8
Rollup merge of #126782 - mtilda:mtilda/patch/x-test-with-absolute-paths, r=onur-ozkan
Support absolute source paths in bootstrap

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

`x test [PATHS]` should work when each path

1. Is the name of a build step, such as `tidy` in `x test tidy` or
2. Points to an existing file that is a descendant of the builder's source directory (root of this repository).
2024-06-23 09:45:29 +02:00
Matthias Krüger 98cc130cf4
Rollup merge of #126779 - Zalathar:rust-dev, r=Kobzol
Try to clarify the confusingly-named `RustDev` and `RustcDev` steps

When trying to track down how the downloaded LLVM gets built and bundled, I was greatly confused by these step names.

I wasn't sure whether I could just rename them (since they correspond to the filename of the resulting tarball), but I at least wanted to leave behind some signposts to reduce confusion.
2024-06-23 09:45:28 +02:00
Matthias Krüger 4a94e8089d
Rollup merge of #126720 - Rejyr:migrate-branch-protection-rmake, r=jieyouxu
Ignore `branch-protection-check-IBT` run-make test

The old Makefile implementation (#110304) had an improper comparison which caused the test to never run. However, both the updated Makefile implementation and the rmake implementation fail (missing `.note.gnu.property`). This could be a bug in the original implementation or test flakiness.

Edit: Manually recreating the test case shows that `.note.gnu.property` does not appear in nightly.
```rust
// main.rs
fn main() {
    println!("hello world");
}
```
```sh
$ rustc +nightly -V
rustc 1.81.0-nightly (c1b336cb6 2024-06-21)
$ rustc +stable -V
rustc 1.79.0 (129f3b996 2024-06-10)
```
```sh
$ rustc +nightly -Zcf-protection=branch -Clink-args=-nostartfiles -Csave-temps "-L$PWD" main.rs -o main
$ llvm-readobj --elf-output-style=GNU -nW main
Displaying notes found in: .note.gnu.build-id
  Owner                Data size        Description
  GNU                  0x00000008       NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: bcae34e6431b2a37
```
Compiling without the other flags still does not show `.note.gnu.property`.
```sh
$ rustc +nightly main.rs -o main
$ llvm-readobj --elf-output-style=GNU -nW main
Displaying notes found in: .note.ABI-tag
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 4.4.0

Displaying notes found in: .note.gnu.build-id
  Owner                Data size        Description
  GNU                  0x00000008       NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: d60d5f108b63bf3a
```
Compiling on stable shows `.note.gnu.property`.
```sh
$ rustc +stable main.rs -o main
$ llvm-readobj --elf-output-style=GNU -nW main
Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0 (property note)
    Properties:    x86 ISA needed: x86-64-baseline

Displaying notes found in: .note.gnu.build-id
  Owner                Data size        Description
  GNU                  0x00000014       NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: 4a494eb578123314e6ff1caf1c8877e27004664f

Displaying notes found in: .note.ABI-tag
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 4.4.0
```

Part of #121876.

r? `@jieyouxu`
2024-06-23 09:45:27 +02:00
Jubilee Young c72a6ad8f2 test: ignore force-frame-pointers test on some targets
all of these currently force stronger frame pointers, and
currently the CLI does not override the target
2024-06-23 00:40:43 -07:00
Jubilee Young 598e265d43 compiler: Accept -Cforce-frame-pointers=always
Also lands behind -Zunstable-options, for now.
Take the opportunity to do some mild cleanup.
2024-06-23 00:36:34 -07:00
Jubilee Young 7d160ae61a compiler: Support nightly -Cforce-frame-pointers=non-leaf
Requires -Zunstable-options as this is a -C flag already.
2024-06-23 00:36:34 -07:00
Jubilee Young f301d087d4 test: for frame-pointer=non-leaf codegen opts 2024-06-23 00:36:33 -07:00
Jubilee Young 79416c4118 cg_clif: Define build opts from FramePointer 2024-06-23 00:36:33 -07:00
Jubilee Young b3a1975cdc compiler(nfc): -Cforce-frame-pointers is a FramePointer 2024-06-23 00:36:33 -07:00
Jubilee Young 7c0b5cf99f compiler: Add FramePointer::ratchet 2024-06-23 00:36:33 -07:00
David Carlier bd9ce3e074
std::unix::os::home_dir: fallback's optimisation.
we're using a guaranteed initialised field on success.
2024-06-23 08:22:51 +01:00
Jubilee Young 43a6b018a2 compiler: Mention C-unwind in C-variadic error 2024-06-22 23:30:31 -07:00
Nicholas Nethercote e2aa38e6ab Rework pattern and expression nonterminal kinds.
Merge `PatParam`/`PatWithOr`, and `Expr`/`Expr2021`, for a few reasons.

- It's conceptually nice, because the two pattern kinds and the two
  expression kinds are very similar.

- With expressions in particular, there are several places where both
  expression kinds get the same treatment.

- It removes one unreachable match arm.

- Most importantly, for #124141 I will need to introduce a new type
  `MetaVarKind` that is very similar to `NonterminalKind`, but records a
  couple of extra fields for expression metavars. It's nicer to have a
  single `MetaVarKind::Expr` expression variant to hold those extra
  fields instead of duplicating them across two variants
  `MetaVarKind::{Expr,Expr2021}`. And then it makes sense for patterns
  to be treated the same way, and for `NonterminalKind` to also be
  treated the same way.

I also clarified the comments, because I have long found them a little
hard to understand.
2024-06-23 15:57:24 +10:00
Jubilee Young 0d8f734172 compiler: Fix arm32 asm issues by hierarchically sorting reg classes 2024-06-22 21:39:58 -07:00
bors d4cc01c2f2 Auto merge of #126715 - Rejyr:migrate-readelf-rmake, r=jieyouxu
Migrate `relro-levels`, `static-pie` to `rmake`

Part of #121876.

r? `@jieyouxu`

try-job: aarch64-gnu
try-job: arm-android
try-job: armhf-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: dist-various-1
try-job: test-various
2024-06-23 03:43:25 +00:00
Mathilda 57cb0e23d9 Support absolute PATHS in x.py test [PATHS] 2024-06-22 23:33:52 -04:00
surechen e8b5ba1111 For [E0308]: mismatched types, when expr is in an arm's body, not add semicolon ';' at the end of it.
fixes #126222
2024-06-23 10:19:02 +08:00
Zalathar 16cf2682ee Try to clarify the confusingly-named RustDev and RustcDev steps 2024-06-23 11:31:21 +10:00
bors acb62737ac Auto merge of #126842 - calebcartwright:sync-from-rustfmt-24-06, r=calebcartwright
rustfmt subtree update

r? ghost
2024-06-23 00:42:26 +00:00
github-actions 990535723d cargo update
Locking 9 packages to latest compatible versions
    Updating clap_complete v4.5.5 -> v4.5.6
    Updating displaydoc v0.2.4 -> v0.2.5
    Removing icu_collections v1.5.0
    Removing icu_normalizer v1.5.0
    Removing icu_normalizer_data v1.5.0
    Removing icu_properties v1.5.0
    Removing icu_properties_data v1.5.0
 Downgrading idna v1.0.0 -> v0.5.0 (latest: v1.0.1)
    Updating lazy_static v1.4.0 -> v1.5.0
    Updating miniz_oxide v0.7.3 -> v0.7.4
    Updating proc-macro2 v1.0.85 -> v1.0.86
    Updating syn v2.0.66 -> v2.0.67
      Adding unicode-bidi v0.3.15
    Updating url v2.5.1 -> v2.5.2
    Removing utf16_iter v1.0.5
    Removing utf8_iter v1.0.4
    Removing write16 v1.0.0
note: pass `--verbose` to see 85 unchanged dependencies behind latest
2024-06-23 00:18:08 +00:00
Jerry Wang 75a9379c0f
(wip) Migrate branch-protection-check-IBT to rmake 2024-06-22 20:18:02 -04:00
Jerry Wang a19077d0f3
Enable cross compilation on run-make/relro-levels 2024-06-22 19:44:51 -04:00
Jubilee Young 26dccadb47 Allow "C-unwind" fn to have C variadics 2024-06-22 15:14:14 -07:00
Nicholas Nethercote 70fa67c0b2 Tweak some ugly formatting. 2024-06-23 08:13:41 +10:00
Nicholas Nethercote 470b0e9c3c Import NonterminalKind in compiler/rustc_expand/src/mbe/quoted.rs.
So we can omit the `token::` qualifier, which gives more space to some
cramped code.
2024-06-23 08:11:54 +10:00
Caleb Cartwright ffad9842bd update rustfmt version 2024-06-22 16:22:00 -05:00
Caleb Cartwright 53608bece0 fix bad merge conflict resolution 2024-06-22 16:21:14 -05:00
bors 3cb521a434 Auto merge of #126761 - GuillaumeGomez:unsafe_extern_blocks, r=spastorino
rustdoc: Add support for `missing_unsafe_on_extern` feature

Follow-up of https://github.com/rust-lang/rust/pull/124482.

Not sure if the `safe` keyword is supposed to be displayed or not though? For now I didn't add it in the generated doc, only `unsafe` as usual.

cc `@spastorino`
r? `@fmease`
2024-06-22 20:59:00 +00:00
Michael Goulet 97b7874a3c Fix rustfmt 2024-06-22 15:41:51 -05:00
Caleb Cartwright fc2cca942f Merge commit 'e4944185ae09c99f59b460e358909f329010ea9c' into sync-from-rustfmt-24-06 2024-06-22 15:33:45 -05:00
bors a0f01c3c10 Auto merge of #126838 - matthiaskrgr:rollup-qkop22o, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #126140 (Rename `std::fs::try_exists` to  `std::fs::exists` and stabilize fs_try_exists)
 - #126318 (Add a `x perf` command for integrating bootstrap with `rustc-perf`)
 - #126552 (Remove use of const traits (and `feature(effects)`) from stdlib)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-22 18:48:10 +00:00
Jerry Wang c69770d730
Migrate static-pie scripts to rmake 2024-06-22 14:15:23 -04:00
Jerry Wang f90d4e4371
Migrate static-pie to rmake 2024-06-22 14:15:22 -04:00
Jerry Wang e16f492e42
Migrate relro-levels to rmake 2024-06-22 14:15:22 -04:00
Jerry Wang 5a66a796fc
Add stdin to run_make_support::command::Command 2024-06-22 14:15:22 -04:00
Matthias Krüger dc9a08f535
Rollup merge of #126552 - fee1-dead-contrib:rmfx, r=compiler-errors
Remove use of const traits (and `feature(effects)`) from stdlib

The current uses are already unsound because they are using non-const impls in const contexts. We can reintroduce them by reverting the commit in this PR, after #120639 lands.

Also, make `effects` an incomplete feature.

cc `@rust-lang/project-const-traits`
r? `@compiler-errors`
2024-06-22 19:33:56 +02:00
Matthias Krüger 162120b4fa
Rollup merge of #126318 - Kobzol:bootstrap-perf, r=onur-ozkan
Add a `x perf` command for integrating bootstrap with `rustc-perf`

This PR adds a new `x perf` command to bootstrap. The idea is to let rustc developers profile (`profile_local`) and benchmark (`bench_local`) a stage1/stage2 compiler directly from within `rust`.

Before, if you wanted to use `rustc-perf`, you had to clone it, set it up, copy the `rustc` sysroot after every change to `rust` etc. This is an attempt to automate that.

I opened this PR mostly for discussion. My idea is to offer an interface that looks something like this (a random sample of commands):
```bash
x perf --stage 2 profile eprintln
x perf --stage1 profile cachegrind
x perf benchmark --id baseline
x perf benchmark --id after-edit
x perf cmp baseline after-edit
```

In this PR, I'd like to only implement the simplest case (`profile_local (eprintln)`), because that only requires a single sysroot (you don't compare anything), and it's relatively easy to set up. Also, I'd like to avoid forcing developers to deal with the rustc-perf UI, so more complex use-cases (like benchmarking two sysroots and comparing the results) should probably wait for https://github.com/rust-lang/rustc-perf/issues/1734 (which is hopefully coming along soon-ish).

I'm not sure if it's better to do this in bootstrap directly, or if I should create some shim tool that will receive a `rustc` sysroot, and offer a simplified CLI on top of `rustc-perf`.

## Why is a separate CLI needed?
We definitely need to add some support to bootstrap to automate preparing `rustc-perf` and the `rustc` sysroot, but in theory after that we could just let people invoke `rustc-perf` manually. While that is definitely possible, you'd need to manually figure out where is your sysroot located, which seems annoying to me. The `rustc-perf` CLI is also relatively complex, and for this use-case it makes sense to only use a subset of it. So I thought that it would be better to offer a simplified interface on top of it that would make life easier for contributors. But maybe it's not worth it.

CC `@onur-ozkan`
2024-06-22 19:33:56 +02:00
Matthias Krüger f3ced9d540
Rollup merge of #126140 - eduardosm:stabilize-fs_try_exists, r=Amanieu
Rename `std::fs::try_exists` to  `std::fs::exists` and stabilize fs_try_exists

FCP completed in tracking issue.

Tracking issue: https://github.com/rust-lang/rust/issues/83186

Closes https://github.com/rust-lang/rust/issues/83186

Stabilized API:

```rust
mod fs {
    pub fn exists<P: AsRef<Path>>(path: P) -> io::Result<bool>;
}
```
2024-06-22 19:33:55 +02:00
bjorn3 8d1f5b30ef Avoid a couple of unnecessary EarlyDiagCtxt uses 2024-06-22 17:06:47 +00:00
bjorn3 e3ffbbd226 Ensure run_compiler always aborts on errors
Before if the closure passed to run_compiler emitted an error without
calling abort_if_errors and no diagnostics have been stashed,
run_compiler would return normally as if no error had occured.
2024-06-22 17:06:47 +00:00
bjorn3 7332e79d5f Inline write_dep_info query 2024-06-22 17:06:47 +00:00
Vadim Petrochenkov 0a265957dd delegation: Do not crash on qpaths without a trait 2024-06-22 19:57:19 +03:00
bors f944afe380 Auto merge of #116113 - kpreid:arcmut, r=dtolnay
Generalize `{Rc,Arc}::make_mut()` to unsized types.

* `{Rc,Arc}::make_mut()` now accept any type implementing the new unstable trait `core::clone::CloneToUninit`.
* `CloneToUninit` is implemented for `T: Clone` and for `[T] where T: Clone`.
* `CloneToUninit` is a generalization of the existing internal trait `alloc::alloc::WriteCloneIntoRaw`.
* New feature gate: `clone_to_uninit`

This allows performing `make_mut()` on `Rc<[T]>` and `Arc<[T]>`, which was not previously possible.

---

Previous PR description, now obsolete:

>  Add `{Rc, Arc}::make_mut_slice()`
>
> These functions behave identically to `make_mut()`, but operate on `Arc<[T]>` instead of `Arc<T>`.
>
> This allows performing the operation on slices, which was not previously possible because `make_mut()` requires `T: Clone` (and slices, being `!Sized`, do not and currently cannot implement `Clone`).
>
> Feature gate: `make_mut_slice`

try-job: test-various
2024-06-22 16:35:29 +00:00
bjorn3 391bdb3c12 Clarify visibility of several rustc_interface passes 2024-06-22 15:44:36 +00:00
bjorn3 d8c9dd4172 Move has_errors_or_delayed_bugs check into start_codegen 2024-06-22 15:44:36 +00:00
bjorn3 e2aadc296d Call check_for_rustc_errors_attr from start_codegen 2024-06-22 15:44:36 +00:00
bjorn3 c8380cbe6a Move almost all code from Queries::global_ctxt into passes::create_global_ctxt 2024-06-22 15:44:33 +00:00
Ralf Jung 763e3131cc don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
Jerry Wang 6db3289de7
Add more flags for llvm-readobj 2024-06-22 11:24:59 -04:00