about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-04-05Fix ProvenVia for global where clausesMichael Goulet-2/+10
2025-04-05formatAdam Kobzan-3/+3
2025-04-05Fix TypoAdam Kobzan-2/+2
2025-04-05In `simplify_repeated_aggregate`, don't test first element against itselfYotam Ofek-3/+3
2025-04-05Reuse the index from promoted nodes when coloring executed tasksJohn Kåre Alsaker-36/+88
2025-04-05Auto merge of #139292 - compiler-errors:folder-experiment-7, r=lqdbors-1/+23
Folder experiment: Micro-optimize RegionEraserVisitor **NOTE:** This is one of a series of perf experiments that I've come up with while sick in bed. I'm assigning them to lqd b/c you're a good reviewer and you'll hopefully be awake when these experiments finish, lol. r? lqd The region eraser is very hot, so let's see if we can avoid erasing types (and visiting consts and preds that don't have region-ful types) unnecessarily.
2025-04-05let `rustc_smir` host `stable_mir` for refactoringMakai-302/+344
2025-04-05Switch `time` to `jiff` for time formatting in ICE dumpsclubby789-11/+4
2025-04-05Auto merge of #139401 - matthiaskrgr:rollup-uqdfj6u, r=matthiaskrgrbors-0/+40
Rollup of 4 pull requests Successful merges: - #138368 (KCFI: Add KCFI arity indicator support) - #138381 (Implement `SliceIndex` for `ByteStr`) - #139092 (Move `fd` into `std::sys`) - #139398 (Change notifications for Exploit Mitigations PG) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-05Dedup call to layout queryYotam Ofek-25/+11
2025-04-05Only `format!` error message on failureYotam Ofek-1/+1
2025-04-05Rollup merge of #138368 - rcvalle:rust-kcfi-arity, r=davidtwcoMatthias Krüger-0/+40
KCFI: Add KCFI arity indicator support Adds KCFI arity indicator support to the Rust compiler (see https://github.com/rust-lang/rust/issues/138311, https://github.com/llvm/llvm-project/pull/121070, and https://lore.kernel.org/lkml/CANiq72=3ghFxy8E=AU9p+0imFxKr5iU3sd0hVUXed5BA+KjdNQ@mail.gmail.com/).
2025-04-05Auto merge of #139281 - petrochenkov:ctxtdecod6, r=wesleywiserbors-103/+67
hygiene: Avoid recursion in syntax context decoding #139241 has two components - Avoiding recursion during syntax context decoding - Encoding/decoding only the non-redundant data, and recalculating the redundant data again during decoding Both of these parts may influence compilation times, possibly in opposite directions. So this PR contains only the first part to evaluate its effect in isolation.
2025-04-05KCFI: Add KCFI arity indicator supportRamon de C Valle-0/+40
Adds KCFI arity indicator support to the Rust compiler (see rust-lang/rust#138311, https://github.com/llvm/llvm-project/pull/121070, and https://lore.kernel.org/lkml/CANiq72=3ghFxy8E=AU9p+0imFxKr5iU3sd0hVUXed5BA+KjdNQ@mail.gmail.com/).
2025-04-05Rollup merge of #139341 - nnethercote:fix-137874, r=petrochenkovStuart Cook-4/+16
Apply `Recovery::Forbidden` when reparsing pasted macro fragments. Fixes #137874. The changes to the output of `tests/ui/associated-consts/issue-93835.rs` partly undo the changes seen when `NtTy` was removed in #133436, which is good. r? ``@petrochenkov``
2025-04-05Rollup merge of #139285 - tshepang:uniform-case, r=jieyouxuStuart Cook-5/+7
use lower case to match other error messages
2025-04-05Rollup merge of #138950 - yaahc:svh-metrics-name, r=bjorn3Stuart Cook-8/+10
replace extra_filename with strict version hash in metrics file names Should resolve the potential issue of overwriting metrics from the same crate when compiled with different features or flags. r? `````@estebank````` try-job: test-various
2025-04-05Rollup merge of #138826 - makai410:assoc-items, r=celinvalStuart Cook-7/+185
StableMIR: Add `associated_items`. Resolves: https://github.com/rust-lang/project-stable-mir/issues/87
2025-04-05Rollup merge of #137880 - EnzymeAD:autodiff-batching, r=oli-obkStuart Cook-179/+476
Autodiff batching Enzyme supports batching, which is especially known from the ML side when training neural networks. There we would normally have a training loop, where in each iteration we would pass in some data (e.g. an image), and a target vector. Based on how close we are with our prediction we compute our loss, and then use backpropagation to compute the gradients and update our weights. That's quite inefficient, so what you normally do is passing in a batch of 8/16/.. images and targets, and compute the gradients for those all at once, allowing better optimizations. Enzyme supports batching in two ways, the first one (which I implemented here) just accepts a Batch size, and then each Dual/Duplicated argument has not one, but N shadow arguments. So instead of ```rs for i in 0..100 { df(x[i], y[i], 1234); } ``` You can now do ```rs for i in 0..100.step_by(4) { df(x[i+0],x[i+1],x[i+2],x[i+3], y[i+0], y[i+1], y[i+2], y[i+3], 1234); } ``` which will give the same results, but allows better compiler optimizations. See the testcase for details. There is a second variant, where we can mark certain arguments and instead of having to pass in N shadow arguments, Enzyme assumes that the argument is N times longer. I.e. instead of accepting 4 slices with 12 floats each, we would accept one slice with 48 floats. I'll implement this over the next days. I will also add more tests for both modes. For any one preferring some more interactive explanation, here's a video of Tim's llvm dev talk, where he presents his work. https://www.youtube.com/watch?v=edvaLAL5RqU I'll also add some other docs to the dev guide and user docs in another PR. r? ghost Tracking: - https://github.com/rust-lang/rust/issues/124509 - https://github.com/rust-lang/rust/issues/135283
2025-04-04Auto merge of #139390 - matthiaskrgr:rollup-l64euwx, r=matthiaskrgrbors-86/+35
Rollup of 9 pull requests Successful merges: - #139041 (Remove `rustc_middle::ty::util::ExplicitSelf`.) - #139328 (Fix 2024 edition doctest panic output) - #139339 (unstable book: document tait) - #139348 (AsyncDestructor: replace fields with impl_did) - #139353 (Fix `Debug` impl for `LateParamRegionKind`.) - #139366 (ToSocketAddrs: fix typo) - #139374 (Use the span of the whole bound when the diagnostic talks about a bound) - #139378 (Use target-agnostic LLD flags in bootstrap for `use-lld`) - #139384 (Add `compiletest` adhoc_group for `r? compiletest`) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-04Detect and provide suggestion for `&raw EXPR`Michael Goulet-1/+49
2025-04-04Don't construct preds w escaping bound vars in diagnostic_hir_wf_checkMichael Goulet-1/+10
2025-04-05check if merged attributes list is emptyTakayuki Maeda-7/+9
2025-04-04Update `rustc-literal-escaper` version to `0.0.2`Guillaume Gomez-3/+3
2025-04-04Rollup merge of #139374 - oli-obk:const-trait-bound, r=compiler-errorsMatthias Krüger-2/+2
Use the span of the whole bound when the diagnostic talks about a bound While it makes sense that the host predicate only points to the `~const` part, as whether the actual trait bound is satisfied is checked separately, the user facing diagnostic is talking about the entire trait bound, at which point it makes more sense to just highlight the entire bound r? `@compiler-errors` or `@fee1-dead`
2025-04-04Rollup merge of #139366 - RalfJung:ToSocketAddrs, r=jieyouxuMatthias Krüger-1/+1
ToSocketAddrs: fix typo It's "a function", never "an function". I noticed the same typo somewhere in the compiler sources so figured I'd fix it there as well.
2025-04-04Rollup merge of #139353 - nnethercote:LateAnon, r=compiler-errorsMatthias Krüger-4/+4
Fix `Debug` impl for `LateParamRegionKind`. It uses `Br` prefixes which are inappropriate and appear to have been incorrectly copy/pasted from the `Debug` impl for `BoundRegionKind`. r? `@BoxyUwU`
2025-04-04Rollup merge of #139348 - meithecatte:async-destructor-minify, r=petrochenkovMatthias Krüger-17/+6
AsyncDestructor: replace fields with impl_did The future and ctor fields aren't actually used, and the way they are extracted is obviously wrong – swapping the order of the items in the source code will give wrong results. Instead, store just the LocalDefId of the impl, which is enough for the only use of this data.
2025-04-04Rollup merge of #139041 - nnethercote:rm-rustc_middle-ty-util-ExplicitSelf, ↵Matthias Krüger-62/+22
r=BoxyUwU Remove `rustc_middle::ty::util::ExplicitSelf`. It's an old (2017 or earlier) type that describes a `self` receiver. It's only used in `rustc_hir_analysis` for two error messages, and much of the complexity isn't used. I suspect it used to be used for more things. This commit removes it, and moves a greatly simplified version of the `determine` method into `rustc_hir_analysis`, renamed as `get_self_string`. The big comment on the method is removed because it no longer seems relevant. r? `@BoxyUwU`
2025-04-04Auto merge of #138785 - lcnr:typing-mode-borrowck, r=compiler-errors,oli-obkbors-497/+591
add `TypingMode::Borrowck` Shares the first commit with #138499, doesn't really matter which PR to land first :blush: :grin: Introduces `TypingMode::Borrowck` which unlike `TypingMode::Analysis`, uses the hidden type computed by HIR typeck as the initial value of opaques instead of an unconstrained infer var. This is a part of https://github.com/rust-lang/types-team/issues/129. Using this new `TypingMode` is unfortunately a breaking change for now, see tests/ui/impl-trait/non-defining-uses/as-projection-term.rs. Using an inference variable as the initial value results in non-defining uses in the defining scope. We therefore only enable it if with `-Znext-solver=globally` or `-Ztyping-mode-borrowck` To do that the PR contains the following changes: - `TypeckResults::concrete_opaque_type` are already mapped to the definition of the opaque type - writeback now checks that the non-lifetime parameters of the opaque are universal - for this, `fn check_opaque_type_parameter_valid` is moved from `rustc_borrowck` to `rustc_trait_selection` - we add a new `query type_of_opaque_hir_typeck` which, using the same visitors as MIR typeck, attempts to merge the hidden types from HIR typeck from all defining scopes - done by adding a `DefiningScopeKind` flag to toggle between using borrowck and HIR typeck - the visitors stop checking that the MIR type matches the HIR type. This is trivial as the HIR type are now used as the initial hidden types of the opaque. This check is useful as a safeguard when not using `TypingMode::Borrowck`, but adding it to the new structure is annoying and it's not soundness critical, so I intend to not add it back. - add a `TypingMode::Borrowck` which behaves just like `TypingMode::Analysis` except when normalizing opaque types - it uses `type_of_opaque_hir_typeck(opaque)` as the initial value after replacing its regions with new inference vars - it uses structural lookup in the new solver fixes #112201, fixes #132335, fixes #137751 r? `@compiler-errors` `@oli-obk`
2025-04-04add new flag to print the module post-AD, before optsManuel Drehwald-5/+17
2025-04-04add autodiff batching backendManuel Drehwald-44/+196
2025-04-04Auto merge of #137869 - ↵bors-1/+1
Noratrieb:Now_I_am_become_death,_the_destroyer_of_i686-pc-windows-gnu, r=workingjubilee Demote i686-pc-windows-gnu to Tier 2 In accordance with [RFC 3771](https://github.com/rust-lang/rfcs/pull/3771). FCP has been completed. tracking issue #138422 I also added a stub doc page for the target and renamed the windows-gnullvm page for consistency.
2025-04-04Use the span of the whole bound when the diagnostic talks about a boundOli Scherer-2/+2
2025-04-04refactor: Move env parsing of deployment target to rustc_sessionMads Marquart-75/+74
2025-04-04refactor: Move Apple OSVersion (back) to rustc_targetMads Marquart-100/+125
Also convert OSVersion into a proper struct for better type-safety.
2025-04-04ToSocketAddrs: fix typoRalf Jung-1/+1
2025-04-04Replace `rustc_lexer/unescape` with `rustc-literal-escaper` crateGuillaume Gomez-742/+13
2025-04-04Do not visit whole crate to compute `lints_that_dont_need_to_run`.Camille GILLOT-91/+28
2025-04-04Default auto traits: fix perfBryanskiy-35/+51
2025-04-04Auto merge of #139213 - bjorn3:cg_clif_test_coretests, r=jieyouxubors-23/+34
Run coretests and alloctests with cg_clif in CI Part of https://github.com/rust-lang/rustc_codegen_cranelift/issues/1290
2025-04-04Make the compiler suggest actual paths instead of visible paths if the ↵morine0122-2/+14
visible paths are through any doc hidden path.
2025-04-04Only introduce stable projections.Camille GILLOT-4/+12
2025-04-04Allow GVN to produce places and not just locals.Camille GILLOT-27/+39
2025-04-04fixup! Implement `super let`.Mara Bos-1/+1
2025-04-04Auto merge of #139354 - matthiaskrgr:rollup-04lgx23, r=matthiaskrgrbors-182/+160
Rollup of 8 pull requests Successful merges: - #138949 (Rename `is_like_osx` to `is_like_darwin`) - #139295 (Remove creation of duplicate `AnonPipe`) - #139313 (Deduplicate some `rustc_middle` function bodies by calling the `rustc_type_ir` equivalent) - #139317 (compiletest: Encapsulate all of the code that touches libtest) - #139322 (Add helper function for checking LLD usage to `run-make-support`) - #139335 (Pass correct param-env to `error_implies`) - #139342 (Add a mailmap entry for myself) - #139349 (adt_destructor: sanity-check returned item) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-04Boolean hate.Mara Bos-5/+15
2025-04-04Fix typo in pretty printing super let.Mara Bos-1/+1
Co-authored-by: lcnr <rust@lcnr.de>
2025-04-04Implement `super let`.Mara Bos-30/+108
2025-04-04Rollup merge of #139349 - meithecatte:destructor-constness, r=compiler-errorsMatthias Krüger-0/+5
adt_destructor: sanity-check returned item Fixes #139278