about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-10-02Rollup merge of #147221 - Zalathar:incremental, r=lqdMatthias Krüger-1/+26
Forbid `//@ compile-flags: -Cincremental=` in tests Tests should not try to manually enable incremental compilation with `-Cincremental`, because that typically results in stray directories being created in the repository root. Also, if the incremental directory is not cleared, there is a risk of interference between successive runs of the same test. Instead, use the `//@ incremental` directive, which instructs compiletest to handle the details of passing `-Cincremental` with a fresh directory.
2025-10-02Rollup merge of #147004 - estebank:ascription-in-pat, r=fee1-deadMatthias Krüger-123/+95
Tweak handling of "struct like start" where a struct isn't supported This improves the case where someone tries to write a `match` expr where the patterns have type ascription syntax. Makes them less verbose, by giving up on the first encounter in the block, and makes them more accurate by only treating them as a struct literal if successfully parsed as such. Before, encountering something like `match a { b:` would confuse the parser and think everything after `match` *must* be a struct, and if it wasn't it would generate a cascade of unnecessary diagnostics.
2025-10-02Rollup merge of #146585 - hkBst:indexing-1, r=jdonszelmannMatthias Krüger-34/+30
indexing: reword help After looking at https://github.com/rust-lang/rust/issues/40850, I thought I'd try to improve wording around error E0608 a bit. Hopefully I've succeeded.
2025-10-02Rollup merge of #146535 - joshtriplett:mbe-unsafe-attr, r=petrochenkovMatthias Krüger-38/+161
mbe: Implement `unsafe` attribute rules This implements `unsafe attr` rules for declarative `macro_rules!` attributes, as specified in [RFC 3697](https://github.com/rust-lang/rfcs/pull/3697). An invocation of an attribute that uses an `unsafe attr` rule requires the `unsafe(attr(...))` syntax. An invocation of an attribute that uses an ordinary `attr` rule must *not* use the `unsafe(attr(...))` syntax. `unsafe` is only supported on an `attr` rule, not any other kind of `macro_rules!` rule. Tracking issue for `macro_rules!` attributes: https://github.com/rust-lang/rust/issues/143547
2025-10-02Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, ↵Matthias Krüger-75/+917
r=Mark-Simulacrum Support `#[rustc_align_static]` inside `thread_local!` Tracking issue: rust-lang/rust#146177 ```rust thread_local! { #[rustc_align_static(64)] static SO_ALIGNED: u64 = const { 0 }; } ``` This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case. r? libs ``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
2025-10-02Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnrbors-247/+391
Split Bound index into Canonical and Bound See [#t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs`](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run. r? lcnr
2025-10-02Extract helper method `global_set_metadata_node`Zalathar-25/+19
2025-10-02Extract helper method `global_add_metadata_node`Zalathar-26/+20
2025-10-02Extract helper method `module_add_named_metadata_node`Zalathar-19/+18
2025-10-02Extract helper method `set_metadata_node`Zalathar-41/+36
2025-10-02mir-opt: Eliminate dead statements even if they are used by debuginfosdianqk-101/+170
2025-10-02codegen: Generate `dbg_value` for the ref statementdianqk-14/+431
2025-10-02mir-opt: Eliminate trivial unnecessary storage annotationsdianqk-556/+179
2025-10-02simplifycfg: Preserve debuginfos when merging bbsdianqk-3/+322
2025-10-02mir-opt: Eliminate dead ref statementsdianqk-511/+2139
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-02Forbid `//@ compile-flags: -Cincremental=` in testsZalathar-1/+26
Tests should not try to manually enable incremental compilation with `-Cincremental`, because that typically results in stray directories being created in the repository root. Instead, use the `//@ incremental` directive, which instructs compiletest to handle the details of passing `-Cincremental` with a fresh directory.
2025-10-01mbe: `expand_invoc`: Add comment about not needing to check safety of ↵Josh Triplett-0/+3
`LegacyAttr` here `LegacyAttr` is only used for builtin attributes, and builtin attributes have their safety checked by `check_attribute_safety`, so we don't need to check `unsafety` here.
2025-10-01mbe: Add tests for `unsafe` attr invocationJosh Triplett-1/+32
2025-10-01mbe: Add parsing tests for `unsafe` macro rulesJosh Triplett-9/+45
2025-10-01mbe: Support `unsafe` attribute rulesJosh Triplett-22/+75
2025-10-01mbe: Rename a local variable to match corresponding field namesJosh Triplett-7/+7
This simplifies subsequent initialization of enum variants.
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-01regression testKarol Zwolak-0/+54
2025-10-01bless testsKarol Zwolak-12/+9
2025-10-01Fix diagnostics str::replace comma to barA4-Tacks-18/+16
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-01Update booksrustbot-0/+0
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 memory leak in `os` implJules Bertholet-31/+85
2025-10-01Add the check-pass and check-fail tests.LorrensP-2158466-0/+86
2025-10-01Adjust WASI and WALI targetsdaxpedda-4/+12
2025-10-01Initialize llvm submodule if not already the case to run citoolGuillaume Gomez-1/+21
2025-10-01Switch `citool` to 2024 editionGuillaume Gomez-1/+1
2025-10-01implement `Box::take`edwloef-0/+31
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-01Don't enable shared memory with Wasm atomicsdaxpedda-32/+1
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.