Commit graph

307782 commits

Author SHA1 Message Date
Diggory Blake
c6a952159f
Restrict sysroot crate imports to those defined in this repo.
It's common to import dependencies from the sysroot via `extern crate`
rather than use an explicit cargo dependency, when it's necessary to use
the same dependency version as used by rustc itself. However, this is
dangerous for crates.io crates, since rustc may not pull in the
dependency on some targets, or may pull in multiple versions. In both
cases, the `extern crate` fails to resolve.

To address this, re-export all such dependencies from the appropriate
`rustc_*` crates, and use this alias from crates which would otherwise
need to use `extern crate`.
2025-10-15 13:17:25 +01:00
bors
e100792918 Auto merge of #147662 - Zalathar:rollup-j8ci0f2, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#146277 (Enable `u64` limbs in `core::num::bignum`)
 - rust-lang/rust#146976 (constify basic Clone impls)
 - rust-lang/rust#147249 (Do two passes of `handle_opaque_type_uses_next`)
 - rust-lang/rust#147266 (fix 2 search graph bugs)
 - rust-lang/rust#147497 (`proc_macro` cleanups (3/N))
 - rust-lang/rust#147546 (Suppress unused_parens for labeled break)
 - rust-lang/rust#147548 (Fix ICE for never pattern as closure parameters)
 - rust-lang/rust#147594 (std: implement `pal::os::exit` for VEXos)
 - rust-lang/rust#147596 (Adjust the Arm targets in CI to reflect latest changes)
 - rust-lang/rust#147607 (GVN: Invalidate derefs at loop headers)
 - rust-lang/rust#147620 (Avoid redundant UB check in RangeFrom slice indexing)
 - rust-lang/rust#147647 (Hide vendoring and copyright in GHA group)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-14 12:32:31 +00:00
bors
2f7620a5cc Auto merge of #146414 - GuillaumeGomez:run-test-with-gcc-backend, r=Kobzol
Add a CI job that runs a subset of UI tests with the GCC backend

Part of https://github.com/rust-lang/compiler-team/issues/891.

r? `@Kobzol`
2025-10-14 09:21:23 +00:00
Stuart Cook
0f6fe9112a
Rollup merge of #147647 - Noratrieb:bootstrap-groups, r=Zalathar
Hide vendoring and copyright in GHA group

These two steps are currently the most verbose steps in a dist-linux build, which makes it harder to find more interesting parts. Hide them in a group like most things.

For example, see https://github.com/rust-lang/rust/actions/runs/18462295959/job/52596384752
2025-10-14 16:31:03 +11:00
Stuart Cook
4a67c015bd
Rollup merge of #147620 - saethlin:RangeFrom-noubcheck, r=scottmcm
Avoid redundant UB check in RangeFrom slice indexing

I noticed this while picking through the IR we generate for https://github.com/rust-lang/rust/pull/134938. I think we just forgot to apply this trick to `RangeFrom`?
2025-10-14 16:31:02 +11:00
Stuart Cook
4fc3a05e54
Rollup merge of #147607 - dianqk:gvn-deref-loop, r=cjgillot
GVN: Invalidate derefs at loop headers

Fix a miscompiled case I found when re-reviewing rust-lang/rust#132527.

r? cjgillot
r? oli-obk
2025-10-14 16:31:02 +11:00
Stuart Cook
2ad61521d7
Rollup merge of #147596 - thejpster:build-new-arm-tier2-targets, r=Mark-Simulacrum
Adjust the Arm targets in CI to reflect latest changes

* Adds build of `armv7a-none-eabihf` (https://github.com/rust-lang/rust/pull/146522)
* Adds build of `armv8r-none-eabihf` (https://github.com/rust-lang/rust/pull/146520)
* Drops build of `armeb*-none-*` (https://github.com/rust-lang/rust/pull/146523)

I wasn't sure why `armv7a-none-eabihf` was missing from the build-manifest program, but `armv8r-none-eabihf` was there, as they were both Tier 3 targets up until very recently. So, I added it, but that might be wrong.
2025-10-14 16:31:01 +11:00
Stuart Cook
a594163d6d
Rollup merge of #147594 - vexide:vexos-exit-impl, r=joboet
std: implement `pal::os::exit` for VEXos

This PR provides a more "proper" implementation of process exiting in VEXos programs by going through `vexSystemExitRequest` rather than calling `intrinsics::abort`, which exits using an undefined instruction trap. This matches the existing implementation of `rt::abort_internal` and therefore makes `std::process::exit` have the same behavior as returning from main on VEXos targets.
2025-10-14 16:31:00 +11:00
Stuart Cook
0a7f159111
Rollup merge of #147548 - chenyukang:yukang-fix-ice-141592, r=jackh726
Fix ICE for never pattern as closure parameters

Fixes rust-lang/rust#141592

`diverge` is set here for never pattern in parameter:
https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_typeck/src/check.rs#L87-L90

the assertion is too strict, I set it delay as bug for later error.
2025-10-14 16:31:00 +11:00
Stuart Cook
a49246a614
Rollup merge of #147546 - chenyukang:yukang-fix-break-label-147542, r=jackh726
Suppress unused_parens for labeled break

Fixes rust-lang/rust#147542
2025-10-14 16:30:59 +11:00
Stuart Cook
428be2fbc9
Rollup merge of #147497 - cyrgani:proc-macro-cleanups-3, r=petrochenkov
`proc_macro` cleanups (3/N)

Followup to rust-lang/rust#147386, which removed the old `Decode` trait.
Can be reviewed commit by commit.
2025-10-14 16:30:58 +11:00
Stuart Cook
4321adfbe0
Rollup merge of #147266 - lcnr:fix-search_graph, r=BoxyUwU
fix 2 search graph bugs

wooooooooops, i should really run the fuzzer even when not changing the structure of the search graph as a whole :3 fixes the `ml-kem` ICE in the next-solver crater run

r? ````@BoxyUwU````
2025-10-14 16:30:58 +11:00
Stuart Cook
3a80521ad2
Rollup merge of #147249 - jackh726:opaque-type-fallback, r=lcnr
Do two passes of `handle_opaque_type_uses_next`

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/240

Also did a little bit of cleanup, can squash the commits if decided.

r? lcnr
2025-10-14 16:30:57 +11:00
Stuart Cook
ed290fdd5c
Rollup merge of #146976 - npmccallum:clone, r=scottmcm
constify basic Clone impls
2025-10-14 16:30:56 +11:00
Stuart Cook
6e07b25bf0
Rollup merge of #146277 - Kivooeo:u64-unlock, r=scottmcm
Enable `u64` limbs in `core::num::bignum`

Since `u128` is stable now, I guess, we can safely add this, not sure if this requires tests or anything

cc https://github.com/rust-lang/rust/issues/137887
2025-10-14 16:30:56 +11:00
bors
fb24b04b09 Auto merge of #147353 - the8472:nondrop-array-iter, r=scottmcm
only call polymorphic array iter drop machinery when the type requires it

I saw a bunch of dead, empty  `<[core::mem::maybe_uninit::MaybeUninit<T>; N] as core::array::iter::iter_inner::PartialDrop>::partial_drop` functions when compiling with more than 1 CGU.

Let's see if we can help optimizations to eliminate stuff earlier.

r? ghost
2025-10-14 05:29:24 +00:00
yukang
d658bcfdfe Suppress unused_parens for labeled break 2025-10-14 12:32:51 +08:00
dianqk
2048b9c027
GVN: Invalidate derefs at loop headers 2025-10-14 08:09:32 +08:00
Jack Huey
d51f09e5ba Review comments. Move resolve_vars_if_possible into fn and add test minimizations. Update comment and test. 2025-10-13 20:25:01 +00:00
Noratrieb
11977b2e65 Hide vendoring and copyright in GHA group
These two steps are currently the most verbose steps in a dist-linux
build, which makes it harder to find more interesting parts. Hide them
in a group like most things.
2025-10-13 22:00:45 +02:00
Guillaume Gomez
9d15d6615b Fix tests/ui/sanitizer/address.rs line 2025-10-13 21:23:38 +02:00
bors
4b94758d2b Auto merge of #147640 - matthiaskrgr:rollup-fio3d88, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#144266 (Supress swapping lhs and rhs in equality suggestion in extern macro )
 - rust-lang/rust#147471 (Assert that non-extended temporaries and `super let` bindings have scopes)
 - rust-lang/rust#147533 (Renumber return local after state transform)
 - rust-lang/rust#147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types)
 - rust-lang/rust#147613 (Make logging filters work again by moving EnvFilter into its own layer)
 - rust-lang/rust#147615 (reduce calls to attr.span() in old doc attr parsing)
 - rust-lang/rust#147636 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-13 19:22:06 +00:00
bors
ed1d94311e Auto merge of #147541 - saethlin:transmute-carefully, r=scottmcm
Change int-to-ptr transmute lowering back to inttoptr

This is a revert of https://github.com/rust-lang/rust/pull/121282, but with a regression test to cover the reported miscompile in https://github.com/rust-lang/rust/issues/147265 that was caused by the way the code here combines with https://github.com/rust-lang/rust/pull/138759.
2025-10-13 15:24:11 +00:00
Matthias Krüger
8d2b142a73
Rollup merge of #147636 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 47d656832c.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-13 16:54:15 +02:00
Matthias Krüger
81dd4082ab
Rollup merge of #147615 - jdonszelmann:span-calls-doc-attr, r=JonathanBrouwer,GuillaumeGomez
reduce calls to attr.span() in old doc attr parsing

r? `@oli-obk`

should be trivial, can also delegate to `@GuillaumeGomez` or `@JonathanBrouwer.`

As part of making span() return an option I want to reduce the number of places we call span in without it being known what specific attr it's for. This makes that more obvious for doc. Part of a chain of PRs that's coming.

https://github.com/rust-lang/rust/issues/131229#issuecomment-3395316064
2025-10-13 16:54:15 +02:00
Matthias Krüger
806da59bd1
Rollup merge of #147613 - dingxiangfei2009:investigate-log, r=jdonszelmann
Make logging filters work again by moving EnvFilter into its own layer

`tracing` at the time of writing has a feature (?) in its Filter implementation, so that filters like EnvFilter are consulted for status of a span or event and whether it is marked as interesting for logging. Combining a Filter with another layer through the `with_filter` combinator produces a filtered layer that enables an event unless it is statically determined that the event is uninteresting. However, if the filter is dynamic, because of filtering on span names or field values as an example, events are **always** enabled by design. There is an `event_enabled` predicate on `EnvFilter` implementation but it falls back to default and, thus, the dynamic filters are **unused**.

Previously, `RUSTC_LOG=[]` or `RUSTC_LOG=[garbage]` enables all events, even when spans do not match.

This patch re-enables span- and field-based filters. With `RUSTC_LOG=[garbage]` one should expect no events are enabled again. This will help with development greatly because we can meaningfully filter internal logs again.
2025-10-13 16:54:14 +02:00
Matthias Krüger
7d0a0a3660
Rollup merge of #147566 - BoxyUwU:opaque_types_placeholder_outlives, r=lcnr
rewrite outlives placeholder constraints to outlives static when handling opaque types

Fixes rust-lang/rust#147529

r? lcnr

see test comment
2025-10-13 16:54:13 +02:00
Matthias Krüger
6dd08cbd45
Rollup merge of #147533 - cjgillot:coro-late-renumber, r=davidtwco
Renumber return local after state transform

The current implementation of `StateTransform` renames `_0` before analyzing liveness. This is inconsistent, as a `return` terminator hardcodes a read of `_0`.

This PR proposes to perform such rename *after* analyzing the body, in fact after the whole transform. The implementation is not much more complicated.
2025-10-13 16:54:13 +02:00
Matthias Krüger
2a10082bcc
Rollup merge of #147471 - dianne:assert-temporary-scope, r=nnethercote
Assert that non-extended temporaries and `super let` bindings have scopes

This PR clarifies a point of confusion in the compiler: all bodies have an outer temporary drop scope, including `static` and `const` item bodies[^1]. Whenever a temporary should be dropped in its enclosing temporary scope, it should have a temporary scope to be dropped in so that its drop can be scheduled[^2]. As such, I've updated some relevant comments and made `ScopeTree::default_temporary_scope` and `RvalueScopes::temporary_scope` panic when an enclosing temporary scope isn't found instead of allowing potential bugs where potentially-drop-sensitive temporaries are effectively given static lifetimes.

Since non-extended `super let` bindings are dropped in their block's enclosing temporary scope, this applies to them as well: the enclosing temporary scope should exist.

[^1]: See https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/check/region.rs#L773-L778 for non-`fn`/closure bodies. The `this.cx.var_parent = None;` enables [lifetime extension to `'static` lifetimes](https://doc.rust-lang.org/stable/reference/destructors.html#r-destructors.scope.lifetime-extension.static) and the `ScopeData::Destruction` scope ensures non-extended temporaries are dropped in the body expression's scope.

[^2]: For certain borrowed temporaries, drops that don't require running destructors may later be removed by constant promotion. That is unrelated to this PR.
2025-10-13 16:54:12 +02:00
Matthias Krüger
852198534f
Rollup merge of #144266 - xizheyin:139050, r=nnethercote
Supress swapping lhs and rhs in equality suggestion in extern macro

Fixes rust-lang/rust#139050
2025-10-13 16:54:11 +02:00
Boxy Uwu
30bedc74d4 in opaque type handling lift region vars to static if they outlive placeholders 2025-10-13 15:26:22 +01:00
Guillaume Gomez
a8051a6ca3 Ignore more failing ui tests for GCC backend 2025-10-13 15:30:26 +02:00
Guillaume Gomez
66b7ed5d7a Re-enable libgccjit download in CI 2025-10-13 15:20:49 +02:00
Guillaume Gomez
f80a3b0b3d Ignore failing gcc backend testsuite directly in Dockerfile 2025-10-13 15:20:49 +02:00
Guillaume Gomez
478bf434a0 Skip GCC backend-specific test if current backend is already gcc 2025-10-13 15:20:49 +02:00
Guillaume Gomez
2ad443c849 Ignore failing debuginfo tests with gcc backend 2025-10-13 15:20:49 +02:00
Guillaume Gomez
5ff7ca2e22 Ignore failing incremental tests for GCC backend 2025-10-13 15:20:49 +02:00
Guillaume Gomez
35e104a173 Ignore some mir-opt tests because GCC backend does not support unwinding from inline asm 2025-10-13 15:20:49 +02:00
Guillaume Gomez
f072df1836 Ignore coverage tests for GCC 2025-10-13 15:20:49 +02:00
Guillaume Gomez
1c075acfb5 Ignoring working crahes test in GCC backend 2025-10-13 15:20:49 +02:00
Guillaume Gomez
97eaf45e31 Ignore more failing ui tests in GCC backend 2025-10-13 15:20:49 +02:00
Guillaume Gomez
5b9ca10c75 Disable debug assertions 2025-10-13 15:20:49 +02:00
Guillaume Gomez
287e458dae Run rust tests with GCC backend 2025-10-13 15:20:48 +02:00
bors
9b8264604e Auto merge of #147629 - GuillaumeGomez:rollup-i1zinjv, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147514 (repr_transparent_external_private_fields: normalize types during traversal)
 - rust-lang/rust#147605 (Add doc links between `{integer}::from_str_radix` and `from_str`)
 - rust-lang/rust#147608 (cg_llvm: Use `LLVMDIBuilderCreateGlobalVariableExpression`)
 - rust-lang/rust#147623 (Clear `ChunkedBitSet` without reallocating)
 - rust-lang/rust#147625 (Add a warning when running tests with the GCC backend and debug assertions are enabled)
 - rust-lang/rust#147626 (Generalize configuring LLD as the default linker in bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-13 12:13:05 +00:00
Guillaume Gomez
0e6ec72dbe
Rollup merge of #147626 - Kobzol:lld-generalize2, r=jieyouxu
Generalize configuring LLD as the default linker in bootstrap

Reopen of https://github.com/rust-lang/rust/pull/147157, because apparently bors can't deal with it for some reason.

r? ``@ghost``
2025-10-13 11:25:25 +02:00
Guillaume Gomez
8ced599ba2
Rollup merge of #147625 - Kobzol:gcc-debug-assertions, r=GuillaumeGomez
Add a warning when running tests with the GCC backend and debug assertions are enabled

Discussed at https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Run.20more.20tests.20for.20rustc_codegen_gcc.20in.20t.E2.80.A6.20compiler-team.23891/with/543701828.

r? ``@GuillaumeGomez``
2025-10-13 11:25:24 +02:00
Guillaume Gomez
d808d28452
Rollup merge of #147623 - Zalathar:clear-mixed, r=nnethercote
Clear `ChunkedBitSet` without reallocating

There doesn't appear to be any reason to clear a ChunkedBitSet via its constructor (which allocates a new list of chunks), when we could just fill the existing allocation with `Chunk::Zeros` instead.

For comparison, the `insert_all` impl added by the same PR (rust-lang/rust#93984) does the simple thing here and just overwrites every chunk with `Chunk::Ones`.

(That fill was then made somewhat easier by rust-lang/rust#145480, which removes the chunk size from all-zero/all-one chunks.)

r? nnethercote (or compiler)
2025-10-13 11:25:23 +02:00
Guillaume Gomez
3938f42bb1
Rollup merge of #147608 - Zalathar:debuginfo, r=nnethercote
cg_llvm: Use `LLVMDIBuilderCreateGlobalVariableExpression`

- Part of rust-lang/rust#134001
- Follow-up to rust-lang/rust#146763

---

This PR dismantles the somewhat complicated `LLVMRustDIBuilderCreateStaticVariable` function, and replaces it with equivalent calls to `LLVMDIBuilderCreateGlobalVariableExpression` and `LLVMGlobalSetMetadata`.

A key difference is that the new code does not replicate the attempted downcast of `InitVal`. As far as I can tell, those downcasts were actually dead, because `llvm::ConstantInt` and `llvm::ConstantFP` are not subclasses of `llvm::GlobalVariable`. I tried replacing those code paths with fatal errors, and was unable to induce failure in any of the relevant test suites I ran.

I have also confirmed that if the calls to `create_static_variable` are commented out, debuginfo tests will fail, demonstrating some amount of relevant test coverage.

The new `DIBuilder` methods have been added via an extension trait, not as inherent methods, to avoid impeding rust-lang/rust#142897.
2025-10-13 11:25:23 +02:00
Guillaume Gomez
b7ea44a49d
Rollup merge of #147605 - Zalathar:from-str-radix, r=Mark-Simulacrum
Add doc links between `{integer}::from_str_radix` and `from_str`

When parsing base-10 numbers, it's easy to miss `<Self as FromStr>::from_str` and `str::parse` as potential alternatives to `from_str_radix`.

- A similar suggestion is given by https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
2025-10-13 11:25:22 +02:00
Guillaume Gomez
4a7e152511
Rollup merge of #147514 - RalfJung:transparent-nonexhaustive-normalize, r=lcnr
repr_transparent_external_private_fields: normalize types during traversal

Determining whether a type is a 1-ZST will internally do full normalization, so we better do the same when scanning for non-exhaustive types.

r? ``@lcnr``
2025-10-13 11:25:21 +02:00