about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-09-09Driveby fixesBoxy-10/+9
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-124/+150
2025-09-09Auto merge of #146018 - lambdageek:add-winres-version, r=wesleywiserbors-3/+257
compiler: Add Windows resources to rustc-main and rustc_driver Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll Invokes `rc.exe` directly, rather than using one of the crates from the ecosystem to avoid adding dependencies. A new internal `rustc_windows_rc` crate has the common build script machinery for locating `rc.exe` and constructing the resource script
2025-09-09Auto merge of #146188 - dpaoliello:tracing, r=Kobzolbors-3/+2
Update tracing and fix binary regression Previous attempts (rust-lang/rust#127316, rust-lang/rust#134770) saw binary size regressions, this was root caused to <https://github.com/tokio-rs/tracing/pull/2553> which changed the behavior of the `max_level_info` feature flag to match the docs (i.e., that flag only applies for debug builds and `release_max_level_info` applies for release builds). This change bumps the `tracing` version and sets both `max_level_info` and `release_max_level_info` when to match rustc's own `max_level_info`.
2025-09-08Auto merge of #140375 - lcnr:subrelations-infcx, r=BoxyUwUbors-300/+401
eagerly compute `sub_unification_table` again Previously called `sub_relations`. We still only using them for diagnostics right now. This mostly reverts rust-lang/rust#119989. Necessary for type inference guidance due to not-yet defined opaque types, cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/182. We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these `sub_unification_table` in any way. We now properly track the `sub_unification_table` when canonicalizing so using them in the new solver is totally sound and the performance impact is far more manageable than I thought back in rust-lang/rust#119989. r? `@compiler-errors`
2025-09-08Auto merge of #146333 - matthiaskrgr:rollup-ib80jyw, r=matthiaskrgrbors-166/+216
Rollup of 7 pull requests Successful merges: - rust-lang/rust#146111 (Migrate more things in the new solver to specific `DefId`s) - rust-lang/rust#146298 (GVN: Ensure indirect is first projection in try_as_place.) - rust-lang/rust#146299 (docs(std): add error docs for path canonicalize) - rust-lang/rust#146310 (Allow static regions in `type_name`.) - rust-lang/rust#146313 (Some `rustc_middle` cleanups) - rust-lang/rust#146319 (Fix typo in default.rs) - rust-lang/rust#146320 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-08Update tracing, againDaniel Paoliello-3/+2
2025-09-08Rollup merge of #146313 - nnethercote:rustc_middle-ty-cleanups-2, r=lcnrMatthias Krüger-84/+54
Some `rustc_middle` cleanups Minor improvements I found while looking through this code. r? `@BoxyUwU`
2025-09-08Rollup merge of #146310 - nnethercote:fix-146249, r=lcnrMatthias Krüger-2/+3
Allow static regions in `type_name`. Fixes rust-lang/rust#146249. r? `@lcnr`
2025-09-08Rollup merge of #146298 - cjgillot:gvn-derefer, r=nnethercoteMatthias Krüger-0/+5
GVN: Ensure indirect is first projection in try_as_place. I haven't found any report for this bug on existing code, but managed to trigger it with rust-lang/rust#143333
2025-09-08Rollup merge of #146111 - ChayimFriedman2:more-ns-specific-defid, r=lcnrMatthias Krüger-80/+154
Migrate more things in the new solver to specific `DefId`s Continuation of https://github.com/rust-lang/rust/pull/145377. I migrated the rest of the types, except aliases. Aliases are problematic because opaques and associated types share the same type in the new solver. `@jackh726,` `@lcnr,` `@ShoyuVanilla` I'd like to hear ideas here. Anyway, even if we do nothing with them we already got a substantial improvement. r? types
2025-09-08Auto merge of #146165 - folkertdev:c-variadic-errors-take-2, r=lcnrbors-25/+21
improve c-variadic error reporting tracking issue: https://github.com/rust-lang/rust/issues/44930 The parts of https://github.com/rust-lang/rust/pull/143546 that don't require any particular knowledge about c-variadic functions. This prepares the way for rejecting c-variadic functions that are also coroutines, safe functions, or associated functions.
2025-09-08reviewlcnr-40/+57
2025-09-08optimize `CanonicalVarValues::instantiate`lcnr-56/+62
2025-09-08pass `sub_relations` into canonical querieslcnr-97/+159
2025-09-08inline `CanonicalTyVarKind`lcnr-74/+49
2025-09-08eagerly compute `sub_relations` againlcnr-111/+152
2025-09-08Allow static regions in `type_name`.Nicholas Nethercote-2/+3
Fixes #146249.
2025-09-08Auto merge of #145910 - saethlin:ignore-intrinsic-calls, r=cjgillotbors-1/+10
Ignore intrinsic calls in cross-crate-inlining cost model I noticed in a side project that a function which just compares to `[u64; 2]` for equality is not cross-crate-inlinable. That was surprising to me because I didn't think that code contained a function call, but of course our array comparisons are lowered to an intrinsic. Intrinsic calls don't make a function no longer a leaf, so it makes sense to add this as an exception to the "only leaves" cross-crate-inline heuristic. This is the useful compare link: https://perf.rust-lang.org/compare.html?start=7cb1a81145a739c4fd858abe3c624ce8e6e5f9cd&end=c3f0a64dbf9fba4722dacf8e39d2fe00069c995e&stat=instructions%3Au because it disables CGU merging in both commits, so effects that cause changes in the sysroot to perturb partitioning downstream are excluded. Perturbations to what is and isn't cross-crate-inlinable in the sysroot has chaotic effects on what items are in which CGUs after merging. It looks like before this PR by sheer luck some of the CGUs dirtied by the patch in eza incr-unchanged happened to be merged together, and with this PR they are not. The perf runs on this PR point to a nice runtime performance improvement.
2025-09-07Auto merge of #145541 - cjgillot:dest-prop-live-range, r=Amanieubors-586/+370
Reimplement DestinationPropagation according to live ranges. This PR reimplements DestinationPropagation as a problem of merging live-ranges of locals. We merge locals that have disjoint live-ranges. This allows merging several locals in the same round by updating live range information. Live ranges are mainly computed using the `MaybeLiveLocals` analysis. The subtlety is that we split each statement and terminator in 2 positions. The first position is the regular statement. The second position is a shadow, which is always more live. It encodes partial writes and dead writes as a local being live for half a statement. This half statement ensures that writes conflict with another local's writes and regular liveness. r? `@Amanieu`
2025-09-08Move `describe_as_module` from `rustc_middle::print` to `rustc:middle::query`.Nicholas Nethercote-12/+11
That way it doesn't need to be exported.
2025-09-08Move `rustc_middle::MaxUniverse` to `rustc_infer`.Nicholas Nethercote-42/+41
Because `rust_infer` is the only crate that uses it.
2025-09-08Make some matches non-exhaustive.Nicholas Nethercote-30/+2
Exhaustive match isn't necessary for these trivial cases, and some similar nearby methods are non-exhaustive.
2025-09-07Rollup merge of #146297 - cjgillot:may-observe-address, r=saethlinMatthias Krüger-8/+23
Introduce PlaceContext::may_observe_address. A small utility method to avoid open-coding the logic in several MIR opts.
2025-09-07Rollup merge of #146209 - bjorn3:lto_refactors5, r=dianqkMatthias Krüger-77/+44
Misc LTO cleanups Follow up to https://github.com/rust-lang/rust/pull/145955. * Remove want_summary argument from `prepare_thin`. Since https://github.com/rust-lang/rust/pull/133250 ThinLTO summary writing is instead done by `llvm_optimize`. * Two minor cleanups
2025-09-07Use rustc_data_structures::union_find.Camille Gillot-28/+14
2025-09-07Simplify candidate collection.Camille Gillot-55/+43
2025-09-07Unify a source with all possible destinations.Camille Gillot-59/+39
2025-09-07Do not use prepend to avoid quadratic behaviour.Camille Gillot-58/+37
2025-09-07Simplify VisitPlacesWith.Camille Gillot-18/+7
2025-09-07Use regular MaybeLiveLocals.Camille Gillot-135/+53
2025-09-07Reimplement DestinationPropagation according to live ranges.Camille GILLOT-554/+435
2025-09-07Introduce fast insertion at extremities to IntervalSet.Camille GILLOT-27/+90
2025-09-07Auto merge of #146289 - cjgillot:gvn-aggregate, r=dianqkbors-28/+17
GVN: Allow reusing aggregates if LHS is not a simple local. This resolves a FIXME in the code. I don't see a reason not to allow this.
2025-09-07Ensure indirect is first projection in try_as_place.Camille GILLOT-0/+5
2025-09-07Introduce PlaceContext::may_observe_address.Camille GILLOT-8/+23
2025-09-07Auto merge of #146292 - matthiaskrgr:rollup-bkjs887, r=matthiaskrgrbors-153/+38
Rollup of 2 pull requests Successful merges: - rust-lang/rust#146254 (Use `Itertools::all_equal_value()` where applicable) - rust-lang/rust#146290 (Revert "Add LSX accelerated implementation for source file analysis") r? `@ghost` `@rustbot` modify labels: rollup
2025-09-07Rollup merge of #146290 - heiher:r-src-analysis-lsx, r=lqdMatthias Krüger-107/+3
Revert "Add LSX accelerated implementation for source file analysis" This reverts commit 5b43244ac59119870c9e0f6b642340ab88355b23 to fix native build failures on LoongArch. Link: https://github.com/rust-lang/rust/pull/145963#issuecomment-3263195096 Link: https://github.com/rust-lang/rust/pull/145963#issuecomment-3263420700
2025-09-07Rollup merge of #146254 - yotamofek:pr/itertools-all-equal-value, r=cjgillotMatthias Krüger-46/+35
Use `Itertools::all_equal_value()` where applicable Just a small cleanup. We already have `itertools` as a dep in these crates, so might as well use another of its features. Makes the code simpler IMHO :)
2025-09-07Auto merge of #146271 - niacdoial:improperctypes-refactor1, r=tgross35bors-886/+1036
lint ImproperCTypes: refactor linting architecture (part 1) This is the first PR in an effort to split rust-lang/rust#134697 into individually-mergeable parts. This one focuses on properly packaging the lint and its tests, as well as properly separate the "linting" and "type-checking" code. There is exactly one user-visible change: the safety of `Option<Box<FFISafePointee>>` is now the same in `extern` blocks and function definitions: it is safe. r? `@tgross35` because you are already looking at the original
2025-09-07Revert "Add LSX accelerated implementation for source file analysis"WANG Rui-107/+3
This reverts commit 5b43244ac59119870c9e0f6b642340ab88355b23 to fix native build failures on LoongArch.
2025-09-07Allow simplifying aggregates if LHS is not a simple local.Camille GILLOT-28/+17
2025-09-07Auto merge of #146285 - matthiaskrgr:rollup-oaokoo3, r=matthiaskrgrbors-22/+16
Rollup of 4 pull requests Successful merges: - rust-lang/rust#146200 (Simplify rustdoc-gui tester by calling directly browser-ui-test) - rust-lang/rust#146236 (gpu offload: change suspicious map into filter) - rust-lang/rust#146240 (DynamicConfig: use canonical clone impl) - rust-lang/rust#146251 (rustc_middle: clippy fixes) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-06Rollup merge of #146251 - hkBst:clippy-fix-8, r=cjgillotMatthias Krüger-20/+14
rustc_middle: clippy fixes Fixes for: ```text warning: bound is defined in more than one place warning: empty line after doc comment ```
2025-09-06Rollup merge of #146240 - hkBst:query-1, r=cjgillotMatthias Krüger-1/+1
DynamicConfig: use canonical clone impl Fixes clippy warning: ```text warning: non-canonical implementation of `clone` on a `Copy` type --> compiler/rustc_query_impl/src/lib.rs:60:29 | 60 | fn clone(&self) -> Self { | _____________________________^ 61 | | DynamicConfig { dynamic: self.dynamic } 62 | | } | |_____^ help: change this to: `{ *self }` ```
2025-09-06Rollup merge of #146236 - hkBst:gpu-1, r=ZuseZ4Matthias Krüger-1/+1
gpu offload: change suspicious map into filter Fixes clippy warning: ```text warning: this call to `map()` won't have an effect on the call to `count()` --> compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs:194:25 | 194 | let num_ptr_types = types | _________________________^ 195 | | .iter() 196 | | .map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer)) 197 | | .count(); | |________________^ | = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map = note: `-W clippy::suspicious-map` implied by `-W clippy::suspicious` = help: to override `-W clippy::suspicious` add `#[allow(clippy::suspicious_map)]` ```
2025-09-06Auto merge of #146282 - tgross35:rollup-0n5tjnm, r=tgross35bors-6/+17
Rollup of 5 pull requests Successful merges: - rust-lang/rust#139524 (Add socket extensions for cygwin) - rust-lang/rust#145940 (single buffer for exponent fmt of integers) - rust-lang/rust#146206 (identity uses are ok, even if there are no defining uses) - rust-lang/rust#146272 (Update comment for `-Werror` on LLVM builds) - rust-lang/rust#146280 (Make `LetChainsPolicy` public for rustfmt usage) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-06ImproperCTypes: redo state trackingniacdoial-138/+225
No changes should be visible by rustc users This is just some architecture changes to the type checking to facilitate FFI-safety decisions that depend on how the type is used (the change here is not complete, there are still bits of "legacy" state passing for this, but since this is a retconned commit, I can tell you those bits will disappear before the end of the commit chain) (there is at least one bit where the decision making code is weird, but that this is because we do not want to change the lint's behaviour this early in the chain)
2025-09-06ImproperCTypes: re-separate linting and checkingniacdoial-224/+292
no visible changes to rust users, just making the inner architecture of the ImproperCTypes lints more sensible, with a clean separation between the struct (now singular) that interacts with the linting system and the struct (now singular) that visits the types to check FFI-safety
2025-09-06ImproperCTypes: more pre-emptive cleanupniacdoial-30/+15
Mainly, we realise that the non-null assumption on a Box<_> argument does not depend on what side of the FFI boundary the function is on. And anyway, this is not the way to deal with this assumption being maybe violated.