301225 Commits

Author SHA1 Message Date
bors
1079c5edb2 Auto merge of #144145 - matthiaskrgr:rollup-swc74s4, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter)
 - rust-lang/rust#142673 (Show the offset, length and memory of uninit read errors)
 - rust-lang/rust#142693 (More robustly deal with relaxed bounds and improve their diagnostics)
 - rust-lang/rust#143382 (stabilize `const_slice_reverse`)
 - rust-lang/rust#143928 (opt-dist: make llvm builds optional)
 - rust-lang/rust#143961 (Correct which exploit mitigations are enabled by default)
 - rust-lang/rust#144050 (Fix encoding of link_section and no_mangle cross crate)
 - rust-lang/rust#144059 (Refactor `CrateLoader` into the `CStore`)
 - rust-lang/rust#144123 (Generalize `unsize` and `unsize_into` destinations)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-19 05:02:40 +00:00
The Miri Cronjob Bot
b8bcb4dd64 Preparing for merge from rustc 2025-07-19 04:57:12 +00:00
beepster4096
2a037503ef debug impls for drop elaborators 2025-07-18 17:31:48 -07:00
Manuel Drehwald
c068599173 add unstable-books doc for offload 2025-07-18 16:30:46 -07:00
Manuel Drehwald
e2ab312c94 add gpu offload codegen host side test 2025-07-18 16:30:46 -07:00
Manuel Drehwald
4a1a5a4295 gpu host code generation 2025-07-18 16:30:42 -07:00
Manuel Drehwald
5958ebe829 add various wrappers for gpu code generation 2025-07-18 16:24:12 -07:00
Manuel Drehwald
634016478e add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation 2025-07-18 16:24:00 -07:00
Manuel Drehwald
42d6b0d8bc make more builder functions generic 2025-07-18 16:23:54 -07:00
Manuel Drehwald
3fb1af3987 enzyme submodule update 2025-07-18 16:23:47 -07:00
bors
ebd8557637 Auto merge of #144140 - GuillaumeGomez:subtree-update_cg_gcc_2025-07-18, r=GuillaumeGomez
Subtree update cg gcc 2025 07 18

cc `@antoyo`

r? ghost
2025-07-18 21:53:28 +00:00
Amanieu d'Antras
9b7d31c851
Merge pull request #1862 from folkertdev/combine-c-files
`intrinsic-test`: combine C files for faster compilation
2025-07-18 21:23:35 +00:00
Guillaume Gomez
f16474f7bf Remove forgotten git annotations 2025-07-18 22:35:58 +02:00
Amanieu d'Antras
8fe55684d8
Merge pull request #1860 from folkertdev/stdarch-test-cleanup
`stdarch-test`: various cleanups
2025-07-18 20:27:56 +00:00
Marijn Schouten
c79f62d1ea clippy fix: bound in one place 2025-07-18 20:13:24 +00:00
Jason Newcomb
ae8ff77d00
Warn about const instability wrt MSRV (#15297)
This makes `const` contexts use the `const`-stability version
information instead of the regular stability one, as `const`-stability
may happen much later than stability in non-`const` contexts.

~~It includes the content of PR rust-lang/rust-clippy#15296 as its first
commit. I separated them because this one is more complex, and
rust-lang/rust-clippy#15296 may be merged more rapidly.~~

changelog: [`incompatible_msrv`]: check the right MSRV when in a `const`
context

r? Jarcho @rustbot label +C-bug +I-false-negative
2025-07-18 19:11:27 +00:00
The rustc-josh-sync Cronjob Bot
3f04631ce0 Merge ref '82310651b93a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 82310651b93a594a3fd69015e1562186a080d94c
Filtered ref: e13c0be8f13737c64082b89ce834546079767ac4

This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-18 19:06:49 +00:00
The rustc-josh-sync Cronjob Bot
208687e9d3 Prepare for merging from rust-lang/rust
This updates the rust-version file to 82310651b93a594a3fd69015e1562186a080d94c.
2025-07-18 19:04:50 +00:00
Makai
20a7f722d8 fix ui/rustc_public-ir-print outputs 2025-07-18 18:49:33 +00:00
Makai
4d79328091 use RustcPublic instead of StableMir 2025-07-18 18:49:32 +00:00
Makai
483877a9b2 Update docs in rustc_public 2025-07-18 18:49:12 +00:00
Makai
95338717f1 Update docs in rustc_public_bridge 2025-07-18 18:49:12 +00:00
Makai
a1deaa7097 SmirError to Error 2025-07-18 18:49:12 +00:00
Makai
9a37aab558 rename ui/stable-mir-print 2025-07-18 18:49:12 +00:00
Makai
08e3cf5118 rename ui-fulldeps/stable-mir 2025-07-18 18:49:12 +00:00
Makai
ad0de062b5 use "helper" as a more descriptive name 2025-07-18 18:49:12 +00:00
Makai
7f22e88fab SmirContainer to Container 2025-07-18 18:49:12 +00:00
Makai
966fc57789 SmirCtxt to CompilerCtxt, SmirInterface to CompilerInterface
aaa
2025-07-18 18:49:12 +00:00
Jason Newcomb
cca924bf9f Simplify must_use_candidate spans. 2025-07-18 14:44:17 -04:00
Chris Denton
58a05caa45
Rename optional-mingw-check to optional-pr-check 2025-07-18 18:33:23 +00:00
Julien THILLARD
6b87978169
Change the memcmp and bcmp return type to c_int
Fix the return type of `memcmp` and `bcmp` builtin functions on targets
with a `c_int` other than `i32`.

Linked issue: https://github.com/rust-lang/rust/issues/144076
2025-07-18 18:19:13 +00:00
xizheyin
c58e0bd093
rename emit_unless to emit_unless_delay
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-19 01:49:19 +08:00
Jens Reidel
2d51acd2fb
tests: assembly: cstring-merging: Disable GlobalMerge pass
The test relies on LLVM not merging all the globals into one and would
currently otherwise fail on powerpc64le.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 19:45:36 +02:00
Jieyou Xu
69b71e4410
Mitigate #[align] name resolution ambiguity regression with a rename
From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc`
are always perma-unstable and feature-gated by `feature(rustc_attrs)`.

See regression RUST-143834.

For the underlying problem where even introducing new feature-gated
unstable built-in attributes can break user code such as

```rs
macro_rules! align {
    () => {
        /* .. */
    };
}

pub(crate) use align; // `use` here becomes ambiguous
```

refer to RUST-134963.

Since the `#[align]` attribute is still feature-gated by
`feature(fn_align)`, we can rename it as a mitigation. Note that
`#[rustc_align]` will obviously mean that current unstable user code
using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`,
but this is a short-term mitigation to buy time, and is expected to be
changed to a better name with less collision potential.

See
<https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-07-17/near/529290371>
where mitigation options were considered.
2025-07-19 01:42:30 +08:00
Trevor Gross
7dacaef5d3 mem: Use core::ffi::c_int
This alias was added in 9897bfb8a ("Fix memset arguments for MSP430
target"), which predates `core::ffi`. Now that it exists we can just use
`core::ffi::c_int`.
2025-07-18 17:35:57 +00:00
Micke
fb1a205a55
docs: update link to RISC-V and Xtensa installation guide 2025-07-18 19:31:37 +02:00
Michael Goulet
e6f283080c Remove pretty print hack for async blocks 2025-07-18 17:30:02 +00:00
Matthias Krüger
a59efc61f9
Rollup merge of #144123 - oli-obk:ctfe-unsize, r=RalfJung
Generalize `unsize` and `unsize_into` destinations

Just something that I noticed during other work. We do this for most such functions, so let's do it here, too.

r? ``@RalfJung``
2025-07-18 19:14:47 +02:00
Matthias Krüger
3a3a411980
Rollup merge of #144059 - LorrensP-2158466:remove-crate-loader, r=petrochenkov
Refactor `CrateLoader` into the `CStore`

Removes the `CrateLoader` and moves the code to `CStore`. Now, if you want to use the `CrateLoader`, you can just use `CStore`.

Should we rename `creader.rs` to `cstore.rs`?

r? ``@petrochenkov``
2025-07-18 19:14:46 +02:00
Matthias Krüger
1b437d78e3
Rollup merge of #144050 - JonathanBrouwer:cross-crate-reexport, r=jdonszelmann
Fix encoding of link_section and no_mangle cross crate

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

``@bjorn3`` suggested using the `codegen_fn_attrs` query but given that these attributes are not that common it's probably fine to just always encode them. I can also go for that solution if it is preferred but that would require more changes.

r? ``@jdonszelmann`` ``@fmease`` (whoever feels like it)
2025-07-18 19:14:46 +02:00
Matthias Krüger
79024700f1
Rollup merge of #143961 - 1c3t3a:correct-exploit-mitigations, r=rcvalle
Correct which exploit mitigations are enabled by default

This was brought up by ``@Noratrieb`` in [#project-exploit-mitigations > Incorrect table in the rustc book](https://rust-lang.zulipchat.com/#narrow/channel/343119-project-exploit-mitigations/topic/Incorrect.20table.20in.20the.20rustc.20book/with/523684203). Thanks! :)

[Rendered](132a47e723/src/doc/rustc/src/exploit-mitigations.md)

r? ``@rcvalle``
2025-07-18 19:14:45 +02:00
Matthias Krüger
232bef3f6f
Rollup merge of #143928 - ognevny:opt-dist-build-llvm, r=Kobzol
opt-dist: make llvm builds optional

adds command line option for disabling llvm builds. it's useful in case of user having their own optimized LLVM, so they won't waste time for (at least) 3 LLVM builds. in this case PGO optimized rustc will be already built in Stage 1, so rust-lang/rust#143898 should be addressed for this change

couldn't test locally on Linux laptop due to small SSD storage, will try now with windows-msvc host

r? ``@Kobzol``

try-job: dist-x86_64-linux
try-job: dist-x86_64-msvc
2025-07-18 19:14:44 +02:00
Matthias Krüger
401aaf4ac1
Rollup merge of #143382 - fee1-dead-contrib:push-trrymlzqmmoz, r=jhpratt
stabilize `const_slice_reverse`

cc rust-lang/rust#135120, needs FCP.
2025-07-18 19:14:44 +02:00
Matthias Krüger
f38891e697
Rollup merge of #142693 - fmease:unbound-bettering, r=compiler-errors
More robustly deal with relaxed bounds and improve their diagnostics

Scaffolding for https://github.com/rust-lang/rust/issues/135229 (CC https://github.com/rust-lang/rust/pull/135331)

Fixes https://github.com/rust-lang/rust/issues/136944 (6th commit).
Fixes https://github.com/rust-lang/rust/issues/142718 (8th commit).
2025-07-18 19:14:43 +02:00
Matthias Krüger
b3827e4f37
Rollup merge of #142673 - oli-obk:uninit-read-mem, r=RalfJung
Show the offset, length and memory of uninit read errors

r? ``@RalfJung``

I want to improve memory dumps in general. Not sure yet how to do so best within rust diagnostics, but in a perfect world I could generate a dummy in-memory file (that contains the rendered memory dump) that we then can then provide regular rustc `Span`s to. So we'd basically report normal diagnostics for them with squiggly lines and everything.
2025-07-18 19:14:43 +02:00
Matthias Krüger
61285e211b
Rollup merge of #138554 - xizheyin:issue-138401, r=chenyukang
Distinguish delim kind to decide whether to emit unexpected closing delimiter

Fixes #138401
2025-07-18 19:14:42 +02:00
Jieyou Xu
b2e94bf020
Add test demonstrating current beta #[align] name resolution regression
See RUST-143834.
2025-07-19 01:12:49 +08:00
Jens Reidel
d1a146bbbb tests: Skip supported-crate-types test on musl hosts
This test depends on the target-specific behavior of crt-static for musl
targets. However, running the testsuite on a musl host requires
setting `crt-static` to `false`, as it wouldn't otherwise be possible to
build rustc. This in turn will enable `-Ctarget-feature=-crt-static` for
all tests, mismatching the expected `+crt-static` for the musl target
tested in this testcase.

Since this test specifically tests the default value of `crt-static` for
the musl target, ignoring it entirely makes more sense than manually
setting `-Ctarget-feature=+crt-static` here, but both would be valid
approaches.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 19:05:32 +02:00
Jens Reidel
1b35d5f89c tests: Add a regression test for crt-static with target features
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 19:00:52 +02:00
Jens Reidel
664d742933 rustc_codegen_ssa: Don't skip target-features after crt-static
The current behaviour introduced by commit
a50a3b8e318594c41783294e440d864763e412ef would discard any
target features specified after crt-static (the only member of
RUSTC_SPECIFIC_FEATURES). This is because it returned instead of
continuing processing the next flag.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 18:59:13 +02:00