about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-10-02Auto merge of #147055 - beepster4096:subtype_is_not_a_projection, r=lcnrbors-121/+56
Turn ProjectionElem::Subtype into CastKind::Subtype I noticed that drop elaboration can't, in general, handle `ProjectionElem::SubType`. It creates a disjoint move path that overlaps with other move paths. (`Subslice` does too, and I'm working on a different PR to make that special case less fragile.) If its skipped and treated as the same move path as its parent then `MovePath.place` has multiple possible projections. (It would probably make sense to remove all `Subtype` projections for the canonical place but it doesn't make sense to have this special case for a problem that doesn't actually occur in real MIR.) The only reason this doesn't break is that `Subtype` is always the sole projection of the local its applied to. For the same reason, it works fine as a `CastKind` so I figured that makes more sense than documenting and validating this hidden invariant. cc rust-lang/rust#112651, rust-lang/rust#133258 r? Icnr (bc you've been the main person dealing with `Subtype` it looks like)
2025-10-01Auto merge of #147210 - lnicola:sync-from-ra, r=lnicolabors-1519/+3736
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/a6bc4a4bbe6a65b71cbf76a0cf528c47a8d9f97f. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2025-10-01Auto merge of #147235 - matthiaskrgr:rollup-a0es1x9, r=matthiaskrgrbors-1181/+827
Rollup of 8 pull requests Successful merges: - rust-lang/rust#146593 (Allow specifying multiple bounds for same associated item, except in trait objects) - rust-lang/rust#147177 ([DebugInfo] Fix MSVC tuple child creation) - rust-lang/rust#147195 (iter repeat: add tests for new count and last behavior) - rust-lang/rust#147202 (Swap order of `resolve_coroutine_interiors` and `handle_opaque_type_uses`) - rust-lang/rust#147204 (Refactor ArrayWindows to use a slice) - rust-lang/rust#147219 (Add proper error handling for closure in impl) - rust-lang/rust#147226 (include `outer_inclusive_binder` of pattern types) - rust-lang/rust#147230 (Fix typo in 'unfulfilled_lint_expectation' to plural) r? `@ghost` `@rustbot` modify labels: rollup
2025-10-01Rollup merge of #147230 - demoray:patch-1, r=jdonszelmannMatthias Krüger-1/+1
Fix typo in 'unfulfilled_lint_expectation' to plural
2025-10-01Rollup merge of #147226 - jdonszelmann:pattern-types-next-solver, r=lcnrMatthias Krüger-2/+30
include `outer_inclusive_binder` of pattern types Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/237 r? ```@lcnr```
2025-10-01Rollup merge of #147219 - Kivooeo:typeof-is-imposter, r=jdonszelmannMatthias Krüger-9/+32
Add proper error handling for closure in impl Fixes https://github.com/rust-lang/rust/issues/147146 Fixes https://github.com/rust-lang/rust/issues/146620 Not sure if it can cause any regressions or anything, as for test also have no idea where to store this one cc ```@theemathas``` r? compiler
2025-10-01Rollup merge of #147204 - camsteffen:array-windows-ref, r=joboetMatthias Krüger-47/+22
Refactor ArrayWindows to use a slice [Tracking issue](https://github.com/rust-lang/rust/issues/75027)
2025-10-01Rollup merge of #147202 - jdonszelmann:swap-order, r=lcnrMatthias Krüger-18/+24
Swap order of `resolve_coroutine_interiors` and `handle_opaque_type_uses` r? ```@BoxyUwU``` if the comment says x should be last, it helps if it's actually last hehe :P Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/239
2025-10-01Rollup merge of #147195 - hkBst:repeat-3, r=Mark-SimulacrumMatthias Krüger-0/+11
iter repeat: add tests for new count and last behavior Tests for https://github.com/rust-lang/rust/pull/146410
2025-10-01Rollup merge of #147177 - Walnut356:tuples, r=Mark-SimulacrumMatthias Krüger-2/+3
[DebugInfo] Fix MSVC tuple child creation This is a fix for the debugger visualizer scripts For whatever reason, using `CreateChildAtOffset` on the child element sometimes caused issues with pointers (and maybe some other types). The resulting child's memory would be a block 4 bytes too far forward. Creating the child off of the parent `valobj` and using the type definition to get the correct offset seems to fix that. Before: <img width="489" height="136" alt="image" src="https://github.com/user-attachments/assets/fb4cb95c-f199-49a6-8eba-6d3ff486b69a" /> After: <img width="518" height="145" alt="image" src="https://github.com/user-attachments/assets/3f50dbc3-19ca-4fd8-87c5-b4be295f6e7c" /> This shouldn't affect any tests as we don't run debuginfo tests for MSVC afaik
2025-10-01Rollup merge of #146593 - Jules-Bertholet:restrict-e0719, r=BoxyUwUMatthias Krüger-1102/+704
Allow specifying multiple bounds for same associated item, except in trait objects Supersedes https://github.com/rust-lang/rust/pull/143146, fixes https://github.com/rust-lang/rust/issues/143143. This PR proposes to stop enforcing E0719 in all contexts other than trait object types. E0719 forbids constraining the same associated item twice within the same angle-bracket delimited associated item bound list (the `…` inside `T: Trait<…>`). For example, the following are forbidden: | Forbidden | Working alternative | |--------------------------------------------|--------------------------------------------------------------------| | `T: Trait<Gat<u32> = u32, Gat<u64> = u64>` | `T: Trait<Gat<u32> = u32> + Trait<Gat<u64> = u64>` | | `T: Iterator<Item = u32, Item = i32>` | `T: Iterator<Item = u32> + Iterator<Item = i32>` (trivially false) | | `T: Iterator<Item = u32, Item = u32>` | `T: Iterator<Item = u32>` | | `T: Iterator<Item: Send, Item: Sync>` | `T: Iterator<Item: Send + Sync>` | | `T: Trait<ASSOC = 3, ASSOC = 4>` | `T: Trait<ASSOC = 3> + Trait<ASSOC = 4>` (trivially false) | | `T: Trait<ASSOC = 3, ASSOC = 3>` | `T: Trait<ASSOC = 3>` | With this PR, all those previously forbidden examples would start working, as well as their APIT and RPIT equivalents. Types like `dyn Iterator<Item = u32, Item = u32>` will continue to be rejected, however. See https://github.com/rust-lang/rust/pull/143146#issuecomment-3274421752 for the reason why. ```@rustbot``` label T-lang T-types needs-fcp
2025-10-01Fix typo in 'unfulfilled_lint_expectation' to pluralBrian Caswell-1/+1
2025-10-01Auto merge of #147220 - Zalathar:rollup-fubv0wy, r=Zalatharbors-268/+420
Rollup of 11 pull requests Successful merges: - rust-lang/rust#146918 (add regression test) - rust-lang/rust#146980 (simplify setup_constraining_predicates, and note it is potentially cubic) - rust-lang/rust#147170 (compiletest: Pass around `DirectiveLine` instead of bare strings) - rust-lang/rust#147180 (add tests) - rust-lang/rust#147188 (Remove usage of `compiletest-use-stage0-libtest` from CI) - rust-lang/rust#147189 (Replace `rustc_span::Span` with a stripped down version for librustdoc's highlighter) - rust-lang/rust#147199 (remove outdated comment in (inner) `InferCtxt`) - rust-lang/rust#147200 (Fix autodiff empty ret regression) - rust-lang/rust#147209 (Remove `no-remap-src-base` from tests) - rust-lang/rust#147213 (Fix broken STD build for ESP-IDF) - rust-lang/rust#147217 (Don't create a top-level `true` directory when running UI tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-10-01swap order of resolve_coroutine_interiors and handle_opaque_type_usesJana Dönszelmann-18/+9
2025-10-01include outer_inclusive_binder of pattern typesJana Dönszelmann-0/+22
2025-10-01Change ArrayWindows to use a sliceCameron Steffen-47/+22
2025-10-01added error for closures case in implKivooeo-9/+32
2025-10-01Rollup merge of #147217 - Zalathar:true, r=petrochenkovStuart Cook-3/+4
Don't create a top-level `true` directory when running UI tests The funny thing about writing `-Cincremental=true` is that it *does* enable incremental compilation ... using an incremental compilation dir of `./true`. And for UI tests, that ends up creating a `true` directory in the repository root, which is annoying. Fortunately, compiletest has an existing `//@ incremental` directive that takes care of creating an empty incremental directory, and passing it to `-Cincremental`. --- I have manually checked that reverting rust-lang/rust#146649 still causes the updated test to fail.
2025-10-01Rollup merge of #147213 - ivmarkov:fix-hostname-espidf, r=joboetStuart Cook-1/+1
Fix broken STD build for ESP-IDF PRs rust-lang/rust#147162 and rust-lang/rust#146937 did [broke](https://github.com/esp-rs/esp-idf-sys/actions/runs/18151791720/job/51663969786) the STD build for `target_os = "espidf"` because that target [does not have neither a `gethostname`, not a `libc::_SC_HOST_NAME_MAX` by default](https://github.com/espressif/esp-idf/issues/14849). While there is a [3rd party component for this syscall](https://components.espressif.com/components/espressif/sock_utils/versions/0.2.2/readme) in the ESP-IDF component registry, I don't think we should use it, because it does not come with ESP-IDF by default. Therefore, the one-liner fix just re-routes ESP-IDF into the `unsupported` branch.
2025-10-01Rollup merge of #147209 - jieyouxu:remove-no-remap-src-base, r=ZalatharStuart Cook-8/+5
Remove `no-remap-src-base` from tests Previously in the `//`-compiletest-directive times, `no-remap-src-base` was implemented as a special `no-*` directive parsing. In the migration from `//` -> `//`@`,` the `// no-remap-src-base` directive was lost, most likely because it had no effect -- the default is not remapping `src-base`. So remove occurrences of `no-remap-src-base`, as these are not valid directives. r? `@Zalathar` (since we discussed this on discord, or compiler)
2025-10-01Rollup merge of #147200 - ZuseZ4:fix-autodiff-emptry-ret, r=ZalatharStuart Cook-6/+54
Fix autodiff empty ret regression closes https://github.com/rust-lang/rust/issues/147144 The two gsoc summer projects caused a bit of churn, which was to be expected, especially since we don't run autodiff in CI yet. This adds a void return testcase that we should have had anyway, and fixes the regression. r? `@Zalathar` (Just guessing since I've seen you in a few LLVM PRs and Oli is probably still busy. Feel free to reroll!)
2025-10-01Rollup merge of #147199 - jdonszelmann:outdated-comment-infctx, r=lcnrStuart Cook-17/+2
remove outdated comment in (inner) `InferCtxt` This comment seems to have stopped being relevant around 3 years ago after https://github.com/rust-lang/rust/commit/9f95c605f83bcf4c158ea4b3fd5a7abb825a4178. A map? what map? :P r? `@lcnr`
2025-10-01Rollup merge of #147189 - yotamofek:pr/rustdoc/highlight-optimizations-2, ↵Stuart Cook-19/+80
r=GuillaumeGomez Replace `rustc_span::Span` with a stripped down version for librustdoc's highlighter While profiling rustdoc's syntax highlighter, I noticed a lot of time being spent in the `Span` interner, due to the highlighter creating a lot of (new) spans. Since the only data from the `Span` that we use is the `hi` and `lo` byte positions - I replaced the regular `Span` with a simple one with two fields, and in my benchmarks it seemed to make a big dent in the highlighter's perf, so thought I would see what the perf runner says.
2025-10-01Rollup merge of #147188 - Kobzol:remove-compiletest-stage-1, r=Zalathar,jieyouxuStuart Cook-8/+1
Remove usage of `compiletest-use-stage0-libtest` from CI It shouldn't be needed anymore after https://github.com/rust-lang/rust/pull/146929. r? `@Zalathar`
2025-10-01Rollup merge of #147180 - lcnr:forced_ambiguity-error, r=jdonszelmannStuart Cook-1/+90
add tests fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/105 the index test is for rust-lang/rust#146637 r? types
2025-10-01Rollup merge of #147170 - Zalathar:directive, r=jieyouxuStuart Cook-177/+128
compiletest: Pass around `DirectiveLine` instead of bare strings This is an incremental step towards being able to clean up and centralize compiletest directive parsing. My original plan was to add features to `DirectiveLine`, and then gradually migrate parsing code to use those features. However, that turned out to be impractical, because of how the existing directive parsers call each other. So instead this PR focuses on getting them to all take `DirectiveLine` instead of bare strings, to enable incremental work in the future. Because this is part of an ongoing cleanup, I've prioritised clean diffs over nice code, because much of this code is going to be modified again when `DirectiveLine` is more capable. r? jieyouxu
2025-10-01Rollup merge of #146980 - hkBst:hir-analysis-1, r=jdonszelmannStuart Cook-28/+25
simplify setup_constraining_predicates, and note it is potentially cubic
2025-10-01Rollup merge of #146918 - lcnr:add-regression-test, r=jdonszelmannStuart Cook-0/+30
add regression test closes rust-lang/rust#128887 the errors in that issue are due to two separate issues: - MIR inlining causing the trait solver to hit the recursion limit (partially fixed in rust-lang/rust#129714) - using subtyping in method selection for paths (fixed in https://github.com/rust-lang/rust/pull/129073) We moved any remaining issues due to MIR inlining into https://github.com/rust-lang/rust/issues/131960, but keeping rust-lang/rust#128887 open as well seems unhelpful and confusing.
2025-10-01Don't create a top-level `true` directory when running UI testsZalathar-3/+4
2025-10-01Fix broken STD build for ESP-IDFivmarkov-1/+1
2025-10-01Remove mention of `compiletest-use-stage0-libtest` from the bootstrap ↵Jakub Beránek-3/+0
example config
2025-10-01tests: remove `no-remap-src-base`Jieyou Xu-8/+5
Previously in the `//`-compiletest-directive times, this was implemented as a special `no-*` directive parsing. In the migration from `//` -> `//@`, the `// no-remap-src-base` directive was lost, most likely because it had no effect -- the default is not remapping `src-base`. So remove occurrences of `no-remap-src-base`, as these are not valid directives.
2025-10-01Auto merge of #147198 - matthiaskrgr:rollup-b0ryvvu, r=matthiaskrgrbors-45/+243
Rollup of 6 pull requests Successful merges: - rust-lang/rust#143069 (Add fast-path for accessing the current thread id) - rust-lang/rust#146518 (Improve the documentation around `ZERO_AR_DATE`) - rust-lang/rust#146596 (Add a dummy codegen backend) - rust-lang/rust#146617 (Don’t suggest foreign `doc(hidden)` types in "the following other types implement trait" diagnostics) - rust-lang/rust#146635 (cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings) - rust-lang/rust#147184 (Fix the bevy implied bounds hack for the next solver) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-30updating tests to not break from new typetree metadataManuel Drehwald-5/+5
2025-09-30add empty struct ret testcaseManuel Drehwald-0/+41
2025-09-30fix void and empty struct retManuel Drehwald-1/+8
2025-10-01enable tests on next-solver for rust-lang/trait-system-refactor-initiative/237Jana Dönszelmann-2/+8
2025-10-01add test for trait-system-refactor-initiative/239Jana Dönszelmann-0/+15
2025-09-30remove outdated context (inner) infctxJana Dönszelmann-17/+2
2025-09-30Rollup merge of #147184 - jdonszelmann:bevy-outlives-bound, r=lcnrMatthias Krüger-3/+15
Fix the bevy implied bounds hack for the next solver The diff is trivial, of course, and basically what you already suggested. Mostly dug around a bunch to learn. I hope this is roughly what you had in mind. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/236. r? `@lcnr`
2025-09-30Rollup merge of #146635 - Zalathar:llvm-cov, r=SparrowLiiMatthias Krüger-17/+26
cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings [As explained by a note in `ffi.rs`](https://github.com/rust-lang/rust/blob/8a1b39995e5b630c5872f5de5079f1f569bd5ac2/compiler/rustc_codegen_llvm/src/llvm/ffi.rs#L4-L11), passing strings and byte slices through FFI is more convenient if we take advantage of the fact that `*const c_uchar` and `*const c_char` have the same ABI. Doing so avoids having to rely on a special helper function, since we can just call `as_ptr` instead. (The same logic applies to every other binding that currently uses the `as_c_char_ptr` helper; I just haven't adjusted all of them yet.) --- As a drive-by change, this PR also marks some coverage-related FFI bindings as `safe`.
2025-09-30Rollup merge of #146617 - Jules-Bertholet:E0277-NOFORN, r=SparrowLiiMatthias Krüger-15/+94
Don’t suggest foreign `doc(hidden)` types in "the following other types implement trait" diagnostics Fixes https://github.com/rust-lang/rust/issues/132024. ``@rustbot`` label A-diagnostics T-compiler
2025-09-30Rollup merge of #146596 - bjorn3:dummy_backend, r=SparrowLiiMatthias Krüger-4/+70
Add a dummy codegen backend This allows building a rustc capable of running the frontend without any backend present. While this may not seem all that useful, it allows running the frontend of rustc to report errors or running miri to interpret a program without any backend present. This is useful when you are trying to say run miri in the browser as upstream LLVM can't be compiled for wasm yet. Or to run rustc itself in miri like I did a while ago and caught some UB.
2025-09-30Rollup merge of #146518 - madsmtm:ld-reproducible-doc, r=SparrowLiiMatthias Krüger-3/+13
Improve the documentation around `ZERO_AR_DATE` In particular, document why we don't use the new `-reproducible` flag. I went through [the source for Apple's old linker](https://github.com/apple-oss-distributions/ld64), and compared the versions with [the mapping to Xcode versions on Wikipedia](https://en.wikipedia.org/wiki/Xcode) to find the relevant Xcode versions for these features. r? compiler
2025-09-30Rollup merge of #143069 - jsimmons:current-thread-id-accessor, ↵Matthias Krüger-3/+25
r=joshtriplett,tgross35 Add fast-path for accessing the current thread id Accessing the thread id is often used in profiling and debugging, as well as some approaches for sound single-threaded access to shared data. Currently the only way to access the thread id is by first obtaining a handle to the current thread. While this is not exactly slow, it does require an atomic inc-ref and dec-ref operation, as well as the injection of `Thread`'s drop code into the caller. This publicly exposes the existing fast-path for accessing the current thread id. edit: ACP: https://github.com/rust-lang/libs-team/issues/650
2025-09-30clone region obligations instead of taking in implied bounds hackJana Dönszelmann-1/+11
2025-09-30Auto merge of #147197 - matthiaskrgr:rollup-du5e4pv, r=matthiaskrgrbors-142/+409
Rollup of 6 pull requests Successful merges: - rust-lang/rust#142506 (Add `Path::has_trailing_sep` and related methods) - rust-lang/rust#146886 (Add repr(align(2)) to RcInner and ArcInner) - rust-lang/rust#147166 (several small `proc_macro` cleanups) - rust-lang/rust#147172 (bootstrap: build bootstrap docs with in-tree rustdoc) - rust-lang/rust#147181 (cg_llvm: Replace enum `MetadataType` with a list of `MetadataKindId` constants) - rust-lang/rust#147187 (remove unnecessary test directives) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-30Replace `rustc_span::Span` with a stripped down version for librustdoc's ↵Yotam Ofek-18/+65
highlighter
2025-09-30Add fast-path for accessing the current thread idJosh Simmons-3/+25
Accessing the thread id is often used in profiling and debugging, as well as some approaches for sound single-threaded access to data. Currently the only way to access the thread id is by first obtaining a handle to the current thread. While this is not exactly slow, it does require an atomic inc-ref and dec-ref operation, as well as the injection of `Thread`'s drop code into the caller. This publicly exposes the existing fast-path for accessing the current thread id.
2025-09-30Rollup merge of #147187 - lcnr:rarw, r=lqdMatthias Krüger-7/+0
remove unnecessary test directives that's... odd