Commit Graph

300570 Commits

Author SHA1 Message Date
rustbot
26e1115ca8 Update books 2025-06-30 19:01:15 +02:00
Dario Heinisch
a1e6ae9c3e FIX: NegMultiply should preserve parenthesis when method is called
changelog: [`neg_multiply`] does not remove parenthesis anymore if a method
is being called on the affected expression
2025-06-30 18:54:49 +02:00
Laurențiu Nicola
c5f4b80cb9 Merge pull request #20128 from lnicola/sync-from-rust
Sync from downstream
2025-06-30 15:11:33 +00:00
Trevor Gross
4fd37c7198 Disable f16 on Aarch64 without neon for llvm < 20.1.1
This check was added unconditionally in c51b229140 ("Disable f16 on
Aarch64 without `neon`") and reverted in 4a8d35709e ("Revert "Disable
`f16` on Aarch64 without `neon`"") since it did not fail in Rust's
build. However, it is still possible to hit this crash if using LLVM 19
built with assertions, so disable the type conditionally based on
version here.

Note that for these builds, a similar patch is needed in the build
script for `compiler-builtins` since it does not yet use
`cfg(target_has_reliable_f16)` (hopefully to be resolved in the near
future).

Report: https://www.github.com/rust-lang/rust/pull/139276#issuecomment-3014781652
Original LLVM issue: https://www.github.com/llvm/llvm-project/issues/129394
2025-06-30 09:46:56 -05:00
Laurențiu Nicola
0edf5726c7 Merge from rust-lang/rust 2025-06-30 17:42:03 +03:00
Laurențiu Nicola
3b5b35052c Preparing for merge from rust-lang/rust 2025-06-30 17:41:18 +03:00
bors
c65dccabac Auto merge of #143233 - dianqk:rollup-lcx3278, r=dianqk
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#142429 (`tests/ui`: A New Order [13/N])
 - rust-lang/rust#142514 (Miri: handling of SNaN inputs in `f*::pow` operations)
 - rust-lang/rust#143066 (Use let chains in the new solver)
 - rust-lang/rust#143090 (Workaround for memory unsafety in third party DLLs)
 - rust-lang/rust#143118 (`tests/ui`: A New Order [15/N])
 - rust-lang/rust#143159 (Do not freshen `ReError`)
 - rust-lang/rust#143168 (`tests/ui`: A New Order [16/N])
 - rust-lang/rust#143176 (fix typos and improve clarity in documentation)
 - rust-lang/rust#143187 (Add my work email to mailmap)
 - rust-lang/rust#143190 (Use the `new` method for `BasicBlockData` and `Statement`)
 - rust-lang/rust#143195 (`tests/ui`: A New Order [17/N])
 - rust-lang/rust#143196 (Port #[link_section] to the new attribute parsing infrastructure)
 - rust-lang/rust#143199 (Re-disable `tests/run-make/short-ice` on Windows MSVC again)
 - rust-lang/rust#143219 (Show auto trait and blanket impls for `!`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-30 14:28:58 +00:00
Guillaume Gomez
666934ac54 Merge commit '4b5c44b14166083eef8d71f15f5ea1f53fc976a0' into subtree-update_cg_gcc_2025-06-30 2025-06-30 16:12:42 +02:00
Guillaume Gomez
609a8abaab Merge commit '4b5c44b14166083eef8d71f15f5ea1f53fc976a0' into subtree-update_cg_gcc_2025-06-30 2025-06-30 16:12:42 +02:00
antoyo
4b5c44b141 Merge pull request #725 from FractalFir/intrinsic_fix
Fixes #724
2025-06-30 10:08:00 -04:00
Trevor Gross
a4d584e7a6 josh-sync: Replace #xxxx-style links in messages
Often our short summaries will pick up a Bors "Auto merge of #xxxx ...`
commit message. Replace these with something like `rust-lang/rust#1234`
to avoid broken links when going between repositories.
2025-06-30 09:01:21 -05:00
antoyo
ce73bab440 Merge pull request #726 from rust-lang/fix/const_undef
Fix const_undef
2025-06-30 09:43:31 -04:00
Nurzhan Sakén
468f91314b Stabilize mixed_integer_ops_unsigned_sub 2025-06-30 17:37:38 +04:00
Michael Goulet
4698c92101 Assemble const bounds via normal item bounds in old solver too 2025-06-30 13:37:26 +00:00
Antoni Boucher
1926f605f9 Fix const_undef 2025-06-30 09:20:39 -04:00
Jakub Beránek
5cf2a50da7 Add change tracker entry 2025-06-30 14:57:39 +02:00
Cameron Steffen
dc9879cb3d Remove let_chains feature 2025-06-30 07:49:20 -05:00
alexey semenyuk
f3b3c096fd Polishing changelog update doc 2025-06-30 17:19:12 +05:00
bors
ad3b725761 Auto merge of #142839 - oli-obk:denullarification, r=RalfJung,celinval
Stop backends from needing to support nullary intrinsics

And then remove our infrastructure special casing them. Further improvements can now be done to them by avoiding the intermediate ConstValue step, but let's leave that to follow up work

r? `@RalfJung`
2025-06-30 11:24:47 +00:00
dianqk
c2904f7476 Rollup merge of #143219 - zachs18:patch-5, r=tgross35
Show auto trait and blanket impls for `!`

Add an empty `impl ! {}` so rustdoc shows auto trait impls and blanket impls on `!`'s documentation page.

This is already done for [unit](2f0ad2a71e/library/core/src/primitive_docs.rs (L493)), [tuples](2f0ad2a71e/library/core/src/primitive_docs.rs (L1148)), and [`fn` pointers](2f0ad2a71e/library/core/src/primitive_docs.rs (L1874)).

cc https://github.com/rust-lang/rust/pull/97842 ``@notriddle`` which added the same for unit and tuple.

<details><summary>Comparison</summary>

[Before (current):](https://doc.rust-lang.org/nightly/std/primitive.never.html)
![image](https://github.com/user-attachments/assets/eab8126d-8d65-46d4-8dc7-3680f3162ce3)

After:
![image](https://github.com/user-attachments/assets/e0868113-ebef-4c64-ac30-dfe740d7ea38)
</details>

``@rustbot`` label A-docs F-never_type
2025-06-30 19:23:22 +08:00
dianqk
e18342a7e8 Rollup merge of #143199 - jieyouxu:short-ice, r=RalfJung
Re-disable `tests/run-make/short-ice` on Windows MSVC again

We tried to re-enable this for MSVC in https://github.com/rust-lang/rust/pull/142844.

Unfortunately, this test still sometimes fails on Windows MSVC.
Tracked in https://github.com/rust-lang/rust/issues/143198.

FYI ```@dpaoliello``` (I couldn't reproduce this easily locally either)
2025-06-30 19:23:22 +08:00
dianqk
7760cd6154 Rollup merge of #143196 - Periodic1911:link_section, r=oli-obk
Port #[link_section] to the new attribute parsing infrastructure

Ports link_section to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? `@oli-obk`

cc `@JonathanBrouwer` `@jdonszelmann`
2025-06-30 19:23:21 +08:00
dianqk
327fe35db3 Rollup merge of #143195 - Kivooeo:tf17, r=tgross35
`tests/ui`: A New Order [17/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? `@tgross35`
2025-06-30 19:23:21 +08:00
dianqk
ab633af710 Rollup merge of #143190 - dianqk:new-method, r=oli-obk
Use the `new` method for `BasicBlockData` and `Statement`

This is the NFC part of rust-lang/rust#142771. I split it to make it easier to review for rust-lang/rust#142771. Even without rust-lang/rust#142771, I think this change is worthwhile.
2025-06-30 19:23:20 +08:00
dianqk
043fc5b230 Rollup merge of #143187 - yotamofek:mailmap, r=jieyouxu
Add my work email to mailmap
2025-06-30 19:23:20 +08:00
dianqk
462c7c3fd8 Rollup merge of #143176 - kilavvy:master, r=jieyouxu
fix typos and improve clarity in documentation

```
Description:

This pull request corrects minor typos and improves wording for clarity across several documentation files, including:

- Correcting instrinsics → intrinsics
- Correcting preferrably → preferably
- Correcting Orginally → Originally
-  Correcting resiliant → resilient

```
2025-06-30 19:23:19 +08:00
dianqk
8ccffc987a Rollup merge of #143168 - Kivooeo:tf16, r=tgross35
`tests/ui`: A New Order [16/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? `@tgross35`

(just small one to test new method, also I should squash all this commits except move commit, so we after review will end up having like one move commit and one commit with changes, right?)
2025-06-30 19:23:18 +08:00
dianqk
3a35f36ae8 Rollup merge of #143159 - compiler-errors:freshen-re-error, r=oli-obk
Do not freshen `ReError`

Because `ReError` has `ErrorGuaranteed` in it, it affects candidate selection and thus causes incompleteness which leads to weirdness in eval. See the comment in the test.

Also remove an unnecessary `lookup_op_method` since it doesn't effect tests.

Fixes rust-lang/rust#132882.

r? types
2025-06-30 19:23:18 +08:00
dianqk
0952f86de3 Rollup merge of #143118 - Kivooeo:tf15, r=tgross35
`tests/ui`: A New Order [15/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? `@jieyouxu`
2025-06-30 19:23:17 +08:00
dianqk
a94f0a4af8 Rollup merge of #143090 - ChrisDenton:workaround1, r=tgross35
Workaround for memory unsafety in third party DLLs

Resolves rust-lang/rust#143078

Note that we can't make any guarantees if third parties intercept OS functions and don't implement them according to the documentation. However, I think it's practical to attempt mitigations when issues are encountered in the wild and the mitigation itself isn't too invasive.
2025-06-30 19:23:16 +08:00
dianqk
8c4bcb8625 Rollup merge of #143066 - compiler-errors:let-chain-solver, r=lcnr
Use let chains in the new solver

Self-explanatory

Let chains are stable as of today

r? lcnr
2025-06-30 19:23:16 +08:00
dianqk
d2dc99cc83 Rollup merge of #142514 - LorrensP-2158466:miri-float-nondet-pow, r=RalfJung
Miri: handling of SNaN inputs in `f*::pow` operations

fixes [miri/#4286](https://github.com/rust-lang/miri/issues/4286) and related to rust-lang/rust#138062 and [miri/#4208](https://github.com/rust-lang/miri/issues/4208#issue-2879058184).

For the following cases of the powf or powi operations, Miri returns either `1.0` or an arbitrary `NaN`:
- `powf(SNaN, 0.0)`
- `powf(1.0, SNaN)`
- `powi(SNaN, 0)`

Also added a macro in `miri/tests/pass/float.rs` which conveniently checks if both are indeed returned from such an operation.

Made these changes in the rust repo so I could test against stdlib, since these were impacted some time ago and were fixed in rust-lang/rust#138062. Tested with:
```fish
env MIRIFLAGS=-Zmiri-many-seeds ./x miri --no-fail-fast std core coretests -- f32 f64
```
This was successful. This does take a while, so I recommend using `--no-doc` and separate use of `f32` or `f64`

The pr is somewhat split up into 3 main commits, which implement the cases described above. The first commit also introduces the macro, and the last commit is just a global refactor of some things.

r? `@RalfJung`
2025-06-30 19:23:15 +08:00
dianqk
384d699893 Rollup merge of #142429 - Kivooeo:tf13, r=jieyouxu
`tests/ui`: A New Order [13/N]

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ```@jieyouxu```
2025-06-30 19:23:14 +08:00
Nicholas Nethercote
6709720e4c Introduce ByteSymbol.
It's like `Symbol` but for byte strings. The interner is now used for
both `Symbol` and `ByteSymbol`. E.g. if you intern `"dog"` and `b"dog"`
you'll get a `Symbol` and a `ByteSymbol` with the same index and the
characters will only be stored once.

The motivation for this is to eliminate the `Arc`s in `ast::LitKind`, to
make `ast::LitKind` impl `Copy`, and to avoid the need to arena-allocate
`ast::LitKind` in HIR. The latter change reduces peak memory by a
non-trivial amount on literal-heavy benchmarks such as `deep-vector` and
`tuple-stress`.

`Encoder`, `Decoder`, `SpanEncoder`, and `SpanDecoder` all get some
changes so that they can handle normal strings and byte strings.

This change does slow down compilation of programs that use
`include_bytes!` on large files, because the contents of those files are
now interned (hashed). This makes `include_bytes!` more similar to
`include_str!`, though `include_bytes!` contents still aren't escaped,
and hashing is still much cheaper than escaping.
2025-06-30 20:42:27 +10:00
Nicholas Nethercote
478f8287c0 Introduce ByteSymbol.
It's like `Symbol` but for byte strings. The interner is now used for
both `Symbol` and `ByteSymbol`. E.g. if you intern `"dog"` and `b"dog"`
you'll get a `Symbol` and a `ByteSymbol` with the same index and the
characters will only be stored once.

The motivation for this is to eliminate the `Arc`s in `ast::LitKind`, to
make `ast::LitKind` impl `Copy`, and to avoid the need to arena-allocate
`ast::LitKind` in HIR. The latter change reduces peak memory by a
non-trivial amount on literal-heavy benchmarks such as `deep-vector` and
`tuple-stress`.

`Encoder`, `Decoder`, `SpanEncoder`, and `SpanDecoder` all get some
changes so that they can handle normal strings and byte strings.

This change does slow down compilation of programs that use
`include_bytes!` on large files, because the contents of those files are
now interned (hashed). This makes `include_bytes!` more similar to
`include_str!`, though `include_bytes!` contents still aren't escaped,
and hashing is still much cheaper than escaping.
2025-06-30 20:42:27 +10:00
Young-Flash
594252fdc4 test: add test case for func with multiline param list 2025-06-30 17:36:16 +08:00
Young-Flash
e0e21dd939 internal: add FoldKind::Function 2025-06-30 17:36:16 +08:00
Young-Flash
383dcd5007 feat: support folding multiline arg list & fn body in one folding range 2025-06-30 17:34:02 +08:00
Oli Scherer
422eea2863 Don't run hir wfcheck if ty wfcheck handled everything 2025-06-30 08:47:53 +00:00
Oli Scherer
65aac24a08 Avoid some eager uses of HIR spans 2025-06-30 08:45:43 +00:00
Oli Scherer
5ddae353fe Stop requiring HIR for impl item wf checks 2025-06-30 08:45:43 +00:00
Oli Scherer
38ef94aef1 Stop requiring HIR for trait item wf checks 2025-06-30 08:45:43 +00:00
Oli Scherer
6166cd6b50 Avoid looking at HIR for trait and impl items 2025-06-30 08:45:43 +00:00
Oli Scherer
70215dfe61 Avoid eagerly loading the hir fn sig 2025-06-30 08:45:43 +00:00
Oli Scherer
5940109a04 Merge lower_trait_item and lower_impl_item into check_item_type 2025-06-30 08:45:43 +00:00
Oli Scherer
cb158c2119 Merge lower_item into check_item_type 2025-06-30 08:45:43 +00:00
Oli Scherer
632a921479 Move lazy type alias checks to non-hir-wfck 2025-06-30 08:45:43 +00:00
Oli Scherer
28f023c751 Use predicate spans instead of whole item spans 2025-06-30 08:45:43 +00:00
Oli Scherer
ee8fa4eb16 Check variances in the non-hir wfchecker 2025-06-30 08:45:43 +00:00
Oli Scherer
d27c05709c Make variance wfcheck only use the HIR in the error path 2025-06-30 08:45:43 +00:00