about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-19Initialize mingw for the runner's userChris Denton-5/+5
2025-07-19Auto merge of #143641 - Kobzol:tool-target, r=jieyouxubors-166/+408
Add `ToolTarget` to bootstrap Oh, you thought I'm done with refactoring bootstrap tools? Na-ah, think again! After the failure of https://github.com/rust-lang/rust/pull/143581, `ToolTarget` is back with a vengeance. This time, I implemented the test changes and tool cleanups without forcing these tools to be built with the stage0 compiler. There are still some small wins though, `LlvmBitcodeLinker` now starts at stage 1, and not stage 2. Cargo should also be ported to this new mode, but I'm leaving that for a follow-up PR. Hopefully X-th time's the charm :crossed_fingers: r? `@jieyouxu`
2025-07-19Auto merge of #144166 - matthiaskrgr:rollup-wccepuo, r=matthiaskrgrbors-168/+1785
Rollup of 10 pull requests Successful merges: - rust-lang/rust#141076 (fix Zip unsoundness (again)) - rust-lang/rust#142444 (adding run-make test to autodiff) - rust-lang/rust#143704 (Be a bit more careful around exotic cycles in in the inliner) - rust-lang/rust#144073 (Don't test panic=unwind in panic_main.rs on Fuchsia) - rust-lang/rust#144083 (miri sleep tests: increase slack) - rust-lang/rust#144092 (bootstrap: Detect musl hosts) - rust-lang/rust#144098 (Do not lint private-in-public for RPITIT) - rust-lang/rust#144103 (Rename `emit_unless` to `emit_unless_delay`) - rust-lang/rust#144108 (Ignore tests/run-make/link-eh-frame-terminator/rmake.rs when cross-compiling) - rust-lang/rust#144115 (fix outdated comment) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-19Fix compiler for dist LLVM bitcode linkerJakub Beránek-12/+29
2025-07-19Auto merge of #143784 - scottmcm:enums-again-new-ex2, r=dianqkbors-40/+669
Simplify discriminant codegen for niche-encoded variants which don't wrap across an integer boundary Inspired by rust-lang/rust#139729, this attempts to be a much-simpler and more-localized change while still making a difference. (Specifically, this does not try to solve the problem with select-sinking, leaving that to be fixed by https://github.com/llvm/llvm-project/issues/134024 -- once it gets released -- instead of in rustc's codegen.) What this *does* improve is checking for the variant in a 3+ variant enum when that variant is the type providing the niche. Something like `if let Foo::WithBool(_) = ...` previously compiled to `ugt(add(x, -2), 2)`, which is non-trivial to think about because it's depending on the unsigned wrapping to shift the 0/1 up above 2. With this PR it compiles to just `ult(x, 2)`, which is probably what you'd have written yourself if you were doing it by hand to look for "is this byte a bool?". That's done by leaving most of the codegen alone, but adding a couple new special cases to the `is_niche` check. The default looks at the relative discriminant, but in the common cases where there's no wraparound involved, we can just check the original value, rather than the offsetted one. The first commit just adds some tests, so the best way to see the effect of this change is to look at the second commit and how it updates the test expectations.
2025-07-19Rollup merge of #144115 - lcnr:auto-trait-comment, r=compiler-errorsMatthias Krüger-4/+2
fix outdated comment cc rust-lang/rust#84857 r? types
2025-07-19Rollup merge of #144108 - CaiWeiran:run-make_test, r=jieyouxuMatthias Krüger-0/+1
Ignore tests/run-make/link-eh-frame-terminator/rmake.rs when cross-compiling The test tests/run-make/link-eh-frame-terminator/rmake.rs fails to link when cross-compiling. Therefore, it should be ignored in cross-compilation environments. See [commit a27bdea](https://github.com/rust-lang/rust/commit/a27bdea4b7b5107ea912659813418445d9e46ba4) and [commit 2beccc4](https://github.com/rust-lang/rust/commit/2beccc4d8e5066a42e6623d91e7991870d36feb2) for reference.
2025-07-19Rollup merge of #144103 - xizheyin:emit-unless, r=compiler-errorsMatthias Krüger-15/+15
Rename `emit_unless` to `emit_unless_delay` `emit_unless` is very unintuitive and confusing. The first impression is as if it will only emit if the parameter is true, without the altnative "delay as a bug". `emit_unless_delay` expresses two things: 1. emit unless the `delay` parameter is true 2. either *emit immediately* or *delay as bug* r? `@compiler-errors`
2025-07-19Rollup merge of #144098 - cjgillot:lint-rpitit, r=compiler-errorsMatthias Krüger-54/+77
Do not lint private-in-public for RPITIT Fixes the hard error introduced by https://github.com/rust-lang/rust/pull/143357 Instead of trying to accept this hard error directly, this PR copies tests from https://github.com/rust-lang/rust/pull/144020 and removes the error. If the behaviour is actually desirable, the second commit can be reverted with a proper crater run. cc https://github.com/rust-lang/rust/issues/143531 for bookkeeping r? `@compiler-errors`
2025-07-19Rollup merge of #144092 - Gelbpunkt:musl-stage0, r=KobzolMatthias Krüger-1/+6
bootstrap: Detect musl hosts Currently, all non-Android Linux hosts are assumed to be using glibc. This obviously isn't very portable and will currently result in downloading a stage0 toolchain for glibc even on musl hosts. There are multiple ways to detect musl somewhat reliably, but the easiest option is to check for the python target, which is exposed in `sys.implementation._multiarch` and has values like "x86_64-linux-gnu" or "powerpc64le-linux-musl".
2025-07-19Rollup merge of #144083 - RalfJung:miri-sleep, r=oli-obkMatthias Krüger-3/+3
miri sleep tests: increase slack Filing this directly as a rustc PR since it impacts rustc CI (see https://github.com/rust-lang/rust/pull/144075#issuecomment-3085293055) r? `````@oli-obk`````
2025-07-19Rollup merge of #144073 - erickt:ignore-test-on-fuchsia, r=lqdMatthias Krüger-0/+3
Don't test panic=unwind in panic_main.rs on Fuchsia ````@Enselic```` added a few new test conditions to tests/ui/panics/panic-main.rs in rust-lang/rust#142304, but it is unfortunately causing the test to fail for Fuchsia with the `panic=unwind` modes since we compile Rust for Fuchsia with `panic=abort`. This patch just ignores the test for Fuchsia. Note that this test might also need to filter out a few other platforms, since another panicking test we exclude from Fuchsia https://github.com/rust-lang/rust/blob/master/tests/ui/panics/runtime-switch.rs also excludes running on msvc, android, openbsd, and wasm, but I'm not familiar with those platforms so I didn't want to add them here. cc ````@compile-errors,```` who reviewed the initial PR
2025-07-19Rollup merge of #143704 - compiler-errors:cycle-exotic, r=cjgillotMatthias Krüger-16/+242
Be a bit more careful around exotic cycles in in the inliner Copied from the comment here: https://github.com/rust-lang/rust/issues/143700#issuecomment-3053810353 --- ```rust #![feature(fn_traits)] #[inline] pub fn a() { FnOnce::call_once(a, ()); FnOnce::call_once(b, ()); } #[inline] pub fn b() { FnOnce::call_once(b, ()); FnOnce::call_once(a, ()); } ``` This should demonstrate the issue. For ease of discussion, I'm gonna call the two fn-def types `{a}` and `{b}`. When collecting the cyclic local callees in `mir_callgraph_cyclic` for `a`, we first check the first call terminator in `a`. We end up calling process on `<{a} as FnOnce>::call_once`, which ends up visiting `a`'s instance again. This is cyclical. However, we don't end up marking `FnOnce::call_once` as a cyclical def id because it's a foreign item. That's fine. When visiting the second call terminator in `a`, which is `<{b} as FnOnce>::call_once`, we end up recursing into `b`. We check the first terminator, which is `<{b} as FnOnce>::call_once`, but although that is its own mini cycle, it doesn't consider itself a cycle for the purpose of this query because it doesn't involve the *root*. However, when we visit the *second* terminator in `b`, which is `<{a} as FnOnce>::call_once`, we end up **erroneously** *not* considering that call to be cyclical since we've already inserted it into our set of seen instances, and as a consequence we don't recurse into it. This means that we never collect `b` as recursive. Do this in the flipped case too, and we end up having two functions which mututally do not consider each other to be recursive participants. This leads to a query cycle. --- I ended up also renaming some variables so I could more clearly understand their responsibilities in this code. Let me know if the renames are not welcome. Fixes https://github.com/rust-lang/rust/issues/143700 r? `@cjgillot`
2025-07-19Rollup merge of #142444 - KMJ-007:autodiff-codegen-test, r=ZuseZ4Matthias Krüger-0/+1315
adding run-make test to autodiff r? `@ZuseZ4`
2025-07-19Rollup merge of #141076 - the8472:fix-zip-panic-safety2, r=workingjubileeMatthias Krüger-75/+121
fix Zip unsoundness (again) Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. #82292 tried to fix unsoundness (#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (#86443), but the fix #86452 didn't fix it for nested Zip iterators (#137255). Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in #83791 but we haven't made use of that so far. fixes #137255
2025-07-19Auto merge of #144145 - matthiaskrgr:rollup-swc74s4, r=matthiaskrgrbors-1267/+1560
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-18Auto merge of #144140 - GuillaumeGomez:subtree-update_cg_gcc_2025-07-18, ↵bors-629/+82
r=GuillaumeGomez Subtree update cg gcc 2025 07 18 cc `@antoyo` r? ghost
2025-07-18Remove forgotten git annotationsGuillaume Gomez-7/+0
2025-07-19rename `emit_unless` to `emit_unless_delay`xizheyin-15/+15
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-18Rollup merge of #144123 - oli-obk:ctfe-unsize, r=RalfJungMatthias Krüger-4/+5
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-18Rollup merge of #144059 - LorrensP-2158466:remove-crate-loader, r=petrochenkovMatthias Krüger-158/+169
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-18Rollup merge of #144050 - JonathanBrouwer:cross-crate-reexport, r=jdonszelmannMatthias Krüger-4/+38
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-18Rollup merge of #143961 - 1c3t3a:correct-exploit-mitigations, r=rcvalleMatthias Krüger-11/+11
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](https://github.com/rust-lang/rust/blob/132a47e72316b60e99c3e5fefb9c3a06641138e4/src/doc/rustc/src/exploit-mitigations.md) r? ``@rcvalle``
2025-07-18Rollup merge of #143928 - ognevny:opt-dist-build-llvm, r=KobzolMatthias Krüger-56/+87
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-18Rollup merge of #143382 - fee1-dead-contrib:push-trrymlzqmmoz, r=jhprattMatthias Krüger-1/+2
stabilize `const_slice_reverse` cc rust-lang/rust#135120, needs FCP.
2025-07-18Rollup merge of #142693 - fmease:unbound-bettering, r=compiler-errorsMatthias Krüger-819/+772
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-18Rollup merge of #142673 - oli-obk:uninit-read-mem, r=RalfJungMatthias Krüger-144/+402
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-18Rollup merge of #138554 - xizheyin:issue-138401, r=chenyukangMatthias Krüger-70/+74
Distinguish delim kind to decide whether to emit unexpected closing delimiter Fixes #138401
2025-07-18Be a bit more careful around exotic cycles in in the inlinerMichael Goulet-16/+242
2025-07-18Merge commit 'f682d09eefc6700b9e5851ef193847959acf4fac' into ↵Guillaume Gomez-625/+85
subtree-update_cg_gcc_2025-07-18
2025-07-18Auto merge of #143845 - cjgillot:stability-query, r=jieyouxubors-926/+767
Split-up stability_index query This PR aims to move deprecation and stability processing away from the monolithic `stability_index` query, and directly implement `lookup_{deprecation,stability,body_stability,const_stability}` queries. The basic idea is to: - move per-attribute sanity checks into `check_attr.rs`; - move attribute compatibility checks into the `MissingStabilityAnnotations` visitor; - progressively dismantle the `Annotator` visitor and the `stability_index` query. The first commit contains functional change, and now warns when `#[automatically_derived]` is applied on a non-trait impl block. The other commits should not change visible behaviour. Perf in https://github.com/rust-lang/rust/pull/143845#issuecomment-3066308630 shows small but consistent improvement, except for unused-warnings case. That case being a stress test, I'm leaning towards accepting the regression. This PR changes `check_attr`, so has a high conflict rate on that file. This should not cause issues for review.
2025-07-18Merge pull request #735 from rust-lang/sync_from_rust_2025_07_04antoyo-622/+68
Sync from rust 2025/07/04
2025-07-18Comment some tests in the m68k CI because we cannot run programs on ↵Antoni Boucher-16/+22
architectures not supported by the object crate anymore
2025-07-18Auto merge of #144130 - matthiaskrgr:rollup-t75stad, r=matthiaskrgrbors-155/+427
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143280 (Remove duplicate error about raw underscore lifetime) - rust-lang/rust#143649 (Add test for `default_field_values` and `const_default`) - rust-lang/rust#143699 (Make `AsyncDrop` check that it's being implemented on a local ADT) - rust-lang/rust#143908 (`tests/ui`: A New Order [0/28] ) - rust-lang/rust#143909 (docs(alloc::fmt): Make type optional, instead of matching empty string) - rust-lang/rust#143925 (Make slice comparisons const) - rust-lang/rust#143997 (Use $crate in macros for rustc_public (aka stable_mir)) - rust-lang/rust#144013 (resolve: Make disambiguators for underscore bindings module-local) - rust-lang/rust#144029 (Fix wrong messages from methods with the same name from different traits) - rust-lang/rust#144063 (Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels) - rust-lang/rust#144069 (ci: use windows 22 for all free runners) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-18Generalize `unsize` and `unsize_into` destinationsOli Scherer-4/+5
2025-07-18Rollup merge of #144069 - marcoieni:windows-22-free, r=jieyouxuMatthias Krüger-2/+4
ci: use windows 22 for all free runners try-job: `x86_64-msvc-*`
2025-07-18Rollup merge of #144063 - jieyouxu:label-ci, r=KobzolMatthias Krüger-0/+8
Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels - Commit 1 is a drive-by adjustment. Auto-label `src/ci` and `.github/workflows` with https://github.com/rust-lang/rust/labels/A-CI, and include `.github/workflows` for https://github.com/rust-lang/rust/labels/T-infra trigger files. - Commit 2 adds myself to the `infra-ci` reviewer adhoc group. r? ``````@Kobzol``````
2025-07-18Rollup merge of #144029 - lichuang:fix_issue_143740, r=compiler-errorsMatthias Krüger-28/+70
Fix wrong messages from methods with the same name from different traits fix issue https://github.com/rust-lang/rust/issues/143740
2025-07-18Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obkMatthias Krüger-45/+58
resolve: Make disambiguators for underscore bindings module-local Disambiguators attached to underscore name bindings (like `const _: u8 = something;`) do not need to be globally unique, they just need to be unique inside the module in which they live, because the bindings in a module are basically kept as `Map<BindingKey, SomeData>`. Also, the specific values of the disambiguators are not important, so a glob import of `const _` may have a different disambiguator than the original `const _` itself. So in this PR the disambiguator is just set to the current number of bindings in the module. This removes one more piece of global mutable state from resolver and unblocks https://github.com/rust-lang/rust/pull/143884.
2025-07-18Rollup merge of #143997 - Coder-256:stable-mir-macro-hygiene, r=oli-obkMatthias Krüger-9/+9
Use $crate in macros for rustc_public (aka stable_mir) This makes `#[macro_use] extern crate rustc_public` unnecessary (which brings all of `rustc_public`'s macros into scope for the entire crate); instead, now you can simply use `rustc_public::run!()`.
2025-07-18Rollup merge of #143925 - oli-obk:slice-const-partialeq, r=fee1-deadMatthias Krüger-49/+134
Make slice comparisons const This needed a fix for `derive_const`, too, as it wasn't usable in libcore anymore as trait impls need const stability attributes. I think we can't use the same system as normal trait impls while `const_trait_impl` is still unstable. r? ```@fee1-dead``` cc rust-lang/rust#143800
2025-07-18Rollup merge of #143909 - nik-rev:patch-1, r=jhprattMatthias Krüger-2/+2
docs(alloc::fmt): Make type optional, instead of matching empty string Think this is clearer. Noticed as I was implementing [`tree-sitter-rust-format-args`](https://github.com/nik-rev/tree-sitter-rust-format-args), and attempting to match the empty string results in an error.
2025-07-18Rollup merge of #143908 - Kivooeo:tf0, r=jieyouxuMatthias Krüger-16/+22
`tests/ui`: A New Order [0/28] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. These are the some last tests that didn’t make it into the main twenty-eightology of PRs. Part of rust-lang/rust#133895. r? ```@jieyouxu```
2025-07-18Rollup merge of #143699 - compiler-errors:async-drop-fund, r=oli-obkMatthias Krüger-3/+53
Make `AsyncDrop` check that it's being implemented on a local ADT Fixes https://github.com/rust-lang/rust/issues/143691
2025-07-18Rollup merge of #143649 - estebank:const-trait-default-field-value, r=oli-obkMatthias Krüger-0/+37
Add test for `default_field_values` and `const_default` Add a test showing `#![feature(default_field_values)]` using `#[const_trait] trait Default` (`#![feature(const_default)]` + `#![feature(const_trait_impl)]`). CC https://github.com/rust-lang/rust/issues/132162
2025-07-18Rollup merge of #143280 - xizheyin:143152-1, r=compiler-errorsMatthias Krüger-1/+30
Remove duplicate error about raw underscore lifetime Fixes rust-lang/rust#143152 r? ```@fee1-dead```
2025-07-18Deduplicate `unmatched_delims` in `rustc_parse` to reduce confusionxizheyin-84/+62
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-18Ignore tests/run-make/link-eh-frame-terminator/rmake.rs when cross-compilingCaiweiran-0/+1
2025-07-18inline CrateLoader inside of CStoreLorrensP-2158466-158/+169
2025-07-18HIR ty lowering: Validate `PointeeSized` boundsLeón Orell Valerian Liehr-78/+135