Commit Graph

2452 Commits

Author SHA1 Message Date
Matthias Krüger
3c40e383df
Rollup merge of #124818 - compiler-errors:ena, r=Mark-Simulacrum
Update ena to 0.14.3

Includes https://github.com/rust-lang/ena/pull/53, which removes a trivial `Self: Sized` bound that prevents `ena` from building on the new solver.
2024-05-11 08:00:15 +02:00
bors
6e1d94708a Auto merge of #123886 - scottmcm:more-rvalue-operands, r=matthewjasper
Avoid `alloca`s in codegen for simple `mir::Aggregate` statements

The core idea here is to remove the abstraction penalty of simple newtypes in codegen.

Even something simple like constructing a
```rust
#[repr(transparent)] struct Foo(u32);
```
forces an `alloca` to be generated in nightly right now.

Certainly LLVM can optimize that away, but it would be nice if it didn't have to.

Quick example:
```rust
#[repr(transparent)]
pub struct Transparent32(u32);

#[no_mangle]
pub fn make_transparent(x: u32) -> Transparent32 {
    let a = Transparent32(x);
    a
}
```
on nightly we produce <https://rust.godbolt.org/z/zcvoM79ae>
```llvm
define noundef i32 `@make_transparent(i32` noundef %x) unnamed_addr #0 {
  %a = alloca i32, align 4
  store i32 %x, ptr %a, align 4
  %0 = load i32, ptr %a, align 4, !noundef !3
  ret i32 %0
}
```
but after this PR we produce
```llvm
define noundef i32 `@make_transparent(i32` noundef %x) unnamed_addr #0 {
start:
  ret i32 %x
}
```
(even before the optimizer runs).
2024-05-10 20:17:22 +00:00
klensy
39159a3629 opt-dist: use xz2 instead of xz crate
xz crate consist of simple reexport of xz2 crate. Why? Idk.
2024-05-09 16:43:14 +03:00
Scott McMurray
c38f75c21f Make SSA aggregates without needing an alloca 2024-05-08 20:38:04 -07:00
James Farrell
fbc2abd6be Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
Michael Goulet
2af0871297 Update ena to 0.14.3 2024-05-06 14:32:39 -04:00
Urgau
228496e4f5 Improve check-cfg CLI errors with more structured diagnostics 2024-05-06 07:44:41 +02:00
Nicholas Nethercote
2acbe9c743 Move some tests from rustc_expand to rustc_parse.
There are some test cases involving `parse` and `tokenstream` and
`mut_visit` that are located in `rustc_expand`. Because it used to be
the case that constructing a `ParseSess` required the involvement of
`rustc_expand`. However, since #64197 merged (a long time ago)
`rust_expand` no longer needs to be involved.

This commit moves the tests into `rustc_parse`. This is the optimal
place for the `parse` tests. It's not ideal for the `tokenstream` and
`mut_visit` tests -- they would be better in `rustc_ast` -- but they
still rely on parsing, which is not available in `rustc_ast`. But
`rustc_parse` is lower down in the crate graph and closer to `rustc_ast`
than `rust_expand`, so it's still an improvement for them.

The exact renaming is as follows:

- rustc_expand/src/mut_visit/tests.rs -> rustc_parse/src/parser/mut_visit/tests.rs
- rustc_expand/src/tokenstream/tests.rs -> rustc_parse/src/parser/tokenstream/tests.rs
- rustc_expand/src/tests.rs + rustc_expand/src/parse/tests.rs ->
  compiler/rustc_parse/src/parser/tests.rs

The latter two test files are combined because there's no need for them
to be separate, and having a `rustc_parse::parser::parse` module would
be weird. This also means some `pub(crate)`s can be removed.
2024-05-06 09:06:02 +10:00
bors
872a85658d Auto merge of #124754 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-05-05 17:08:24 +00:00
Ralf Jung
ba94910afd update rustc-build-sysroot for dealing with unexpected_cfgs 2024-05-05 17:18:57 +02:00
Ralf Jung
47b3ce0ea7 update lockfile 2024-05-05 17:17:45 +02:00
Caleb Sander
43c8e139fd compiler: upgrade time from 0.3.34 to 0.3.36
This ensures the version of time used in rustc includes this change:
https://github.com/time-rs/time/pull/671.
This fix is a necessary prerequisite for #99969,
which adds FromIterator implementations for Box<str>.
Previously, time had an Into::into that resolved to the identity impl
followed by a collect::<Result<Box<_>, _>>().
With the new FromIterator implementations for Box<str>,
the Into::into resolution is ambiguous and time fails to compile.
The fix removes the identity Into::into conversion,
allowing time to compile with the new FromIterator implementations.
This version of time also matches what cargo recently switched to
in https://github.com/rust-lang/cargo/pull/13834.
2024-05-04 21:18:41 -07:00
Nicholas Nethercote
9b3ef5404c Remove some unneeded Cargo.toml dependencies.
I found these with a hacky shell script.
2024-05-03 15:33:52 +10:00
Philipp Krones
e395dc9000
Update Cargo.lock 2024-05-02 17:27:08 +02:00
许杰友 Jieyou Xu (Joe)
ce18639b92
Rollup merge of #124280 - beetrees:repr128-test-rmake, r=jieyouxu
Port repr128-dwarf run-make test to rmake

This PR ports the repr128-dwarf run-make test to rmake, using the `gimli` crate instead of the `llvm-dwarfdump` command.

Note that this PR changes `rmake.rs` files to be compiled with the 2021 edition (previously no edition was passed to `rustc`, meaning they were compiled with the 2015 edition). This means that `panic!("{variable}")` will now work as expected in `rmake.rs` files (there's already a usage in the [wasm-symbols-not-exported test](aca749eefc/tests/run-make/wasm-symbols-not-exported/rmake.rs (L34)) that this will fix).

Tracking issue: #121876
2024-04-30 19:29:51 +01:00
beetrees
c2fd6ed235
Port repr128-dwarf run-make test to rmake 2024-04-30 17:50:49 +01:00
bors
72f616273c Auto merge of #124366 - Kobzol:remove-yaml-expansion, r=pietroalbini
CI: remove `expand-yaml-anchors`

This PR unifies all CI outcome jobs in a single job, and then removes the `expand-yaml-anchors` tool, since it is no longer needed after this change.

I have tested try builds for both situations with the new `outcome` job (note that these two workflow runs use a different step structure in the outcome job, I have simplified it since):
- [Success](https://github.com/rust-lang-ci/rust/actions/runs/8831529677/job/24251135366)
- [Failure](https://github.com/rust-lang-ci/rust/actions/runs/8833052319/job/24251628792)

r? `@ghost`
2024-04-30 06:59:00 +00:00
Jakub Beránek
0b1ecf1d8d
Remove the expand-yaml-anchors tool 2024-04-29 21:33:17 +02:00
George Bateman
8aa3c59752
Move rustfmt changes out
Now in https://github.com/rust-lang/rustfmt/pull/6154
2024-04-28 21:38:55 +01:00
George Bateman
a0a84429a5
Remove direct dependencies on lazy_static, once_cell and byteorder
The functionality of all three crates is now available in the standard library.
2024-04-28 14:35:00 +01:00
George Bateman
31af4f81ca
Remove lazycell and once_cell from compiletest dependencies 2024-04-27 12:38:51 +01:00
bors
1c84675e1f Auto merge of #124368 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2024-04-25 10:59:13 +00:00
Ralf Jung
9f7194b5eb update lockfile 2024-04-25 12:28:45 +02:00
Jover Zhang
f3530cf003 Rewrite no-input-file.stderr test in Rust and support diff 2024-04-25 09:10:10 +08:00
bors
43a0686f8d Auto merge of #115253 - donno2048:patch-1, r=albertlarsan68
Implement `PROBLEMATIC_CONSTS` generalization

You forgot that `A≈4`, `B≈8`, and `E≈3` and some more constants.

The new `PROBLEMATIC_CONSTS` was generated using this code:

```py
from functools import reduce
def generate_problems(consts: list, letter_digit: dict):
    for const in consts:
        problem = reduce(lambda string, rep: string.replace(*reversed(rep)), ['%X' % const, *letter_digit.items()])
        indexes = [index for index, c in enumerate(problem) if c in letter_digit.keys()]
        for i in range(1 << len(indexes)):
            yield int(''.join(letter_digit[c] if index in indexes and (i >> indexes.index(index)) & 1 else c for index, c in enumerate(problem)), 0x10)

problems = generate_problems(
    [
        # Old PROBLEMATIC_CONSTS:
        184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037,
        3735927486, 3735932941, 4027431614, 4276992702,
        # More of my own:
        195934910, 252707358, 762133, 179681982, 173390526
    ],
    {
    'A': '4',
    'B': '8',
    'E': '3',
    }
)

# print(list(problems)) # won't use that to print formatted

from itertools import islice
while len(cur_problems := list(islice(problems, 8))):
    print('    ', end='')
    print(*cur_problems, sep=', ', end='')
    print(',')
```
2024-04-19 09:52:17 +00:00
bors
c5de414865 Auto merge of #123144 - dpaoliello:arm64eclib, r=GuillaumeGomez,ChrisDenton,wesleywiser
Add support for Arm64EC to the Standard Library

Adds the final pieces so that the standard library can be built for arm64ec-pc-windows-msvc (initially added in #119199)

* Bumps `windows-sys` to 0.56.0, which adds support for Arm64EC.
* Correctly set the `isEC` parameter for LLVM's `writeArchive` function.
* Add `#![feature(asm_experimental_arch)]` to library crates where Arm64EC inline assembly is used, as it is currently unstable.
2024-04-18 12:22:52 +00:00
donno2048
e2ab540e37 add rustc-hash 2024-04-18 06:57:43 +00:00
donno2048
ca67fd6d19 fix lockfile 2024-04-18 06:51:55 +00:00
Elisha Hollander
fa6444b050
reset lockfile to head 2024-04-18 08:00:35 +03:00
Elisha Hollander
f71d2a2af6 update cargo manifest 2024-04-16 22:22:49 +00:00
Elisha Hollander
2196d65cf2 update lockfile 2024-04-16 22:20:16 +00:00
Guillaume Gomez
ec1618cf17
Rollup merge of #123975 - lqd:rust-lld-tests, r=jieyouxu
Port the 2 `rust-lld` run-make tests to `rmake`

In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`:
- `tests/run-make/rust-lld`
- `tests/run-make/rust-lld-custom-target`

As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library.

Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`.

r? `@jieyouxu`
2024-04-17 00:00:23 +02:00
Matthias Krüger
cf7900476e
Rollup merge of #124007 - RalfJung:miri, r=RalfJung
Miri subtree update

r? ``@ghost``
2024-04-16 17:54:44 +02:00
Guillaume Gomez
9a7adb8d81
Rollup merge of #123687 - bjorn3:ar_archive_writer_0_2_0, r=oli-obk
Update ar_archive_writer to 0.2.0

This adds a whole bunch of tests checking for any difference with llvm's archive writer. It also fixes two mistakes in the porting from C++ to Rust. The first one causes a divergence for Mach-O archives which may or may not be harmless. The second will definitively cause issues, but only applies to thin archives, which rustc currently doesn't create.
2024-04-16 15:19:13 +02:00
Ralf Jung
2f08c2c965 update lockfile 2024-04-16 07:52:25 +02:00
Daniel Paoliello
32f5ca4be7 Add support for Arm64EC to the Standard Library 2024-04-15 16:05:16 -07:00
Michael Goulet
619e044178 Fix pretty hir for anon consts in diagnostics 2024-04-15 18:48:12 -04:00
Rémy Rakic
682535e777 add regex to run_make_support
note: version more recent than 1.8 depend on memchr 2.6, which creates
conflicts as memchr 2.5.0 is pinned elsewhere in the workspace
2024-04-15 17:23:16 +00:00
bors
29b120740b Auto merge of #123719 - RalfJung:compiler_builtins, r=Mark-Simulacrum
update compiler_builtins to 0.1.109

This pulls in https://github.com/rust-lang/compiler-builtins/pull/583 so we should make sure that does not come with any perf surprises.

Cc `@Amanieu`
2024-04-14 18:42:50 +00:00
bors
78bc0a5656 Auto merge of #123913 - matthiaskrgr:rollup-w8stnwl, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #123651 (Thread local updates for idiomatic examples)
 - #123699 (run-make-support: tidy up support library)
 - #123779 (OpenBSD fix long socket addresses)
 - #123875 (Doc: replace x with y for hexa-decimal fmt)
 - #123879 (Add missing `unsafe` to some internal `std` functions)
 - #123889 (reduce tidy overheads in run-make checks)
 - #123898 (Generic associated consts: Check regions earlier when comparing impl with trait item def)
 - #123902 (compiletest: Update rustfix to 0.8.1)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-14 09:02:22 +00:00
Matthias Krüger
ab65c68585
Rollup merge of #123902 - ehuss:update-rustfix2, r=Mark-Simulacrum
compiletest: Update rustfix to 0.8.1

This updates the version of rustfix used in compiletest to be closer to what cargo is using. This is to help ensure `cargo fix` and compiletest are aligned. There are some unpublished changes to `rustfix`, which will update in a future PR when those are published.

Will plan to update ui_test in the near future to avoid the duplicate.
2024-04-14 09:02:00 +02:00
bors
a3269e920c Auto merge of #123580 - rust-lang:cargo_update, r=Mark-Simulacrum
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt
    Updating expect-test v1.4.1 -> v1.5.0
    Updating getrandom v0.2.12 -> v0.2.13
    Updating h2 v0.3.25 -> v0.3.26 (latest: v0.4.4)
    Updating pest v2.7.8 -> v2.7.9
    Updating pest_derive v2.7.8 -> v2.7.9
    Updating pest_generator v2.7.8 -> v2.7.9
    Updating pest_meta v2.7.8 -> v2.7.9
    Updating pulldown-cmark v0.10.0 -> v0.10.2
    Updating rustversion v1.0.14 -> v1.0.15
    Updating strsim v0.11.0 -> v0.11.1
    Updating syn v2.0.57 -> v2.0.58
    Updating ui_test v0.22.2 -> v0.22.3
note: pass `--verbose` to see 86 unchanged dependencies behind latest
```
2024-04-14 07:01:45 +00:00
bors
0bf471f339 Auto merge of #123644 - dtolnay:cc, r=Mark-Simulacrum
Update non-bootstrap `cc` dependency to fix compile family detection warning

`x.py check compiler/rustc_llvm` **Before:**

(https://github.com/rust-lang/cc-rs/issues/958)

<pre>
Checking stage0 compiler artifacts {rustc_llvm} (x86_64-unknown-linux-gnu)
   Compiling cc v1.0.90
   Compiling libc v0.2.153
   Compiling rustc_llvm v0.0.0
<b>warning: rustc_llvm@0.0.0: Compiler version doesn't include clang or GCC: "c++" "--version"</b>
    Finished `release` profile [optimized] target(s) in 28.09s
</pre>

**After:**

<pre>
Checking stage0 compiler artifacts {rustc_llvm} (x86_64-unknown-linux-gnu)
   Compiling libc v0.2.153
   Compiling cc v1.0.92
   Compiling rustc_llvm v0.0.0
    Finished `release` profile [optimized] target(s) in 29.06s
</pre>
2024-04-13 21:24:56 +00:00
Eric Huss
123b303fd9 Update rustfix to 0.8.1 2024-04-13 10:54:13 -07:00
Matthias Krüger
b467eddf64
Rollup merge of #123796 - bjorn3:remove_cargo_platform, r=clubby789
Remove unused cargo-platform dependency from tidy

Noticed in https://github.com/rust-lang/rust/pull/123788#issuecomment-2049806519
2024-04-12 13:35:30 +02:00
bjorn3
55100e907e Remove unused cargo-platform dependency 2024-04-11 16:44:42 +00:00
klensy
124837d463 move QueryKeyStringCache from rustc_middle to rustc_query_impl, where it actually used
also allows to drop measureme dep on rustc_middle
2024-04-11 14:33:48 +03:00
Ralf Jung
385c363bdf update compiler_builtins to 0.1.109 2024-04-10 14:34:52 +02:00
bjorn3
dacfbfccc5 Update ar_archive_writer to 0.2.0
This adds a whole bunch of tests checking for any difference with llvm's
archive writer. It also fixes two mistakes in the porting from C++ to
Rust. The first one causes a divergence for Mach-O archives which may or
may not be harmless. The second will definitively cause issues, but only
applies to thin archives, which rustc currently doesn't create.
2024-04-09 17:45:02 +00:00
David Tolnay
224edac7a1
Update cc dependency to fix compile family detection warning 2024-04-08 13:00:16 -07:00