Commit Graph

257611 Commits

Author SHA1 Message Date
Guillaume Gomez be1d42776d
Rollup merge of #126410 - RalfJung:smir-const-operand, r=oli-obk
smir: merge identical Constant and ConstOperand types

The first commit renames the const operand visitor functions on regular MIR to match the type name, that was forgotten in the original rename.

The second commit changes stable MIR, fixing https://github.com/rust-lang/project-stable-mir/issues/71. Previously there were two different smir types for the MIR type `ConstOperand`, one used in `Operand` and one in `VarDebugInfoContents`.

Maybe we should have done this with https://github.com/rust-lang/rust/pull/125967, so there's only a single breaking change... but I saw that PR too late.

Fixes https://github.com/rust-lang/project-stable-mir/issues/71
2024-06-15 19:51:35 +02:00
Guillaume Gomez 709d862308
Rollup merge of #126404 - compiler-errors:alias-relate-terms, r=lcnr
Check that alias-relate terms are WF if reporting an error in alias-relate

Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given `<i32 as NotImplemented>::Assoc = ()` will drill down into `i32: NotImplemented` since we currently treat the projection as rigid.

r? lcnr
2024-06-15 19:51:35 +02:00
Guillaume Gomez 4f83c1d967
Rollup merge of #126229 - ChrisDenton:bindgen, r=Mark-Simulacrum
Bump windows-bindgen to 0.57

This PR updates our generated Windows API bindings using the latest version of `windows-bindgen`.

The only change to the generated code is that `derive` is used for `Copy` and `Clone` instead of `impl`.
2024-06-15 19:51:34 +02:00
bors 92af831290 Auto merge of #126518 - matthiaskrgr:rollup-wb70rzq, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #125829 (rustc_span: Add conveniences for working with span formats)
 - #126361 (Unify intrinsics body handling in StableMIR)
 - #126417 (Add `f16` and `f128` inline ASM support for `x86` and `x86-64`)
 - #126424 ( Also sort `crt-static` in `--print target-features` output)
 - #126428 (Polish `std::path::absolute` documentation.)
 - #126429 (Add `f16` and `f128` const eval for binary and unary operationations)
 - #126448 (End support for Python 3.8 in tidy)
 - #126488 (Use `std::path::absolute` in bootstrap)
 - #126511 (.mailmap: Associate both my work and my private email with me)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-15 14:51:12 +00:00
Matthias Krüger 128e2b479c
Rollup merge of #126511 - Enselic:mailmap, r=lqd
.mailmap: Associate both my work and my private email with me

Mainly so that 73 + 60 is summed to 133 on the [thanks](https://thanks.rust-lang.org/rust/all-time/) page.
2024-06-15 14:40:52 +02:00
Matthias Krüger d00e71ebb9
Rollup merge of #126488 - ChrisDenton:absolute, r=albertlarsan68
Use `std::path::absolute` in bootstrap

`std::path::absolute` is now stable in 1.79 so we can get rid of the copy-pasted version.
2024-06-15 14:40:51 +02:00
Matthias Krüger 4f9bf4c357
Rollup merge of #126448 - DianQK:tidy-python, r=onur-ozkan
End support for Python 3.8 in tidy

Python 3.8 will reach its end of support in October 2024. You can find more details [here](https://devguide.python.org/versions/).

### NixOS

NixOS has already discontinued provide Python 3.8. For more information, visit their [package search page](https://search.nixos.org/packages?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=python38).

### Debian

- **Debian 11 (Bullseye)**: The default Python version is 3.9. More information is available [here](https://packages.debian.org/bullseye/python3).
- **Debian 10 (Buster) (EOL 2024-10)**: The default Python version is 3.7. Details can be found [here](https://packages.debian.org/buster/python3).

### Ubuntu

- **Ubuntu 20.04 'Focal Fossa' (LTS)**: The default Python version is 3.8.2. However, Python 3.9 is also available. You can find more information on these packages [here](https://packages.ubuntu.com/focal/python3) and [here](https://packages.ubuntu.com/focal/python3.9).
- **Ubuntu 22.04 'Jammy Jellyfish' (LTS)**: The default Python version is 3.10.6. More details can be found [here](https://packages.ubuntu.com/jammy/python3).
2024-06-15 14:40:51 +02:00
Matthias Krüger 3775f2f5d0
Rollup merge of #126429 - tgross35:f16-f128-const-eval, r=RalfJung
Add `f16` and `f128` const eval for binary and unary operationations

Add const evaluation and Miri support for f16 and f128, including unary and binary operations. Casts are not yet included.

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

r? ``@RalfJung``
2024-06-15 14:40:50 +02:00
Matthias Krüger a2249027cd
Rollup merge of #126428 - kpreid:absolute, r=jhpratt
Polish `std::path::absolute` documentation.

These changes bring it closer to other standard library documentation and, in particular, `std::fs::canonicalize`, which it will often be compared with.

* Add `# Platform-specific behavior` section, with content moved from Examples section.
* Create `# Errors` section.
* Phrase error description to allow future platforms to have new syntactic errors, rather than only emptiness.
* Add missing commas.
* Indent example code 4 spaces.
2024-06-15 14:40:49 +02:00
Matthias Krüger 21de99258f
Rollup merge of #126424 - Enselic:sort-target-features, r=lqd
Also sort `crt-static` in `--print target-features` output

I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom of the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out and remains sorted and does not need to be sorted an extra time.

On my machine the diff is just:

```diff
$ diff -u /tmp/before2.txt /tmp/after2.txt
--- /tmp/before2.txt    2024-06-13 20:40:27.091636592 +0200
+++ /tmp/after2.txt     2024-06-13 20:39:54.584894891 +0200
``@@`` -20,6 +20,7 ``@@``
     bmi1                            - Support BMI instructions.
     bmi2                            - Support BMI2 instructions.
     cmpxchg16b                      - 64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips).
+    crt-static                      - Enables C Run-time Libraries to be statically linked.
     ermsb                           - REP MOVS/STOS are fast.
     f16c                            - Support 16-bit floating point conversion instructions.
     fma                             - Enable three-operand fused multiple-add.
``@@`` -49,7 +50,6 ``@@``
     xsavec                          - Support xsavec instructions.
     xsaveopt                        - Support xsaveopt instructions.
     xsaves                          - Support xsaves instructions.
-    crt-static                      - Enables C Run-time Libraries to be statically linked.

 Code-generation features supported by LLVM for this target:
     16bit-mode                      - 16-bit mode (i8086).
```

I couldn't find a ui test that tested this output. Let's see if CI finds a regression tests.
2024-06-15 14:40:49 +02:00
Matthias Krüger 0f2cc21547
Rollup merge of #126417 - beetrees:f16-f128-inline-asm-x86, r=Amanieu
Add `f16` and `f128` inline ASM support for `x86` and `x86-64`

This PR adds `f16` and `f128` input and output support to inline ASM on `x86` and `x86-64`. `f16` vector sizes are taken from [here](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html).

Relevant issue: #125398
Tracking issue: #116909

``@rustbot`` label +F-f16_and_f128
2024-06-15 14:40:48 +02:00
Matthias Krüger dad74aa67c
Rollup merge of #126361 - celinval:issue-0079-intrinsic, r=oli-obk
Unify intrinsics body handling in StableMIR

rust-lang/rust#120675 introduced a new mechanism to declare intrinsics which will potentially replace the rust-intrinsic ABI.

The new mechanism introduces a placeholder body and mark the intrinsic with `#[rustc_intrinsic_must_be_overridden]`.
In practice, this means that a backend should not generate code for the placeholder, and shim the intrinsic.
The new annotation is an internal compiler implementation, and it doesn't need to be exposed to StableMIR users.

In this PR, we unify the interface for intrinsics marked with `rustc_intrinsic_must_be_overridden` and intrinsics that do not have a body.

Fixes https://github.com/rust-lang/project-stable-mir/issues/79

r? ``@oli-obk``

cc: ``@momvart``
2024-06-15 14:40:48 +02:00
Matthias Krüger 5fac57284e
Rollup merge of #125829 - petrochenkov:upctxt2, r=michaelwoerister
rustc_span: Add conveniences for working with span formats

This is the refactoring part of https://github.com/rust-lang/rust/pull/125017.
2024-06-15 14:40:47 +02:00
bors 687a68d679 Auto merge of #126514 - matthiaskrgr:rollup-pnwi8ns, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #126354 (Use `Variance` glob imported variants everywhere)
 - #126367 (Point out failing never obligation for `DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK`)
 - #126469 (MIR Shl/Shr: the offset can be computed with rem_euclid)
 - #126471 (Use a consistent way to filter out bounds instead of splitting it into three places)
 - #126472 (build `libcxx-version` only when it doesn't exist)
 - #126497 (delegation: Fix hygiene for `self`)
 - #126501 (make bors ignore comments in PR template)
 - #126509 (std: suggest OnceLock over Once)
 - #126512 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-15 12:38:17 +00:00
Matthias Krüger 92ad0b1cd2
Rollup merge of #126512 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-06-15 10:56:45 +02:00
Matthias Krüger 83cbceac0f
Rollup merge of #126509 - workingjubilee:gently-discourage-doing-things-once, r=jhpratt
std: suggest OnceLock over Once

It was noted in https://github.com/rust-lang/rust/issues/125615#issuecomment-2149590818 that Once is not necessary in most cases and should be discouraged. Once is really just an implementation detail of OnceLock that others can use if they want. Suggest they use OnceLock instead.
2024-06-15 10:56:44 +02:00
Matthias Krüger e287a00018
Rollup merge of #126501 - lqd:fix-pr-template, r=Mark-Simulacrum
make bors ignore comments in PR template

As discussed [here](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/default.20PR.20description.20feedback/near/444794577), the existing PR template is not yet ignored by bors and the html comments show up in git history.

This PR uses markers so the html comments are deleted by the bot.

r? lcnr
2024-06-15 10:56:44 +02:00
Matthias Krüger 4265043aae
Rollup merge of #126497 - petrochenkov:delehyg, r=compiler-errors
delegation: Fix hygiene for `self`

And fix diagnostics for `self` from a macro.

The missing rib caused `self` to be treated as a generic parameter and ignore `macro_rules` hygiene.

Addresses this comment https://github.com/rust-lang/rust/pull/124135#discussion_r1637492234.
2024-06-15 10:56:43 +02:00
Matthias Krüger b5dd3d4ada
Rollup merge of #126472 - onur-ozkan:improve-libcxx-build, r=Kobzol
build `libcxx-version` only when it doesn't exist

In https://github.com/rust-lang/rust/issues/126423, it seems like c++ parsing takes quite amount of time on bootstrap startups. This PR makes libcxx-version to be compiled only when it doesn't exist.

A simple demonstration on the overhead of buiding `libcxx-version`:

```sh
$ rm -rf build/host/libcxx-version

$ x build
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.07s

 ----- LIBCXX VERSION CHECK TOOK: 509ms
Building tool rustdoc (stage1 -> stage2, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized] target(s) in 0.25s
Build completed successfully in 0:00:02

$ x build
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.07s

 ----- LIBCXX VERSION CHECK TOOK: 2ms
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
Building tool rustdoc (stage1 -> stage2, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized] target(s) in 0.14s
Build completed successfully in 0:00:01
```
2024-06-15 10:56:43 +02:00
Matthias Krüger 6f21da3bb4
Rollup merge of #126471 - oli-obk:filter_loop, r=compiler-errors
Use a consistent way to filter out bounds instead of splitting it into three places

just a small cleanup, no logic change.

Initially the code had me looking for why anything was special here, only to realize there's nothing interesting going on
2024-06-15 10:56:42 +02:00
Matthias Krüger f24509aa23
Rollup merge of #126469 - RalfJung:mir-shifts, r=scottmcm
MIR Shl/Shr: the offset can be computed with rem_euclid

r? ````@scottmcm````
2024-06-15 10:56:41 +02:00
Matthias Krüger b473ec2744
Rollup merge of #126367 - compiler-errors:point-out-failing-never-obligation, r=WaffleLapkin
Point out failing never obligation for `DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK`

Based on top of #125289, so just need to look at the last commit.

r? `@WaffleLapkin`
2024-06-15 10:56:41 +02:00
Matthias Krüger 335e320baa
Rollup merge of #126354 - compiler-errors:variance, r=lcnr
Use `Variance` glob imported variants everywhere

Fully commit to using the globbed variance. Could be convinced the other way, and change this PR to not use the globbed variants anywhere, but I'd rather we do one or the other.

r? lcnr
2024-06-15 10:56:40 +02:00
bors 1d1356d0f6 Auto merge of #125722 - Urgau:non_local_defs-macro-to-change, r=estebank
Indicate in `non_local_defs` lint that the macro needs to change

This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output.

Address https://github.com/rust-lang/rust/pull/125089#discussion_r1616311862
Fixes #125681
r? `@estebank`
2024-06-15 08:50:44 +00:00
Martin Nordholts 297c97dbe0 .mailmap: Associate both my work and my private email with me 2024-06-15 09:27:39 +02:00
bors 3f2c50c541 Auto merge of #3672 - RalfJung:cargo-many-seeds, r=RalfJung
cargo miri: add support for '--many-seeds'

to run the program / tests many times with different seeds: `cargo miri run --many-seeds` / `cargo miri test --many-seeds`.

`@rust-lang/miri` any opinion on the flag name here? Should it be `-Zmiri-many-seeds` or is `--many-seeds` fine?

Fixes https://github.com/rust-lang/miri/issues/3546
2024-06-15 07:20:34 +00:00
Jubilee Young b8eb6ad032 std: suggest OnceLock over Once 2024-06-15 00:09:03 -07:00
bors 8217b412a2 Auto merge of #126491 - compiler-errors:is_lang_item, r=oli-obk
Add `TyCtxt::is_lang_item`, use it in the compiler

```rust
pub fn is_lang_item(self, def_id: DefId, lang_item: LangItem) -> bool;
```

Easier than having to use `Some(def_id) == tcx.lang_items().iterator_trait()` or something. Also makes it easier to turn into `TraitSolverLangItem` in the future. Hope it's not too bad for perf.

r? `@lcnr` or `@oli-obk`
2024-06-15 06:38:21 +00:00
bors 9239d3eb2b Auto merge of #126507 - weihanglo:update-cargo, r=weihanglo
Update cargo

13 commits in 4dcbca118ab7f9ffac4728004c983754bc6a04ff..a1f47ec3f7cd076986f1bfcd7061f2e8cb1a726e
2024-06-11 16:27:02 +0000 to 2024-06-15 01:10:07 +0000
- Change verification order during packaging. (rust-lang/cargo#14074)
- Update git2 for libgit2 1.8.1 (rust-lang/cargo#14067)
- Fix some documentation misspellings (rust-lang/cargo#14066)
- chore(deps): update msrv (1 version) to v1.79 (rust-lang/cargo#14063)
- test: Redact conditional compile-fail warning (rust-lang/cargo#14064)
- Migrate a few test files to snapbox (rust-lang/cargo#14048)
- docs(contrib): Improve triage instructions (rust-lang/cargo#14052)
- chore(ci): Upgrade cargo-semver-checks (rust-lang/cargo#14062)
- Revert rust-lang/cargo#13630 as rustc ignores `-C strip` on MSVC (rust-lang/cargo#14061)
- test: migrate features_are_quoted to snapbox (rust-lang/cargo#14051)
- Add assert redactions (rust-lang/cargo#14054)
- test: migrate build_script_env to snapbox (rust-lang/cargo#14044)
- docs: Iterate on --breaking docs (rust-lang/cargo#14047)

r? ghost
2024-06-15 04:08:36 +00:00
Weihang Lo 9efa158872
Update cargo 2024-06-14 23:04:53 -04:00
bors 3fc81daffd Auto merge of #122613 - Zalathar:profiler, r=nnethercote
Don't build a broken/untested profiler runtime on mingw targets

Context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Why.20build.20a.20broken.2Funtested.20profiler.20runtime.20on.20mingw.3F

#75872 added `--enable-profiler` to the `x86_64-mingw` job (to cause some additional tests to run), but had to also add `//@ ignore-windows-gnu` to all of the tests that rely on the profiler runtime actually *working*, because it's broken on that target.

We can achieve a similar outcome by going through all the `//@ needs-profiler-support` tests that don't actually need to produce/run a binary, and making them use `-Zno-profiler-runtime` instead, so that they can run even in configurations that don't have the profiler runtime available. Then we can remove `--enable-profiler` from `x86_64-mingw`, and still get the same amount of testing.

This PR also removes `--enable-profiler` from the mingw dist builds, since it is broken/untested on that target. Those builds have had that flag for a very long time.
2024-06-15 00:04:01 +00:00
Rémy Rakic c006748f62 make bors ignore comments in PR template 2024-06-14 21:52:25 +00:00
Vadim Petrochenkov cbc3bdbe01 delegation: Fix hygiene for `self`
And fix diagnostics for `self` from a macro.
2024-06-15 00:45:05 +03:00
Michael Goulet 0562064959 Correctly consider depth when visiting WF goals 2024-06-14 17:19:58 -04:00
Michael Goulet 93ff86ed7c Use is_lang_item more aggressively 2024-06-14 16:54:29 -04:00
Michael Goulet d5c48ebc71 Add TyCtxt::is_lang_item 2024-06-14 16:50:07 -04:00
Kevin Reid 416888f05b Polish `std::path::absolute` documentation.
These changes bring it closer to other standard library documentation
and, in particular, `std::fs::canonicalize`, which it will often be
compared with.

* Add `# Platform-specific behavior` section, with content moved from
  Examples section.
* Create `# Errors` section.
* Phrase error description to allow future platforms to have new
  syntactic errors, rather than only emptiness.
* Add missing commas.
* Indent example code 4 spaces.
2024-06-14 13:13:27 -07:00
Chris Denton 78d4802448
Use `std::path::absolute` in bootstrap 2024-06-14 19:50:11 +00:00
Trevor Gross e649042316 Remove f16 const eval crash test
Const eval negation was added. This test is now covered by Miri tests,
and merged into an existing UI test.

Fixes <https://github.com/rust-lang/rust/issues/124583>
2024-06-14 12:47:42 -05:00
Trevor Gross 5cb58ad503 Add `f16` and `f128` support to Miri 2024-06-14 12:47:38 -05:00
Trevor Gross eab5e8e9d9 Make the unary operator `FloatTy` check exhaustive
Add a spot that was missed in
<https://github.com/rust-lang/rust/pull/121997>.
2024-06-14 12:43:58 -05:00
Trevor Gross c906d2e428 Enable const evaluation for `f16` and `f128`
This excludes casting, which needs more tests.
2024-06-14 12:43:48 -05:00
Martin Nordholts 04af37170c Also sort `crt-static` in `--print target-features` output
I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`),
because it was put at the bottom the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out sorted and does not need to
be sorted an extra time.
2024-06-14 19:29:23 +02:00
bors f8e5660532 Auto merge of #118958 - c410-f3r:concat-again, r=petrochenkov
Add a new concat metavar expr

Revival of #111930

Giving it another try now that #117050 was merged.

With the new rules, meta-variable expressions must be referenced with a dollar sign (`$`) and this can cause misunderstands with `$concat`.

```rust
macro_rules! foo {
    ( $bar:ident ) => {
        const ${concat(VAR, bar)}: i32 = 1;
    };
}

// Will produce `VARbar` instead of `VAR_123`
foo!(_123);
```

In other words, forgetting the dollar symbol can produce undesired outputs.

cc #29599
cc https://github.com/rust-lang/rust/issues/124225
2024-06-14 16:41:39 +00:00
bors 7ac6c2fc68 Auto merge of #125347 - tesuji:needtests, r=nikic
Add codegen tests for E-needs-test

close #36010
close #68667
close #74938
close #83585
close #93036
close #109328
close #110797
close #111508
close #112509
close #113757
close #120440
close #118392
close #71096

r? nikic
2024-06-14 13:40:52 +00:00
bors f9515fdd5a Auto merge of #126473 - matthiaskrgr:rollup-8w2xm09, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123769 (Improve escaping of byte, byte str, and c str proc-macro literals)
 - #126054 (`E0229`: Suggest Moving Type Constraints to Type Parameter Declaration)
 - #126135 (add HermitOS support for vectored read/write operations)
 - #126266 (Unify guarantees about the default allocator)
 - #126285 (`UniqueRc`: support allocators and `T: ?Sized`.)
 - #126399 (extend the check for LLVM build)
 - #126426 (const validation: fix ICE on dangling ZST reference)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-14 11:29:58 +00:00
DianQK ab7fc60a73
End support for Python 3.8 in tidy 2024-06-14 19:04:16 +08:00
DianQK 7999dbbd3e
Regenerate `requirements.txt` by Python 3.9 2024-06-14 19:04:15 +08:00
onur-ozkan e2e1afaf6d update libstdc++ compatibility error log
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-14 13:30:53 +03:00
onur-ozkan ad787c1034 build `libcxx-version` only when it doesn't exist
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-14 13:30:16 +03:00