Commit Graph

235867 Commits

Author SHA1 Message Date
Antoni Boucher
30290c8b41 Merge commit '11a0cceab966e5ff1058ddbcab5977e8a1d6d290' into subtree-update_cg_gcc_2023-10-09 2023-10-09 15:53:34 -04:00
antoyo
11a0cceab9
Merge pull request #350 from rust-lang/sync_from_rust_2023_10_08
Sync from rust 2023/10/08
2023-10-09 15:34:06 -04:00
Antoni Boucher
a7532daa76 Fix unchecked_ssub, unchecked_smul, and unchecked_umul 2023-10-09 13:16:47 -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
Antoni Boucher
a00ea0bf98 Fix unchecked_sadd 2023-10-09 13:03:23 -04:00
Antoni Boucher
70834391ae Fix UI tests 2023-10-09 11:27:43 -04:00
Antoni Boucher
3fe53587e4 Add missing comma in alloc_system 2023-10-09 11:09:53 -04:00
Antoni Boucher
ad5637468e Add missing panic_in_cleanup 2023-10-09 11:08:42 -04: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
Antoni Boucher
e7f7fb87dd Fix tests 2023-10-09 10:55:25 -04:00
Antoni Boucher
bd7e5b9d4e Fix bitcast with different sizes 2023-10-09 10:38:37 -04: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
Antoni Boucher
237be9e0cb Update to nightly-2023-10-08 2023-10-08 11:32:07 -04:00
Antoni Boucher
c567e59bad Merge branch 'master' into sync_from_rust_2023_10_08 2023-10-08 11:31:53 -04: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
antoyo
d484836a6f
Merge pull request #349 from rust-lang/fix/128-bit-ints-operations
Fix/128 bit ints operations
2023-10-08 09:29:13 -04:00
Antoni Boucher
b3c10d4a7d Fix 128-bit non-native integers negation 2023-10-08 08:49:20 -04: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