Commit graph

235720 commits

Author SHA1 Message Date
Jake Goulding 821b03d767 Use GitHub Actions M1 builder for aarch64-apple-darwin
Additionally, this enables

1. building the documentation
2. Setting `rust.lto` to `thin` to match the x86_64 build
2023-10-09 20:40:32 -04:00
Jake Goulding 2bf3004f33 Install awscli on the aarch64-apple-darwin builder
Unlike the other builders, this one doesn't come with it preinstalled.
2023-10-09 19:02:03 -04:00
bors cdddcd3bea Auto merge of #116532 - onur-ozkan:enable-rustflags-bootstrap-on-bootstrap, r=albertlarsan68
Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation

Adds `RUSTFLAGS_BOOTSTRAP` to `RUSTFLAGS` for bootstrap compilation when `RUSTFLAGS_BOOTSTRAP` exists in the environment. With this PR, `RUSTFLAGS_BOOTSTRAP` will affect every build(as we already do for rustc and std) compiled with stage0 compiler.

Resolves #94234
2023-10-09 17:14:17 +00:00
bors 317783ad2c Auto merge of #116569 - matthiaskrgr:rollup-ni0jdd6, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #115882 (improve the suggestion of `generic_bound_failure`)
 - #116537 (Fix suggestion span involving wrongly placed generic arg on variant)
 - #116543 (In smir `find_crates` returns `Vec<Crate>` instead of `Option<Crate>`)
 - #116549 (Simplify some mir passes by using let chains)
 - #116556 (Sync rustc_codegen_cranelift)
 - #116561 (Add a test for fixed ICE)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-09 15:08:28 +00:00
Matthias Krüger 27a5146e7c
Rollup merge of #116561 - ouz-a:testfor_115517, r=compiler-errors
Add a test for fixed ICE

Addresses https://github.com/rust-lang/rust/issues/115517#issuecomment-1730164116

Closes #115517

r? ``@compiler-errors``
2023-10-09 16:26:03 +02:00
Matthias Krüger ea5cac02e8
Rollup merge of #116556 - bjorn3:sync_cg_clif-2023-10-09, r=bjorn3
Sync rustc_codegen_cranelift

The highlights this time are improved simd and inline asm support, `is_x86_feature_detected!()` returning the actual cpu features when inline asm support is enabled and a couple of bug fixes.

r? ```@ghost```

```@rustbot``` label +A-codegen +A-cranelift +T-compiler +subtree-sync
2023-10-09 16:26:02 +02:00
Matthias Krüger 148f5c1bdf
Rollup merge of #116549 - DaniPopes:miropts-let-chains, r=oli-obk
Simplify some mir passes by using let chains
2023-10-09 16:26:02 +02:00
Matthias Krüger 2266e79421
Rollup merge of #116543 - ouz-a:crate_return_vec, r=oli-obk
In smir `find_crates` returns `Vec<Crate>` instead of `Option<Crate>`

Addresses https://github.com/rust-lang/project-stable-mir/issues/40

r? `@oli-obk`
2023-10-09 16:26:01 +02:00
Matthias Krüger 374c885f4a
Rollup merge of #116537 - gurry:116473-ice-sugg-overlap, r=compiler-errors
Fix suggestion span involving wrongly placed generic arg on variant

Fixes #116473

The span computation was wrong. It went from the end of the variant to the end of the (wrongly placed) args. However, the variant lived in a different expansion and this resulted in a nonsensical span that overlaps with another and thereby leads to the ICE.

In the fix I've changed span computation to not be based on the location of the variant, but purely on the location of the args. I simply extend the start of the args span 2 positions to the left and that includes the `::` and that's all we need apparently.

This approach produces a correct span regardless of which macro/expansion the args reside in and where the variant is.
2023-10-09 16:26:01 +02:00
Matthias Krüger 389747c41d
Rollup merge of #115882 - aliemjay:diag-name-region-1, r=compiler-errors
improve the suggestion of `generic_bound_failure`

- Fixes #115375
- suggest the bound in the correct scope: trait or impl header vs assoc item. See `tests/ui/suggestions/lifetimes/type-param-bound-scope.rs`
- don't suggest a lifetime name that conflicts with the other late-bound regions of the function:
```rust
type Inv<'a> = *mut &'a ();
fn check_bound<'a, T: 'a>(_: T, _: Inv<'a>) {}
fn test<'a, T>(_: &'a str, t: T, lt: Inv<'_>) { // suggests a new name `'a`
    check_bound(t, lt); //~ ERROR
}
```
2023-10-09 16:26:00 +02:00
bors be581d9f82 Auto merge of #116142 - GuillaumeGomez:enum-variant-display, r=fmease
[rustdoc] Show enum discrimant if it is a C-like variant

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

We currently display values for associated constant items in traits:

![image](https://github.com/rust-lang/rust/assets/3050060/03e566ec-c670-47b4-8ca2-b982baa7a0f4)

And we also display constant values like [here](file:///home/imperio/rust/rust/build/x86_64-unknown-linux-gnu/doc/std/f32/consts/constant.E.html).

I think that for coherency, we should display values of C-like enum variants.

With this change, it looks like this:

![image](https://github.com/rust-lang/rust/assets/3050060/b53fbbe0-bdb1-4289-8537-f2dd4988e9ac)

As for the display of the constant value itself, I used what we already have to keep coherency.

We display the C-like variants value in the following scenario:
 1. It is a C-like variant with a value set => all the time
 2. It is a C-like variant without a value set: All other variants are C-like variants and at least one them has its value set.

Here is the result in code:

```rust
// Ax and Bx value will be displayed.
enum A {
    Ax = 12,
    Bx,
}

// Ax and Bx value will not be displayed
enum B {
    Ax,
    Bx,
}

// Bx value will not be displayed
enum C {
    Ax(u32),
    Bx,
}

// Bx value will not be displayed, Cx value will be displayed.
#[repr(u32)]
enum D {
    Ax(u32),
    Bx,
    Cx = 12,
}
```

r? `@notriddle`
2023-10-09 13:18:47 +00:00
Guillaume Gomez 1210aac1c0 Add more complex test cases for enum discriminant display 2023-10-09 14:33:04 +02:00
Guillaume Gomez 4b6fc8b70f Improve code 2023-10-09 14:26:52 +02:00
Oğuz Ağcayazı 2e000ebaa5 add test 2023-10-09 13:57:26 +03:00
bors 7ed044c075 Auto merge of #115238 - workingjubilee:ich-entferne-welke-blumen, r=nikic
Formally demote tier 2 MIPS targets to tier 3

Per https://github.com/rust-lang/compiler-team/issues/648

Fixes https://github.com/rust-lang/rust/issues/115218
2023-10-09 09:43:10 +00:00
bjorn3 3ed3765259 Remove no longer used dependency from the list of allowed dependencies 2023-10-09 09:04:52 +00:00
bjorn3 169055f2ff Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into sync_cg_clif-2023-10-09 2023-10-09 08:52:46 +00:00
bjorn3 81dc066758 Rustup to rustc 1.75.0-nightly (bf9a1c8a1 2023-10-08) 2023-10-09 08:33:47 +00:00
bjorn3 88198c70e4 Sync from rust bf9a1c8a19 2023-10-09 08:26:09 +00:00
Oğuz Ağcayazı 4ff6e87a8c return crates instead of a crate 2023-10-09 10:33:23 +03:00
bors 093b9d5b29 Auto merge of #116533 - cjgillot:skip-trivial-mir, r=oli-obk
Do not run optimizations on trivial MIR.

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

The bug was introduced in https://github.com/rust-lang/rust/pull/110728, which put the check too early in the query chain.

cc `@oli-obk` `@ouz-a`
2023-10-09 06:00:23 +00:00
DaniPopes 47ebffabb8
Simplify some mir passes by using let chains 2023-10-09 05:22:31 +02:00
Gurinder Singh 23a3b9e449 Fix suggestion span involving wrongly placed generic arg on enum variants
When the variant and the (wrongly placed) args are at separate
source locations such as being in different macos or one in a macro and
the other somwhere outside of it, the arg spans we computed spanned
the entire distance between such locations and were hence invalid.
.
2023-10-09 08:04:00 +05:30
bors 1f48cbc3f8 Auto merge of #116096 - cjgillot:debuginfo-fndef-size, r=nikic
Make FnDef 1-ZST in LLVM debuginfo.

Discussed in https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVM.20HEAD.20llvm.2Edbg.2Edeclare.2Falloca.20size.20mismatch

r? `@nikic`
2023-10-09 02:08:13 +00:00
bors 37fda989ea Auto merge of #116468 - nnethercote:rustc_serialize, r=Mark-Simulacrum
Streamline `rustc_serialize`

r? `@Mark-Simulacrum`
2023-10-09 00:03:52 +00:00
Jubilee Young 31cb61b311 Drop all MIPS targets from CI 2023-10-08 15:35:07 -07:00
Jubilee Young 14cdb3808d Drop mips*-unknown-linux-musl* to tier 3
Also be more pedantic about spelling:
- LE? Is it "less than or equal to"? Say "little endian".
- We're Rust, not C, preserve the initial capital in "N64".
- "MUSL" doesn't stand for anything; Rich Felker spells it "musl".
2023-10-08 15:25:17 -07:00
Jubilee Young 03870154f4 Drop mips*-unknown-linux-gnu* to tier 3
In the process, be more pedantic about spelling:
- LE? Do you mean "limited edition"? It's "little endian".
- The name of the ABI is "N64" as in "Nintendo 64".
2023-10-08 15:19:04 -07:00
Camille GILLOT 9d211b044d Ignore MSVC in test. 2023-10-08 16:45:45 +00:00
Camille GILLOT 098fc9715e Make FnDef 1-ZST in LLVM debuginfo. 2023-10-08 16:42:45 +00:00
bors bf9a1c8a19 Auto merge of #116515 - petrochenkov:nolegflavor, r=lqd
linker: Remove unstable legacy CLI linker flavors
2023-10-08 15:18:22 +00:00
bors 4f4a413fe6 Auto merge of #116454 - tmiasko:small-dominators, r=cjgillot
Generalize small dominators optimization

* Use small dominators optimization from 640ede7b0a more generally.
* Merge `DefLocation` and `LocationExtended` since they serve the same purpose.
2023-10-08 12:38:14 +00:00
Camille GILLOT 005ec2e51c Do not run optimizations on trivial MIR. 2023-10-08 12:09:06 +00:00
bjorn3 cc5db2c1c8
Merge pull request #1397 from bjorn3/inline_asm_tweaks
Test inline asm support on CI
2023-10-08 13:21:53 +02:00
bors 1e3c8f196b Auto merge of #116183 - cjgillot:debug-dse-always, r=oli-obk
Always preserve DebugInfo in DeadStoreElimination.

This is a version of #106852 that does not check the current crate's debuginfo flag, and always attempts to preserve debuginfo.

I haven't figured out how to handle mixing debuginfo levels for std, the one for the test, and the one for the CI target just right to merge #106852, so this can at least fix the debuginfo issue.

Fixes https://github.com/rust-lang/rust/issues/103655
2023-10-08 10:50:33 +00:00
onur-ozkan 89d610cd06 Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation
Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of
RUSTFLAGS to be actually effective (e.g., if we have `-Dwarnings` in
RUSTFLAGS, passing `-Awarnings` from RUSTFLAGS_BOOTSTRAP should override it).

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-08 13:41:56 +03:00
Ali MJ Al-Nasrawy a8830631b9 remove trailing dots 2023-10-08 10:06:17 +00:00
Ali MJ Al-Nasrawy 996ffcb718 always show and explain sub region 2023-10-08 09:59:51 +00:00
Ali MJ Al-Nasrawy 5be0b2283a improve the suggestion of generic_bound_failure 2023-10-08 09:56:57 +00:00
bjorn3 2672876b63 Run inline asm rustc tests on CI 2023-10-08 09:50:20 +00:00
bjorn3 91e5bd87e6 Skip cpuid shim when inline asm support is enabled
cg_clif should support enough simd intrinsics now to not need almost all
cpu features to be force disabled. In addition they can't be disabled
anyway when using a sysroot compiled by LLVM.
2023-10-08 09:50:20 +00:00
bjorn3 07147f34d0 Fix inline asm on macOS 2023-10-08 09:50:20 +00:00
bjorn3 81093441c1 Rustup to rustc 1.75.0-nightly (97c81e1b5 2023-10-07) 2023-10-08 09:30:32 +00:00
bjorn3 1906ec56fc Sync from rust 97c81e1b53 2023-10-08 09:22:39 +00:00
bors ab039f79b8 Auto merge of #116514 - petrochenkov:nogccld, r=lqd
linker: Remove `-Zgcc-ld` option

It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now.

r? `@lqd`
2023-10-08 09:04:57 +00:00
bors 6d271692b0 Auto merge of #116509 - Enselic:rustc-test-op, r=Mark-Simulacrum
tests/run-make: Move RUSTC_TEST_OP to tools.mk and use in more places
2023-10-08 07:13:19 +00:00
Vadim Petrochenkov b563595c6e linker: Remove -Zgcc-ld option
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
2023-10-08 10:05:25 +03:00
bors fea943debf Auto merge of #116487 - tamird:avoid-unwrap-absolute, r=bjorn3
compiler: env/path handling fixes

Please see individual commits. r? `@bjorn3` cf. #116426
2023-10-08 05:24:16 +00:00
bors e08de86036 Auto merge of #116487 - tamird:avoid-unwrap-absolute, r=bjorn3
compiler: env/path handling fixes

Please see individual commits. r? `@bjorn3` cf. #116426
2023-10-08 05:24:16 +00:00
bors 1516ca1bc0 Auto merge of #116486 - van-ema:master, r=nikic
Fix to register analysis passes with -Zllvm-plugins at link-time

This PR fixes an unexpected behavior of the `-Zllvm-plugins` flag. It allows to run an out-of-tree pass as part of LTO.
However, analysis passes are registered before the plugin is loaded. As a result an analysis pass, which is passed as a plugin, is not registered. This causes the LLVM PassManager to fail when the analysis pass is queried from a transformation pass  [(here)](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/PassManager.h#L776).

This fix mimics the bahavior in [LLVM LTOBackend.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/LTO/LTOBackend.cpp#L273) by loading the plugin before the analysis passes are registered.

Tested with rustc 1.60 and 1.65 and LLVM-13.0.1.
2023-10-08 03:36:37 +00:00