about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-24Rollup merge of #142825 - jdonszelmann:track-caller, r=oli-obkJubilee-60/+92
Port `#[track_caller]` to the new attribute system r? ``@oli-obk`` depends on https://github.com/rust-lang/rust/pull/142493 Closes rust-lang/rust#142783 (didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
2025-06-24Rollup merge of #142768 - scottmcm:avoid-unneeded-bitcast, r=WaffleLapkinJubilee-2/+53
Avoid a bitcast FFI call in transmuting For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
2025-06-24Rollup merge of #142633 - folkertdev:interrupt-abi-restrict-signature, ↵Jubilee-195/+505
r=workingjubilee Error on invalid signatures for interrupt ABIs We recently added `extern "custom"`, which must have type `fn()`. The various `extern "interrupt"` ABIs impose similar constraints on the signature of functions with that ABI: `x86-interrupt` should not have a return type (linting on the exact argument types is left as future work), and the other interrupt ABIs cannot have any parameters or a return type. r? ```@workingjubilee```
2025-06-24Rollup merge of #142453 - ChrisDenton:fused, r=AmanieuJubilee-0/+1
Windows: make `read_dir` stop iterating after the first error is encountered This also essentially makes the `ReadDir` iterator fused. Which I think is pretty much what people expect anyway. [`FindNextFileW`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextfilew) doesn't document what happens if you call it after iteration ends or after an error so we're probably in implementation defined territory at that point.
2025-06-24Rollup merge of #138780 - trifectatechfoundation:loop_match_attr, ↵Jubilee-45/+2480
r=oli-obk,traviscross Add `#[loop_match]` for improved DFA codegen tracking issue: https://github.com/rust-lang/rust/issues/132306 project goal: https://github.com/rust-lang/rust-project-goals/issues/258 This PR adds the `#[loop_match]` attribute, which aims to improve code generation for state machines. For some (very exciting) benchmarks, see https://github.com/rust-lang/rust-project-goals/issues/258#issuecomment-2732965199 Currently, a very restricted syntax pattern is accepted. We'd like to get feedback and merge this now before we go too far in a direction that others have concerns with. ## current state We accept code that looks like this ```rust #[loop_match] loop { state = 'blk: { match state { State::A => { #[const_continue] break 'blk State::B } State::B => { /* ... */ } /* ... */ } } } ``` - a loop should have the same semantics with and without `#[loop_match]`: normal `continue` and `break` continue to work - `#[const_continue]` is only allowed in loops annotated with `#[loop_match]` - the loop body needs to have this particular shape (a single assignment to the match scrutinee, with the body a labelled block containing just a match) ## future work - perform const evaluation on the `break` value - support more state/scrutinee types ## maybe future work - allow `continue 'label value` syntax, which `#[const_continue]` could then use. - allow the match to be on an arbitrary expression (e.g. `State::Initial`) - attempt to also optimize `break`/`continue` expressions that are not marked with `#[const_continue]` r? ``@traviscross``
2025-06-24Rollup merge of #135731 - frank-king:feature/pin-borrow, r=eholk,traviscrossJubilee-18/+839
Implement parsing of pinned borrows This PR implements part of #130494. EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped. ### Implementation steps: - [x] parse the `&pin mut $place` and `&pin const $place` syntaxes - [ ] borrowck of `&pin mut|const` - [ ] support autoref of `&pin mut|const` when needed
2025-06-24Auto merge of #142979 - matthiaskrgr:rollup-szqah4e, r=matthiaskrgrbors-406/+881
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142645 (Also emit suggestions for usages in the `non_upper_case_globals` lint) - rust-lang/rust#142657 (mbe: Clean up code with non-optional `NonterminalKind`) - rust-lang/rust#142799 (rustc_session: Add a structure for keeping both explicit and default sysroots) - rust-lang/rust#142805 (Emit a single error when importing a path with `_`) - rust-lang/rust#142882 (Lazy init diagnostics-only local_names in borrowck) - rust-lang/rust#142883 (Add impl_trait_in_bindings tests from rust-lang/rust#61773) - rust-lang/rust#142943 (Don't include current rustc version string in feature removed help) - rust-lang/rust#142965 ([RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform) - rust-lang/rust#142972 (Add a missing mailmap entry) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-24fix 142783Jana Dönszelmann-5/+7
2025-06-24fix clippyJana Dönszelmann-2/+3
2025-06-24Rewrite #[track_caller]Jana Dönszelmann-53/+82
2025-06-24Auto merge of #142959 - bjorn3:sync_cg_clif-2025-06-24, r=bjorn3bors-125/+98
Subtree sync for rustc_codegen_cranelift The main highlight this time is a Cranelift update. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-06-24Rollup merge of #142972 - tgross35:dwood-mailmap, r=davidtwcoMatthias Krüger-1/+3
Add a missing mailmap entry There aren't too many commits with the new emails, but per https://github.com/rust-lang/rust/pull/142470#issuecomment-3000079137 they belong to the same person so we may as well map them.
2025-06-24Rollup merge of #142965 - ↵Matthias Krüger-0/+1
raoulstrackx:raoul/rte-497-fix_c-link-to-rust-va-list-fn_test, r=jieyouxu [RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform rust-lang/rust#141856 enables using the runner defined in bootstrap.toml to execute run-make tests. A test was added for this feature that compiles a Rust library and C code, links them together and passes the result to the runner. Unfortunately, that's not sufficient for the SGX platform; x86 machine code cannot be directly executed. This PR fixes the issue by disabling this test for SGX.
2025-06-24Rollup merge of #142943 - jieyouxu:no-rustc-version, r=compiler-errorsMatthias Krüger-44/+29
Don't include current rustc version string in feature removed help The version string is difficult to properly normalize out, and removing it isn't a huge deal (the user can query version info easily through `rustc --version` or `cargo --version`). The normalization options were all non-ideal (see https://github.com/rust-lang/rust/pull/142940#issuecomment-2998518450): - Per-test version string normalization is nasty to maintain, and we need to maintain `n` copies of it. See rust-lang/rust#142930 where the regex wasn't robust against different release channels. - Centralized compiletest normalization (with a directive opt-out) is also not ideal, because `cfg(version(..))` tests can't have those accidentally normalized out (and you'd have to remember to opt-out). r? `@workingjubilee` (discussed in rust-lang/rust#142940)
2025-06-24Rollup merge of #142883 - mominul:impl_in_bindings, r=lcnrMatthias Krüger-0/+36
Add impl_trait_in_bindings tests from #61773 This adds the [three test cases](https://github.com/rust-lang/rust/issues/61773#issuecomment-2952638727) from the rust-lang/rust#61773 as was suggested by ``@lcnr.`` I have merged the first two cases into one, named as `region-lifetimes.rs` r? ``@lcnr`` Closes rust-lang/rust#61773
2025-06-24Rollup merge of #142882 - kornelski:var-debug-info-lazy, r=petrochenkovMatthias Krüger-45/+63
Lazy init diagnostics-only local_names in borrowck `local_names` is not used during successful compilation, so not initializing it saves a little bit of work. I've also made it accessible only from the diagnostics module to make it clearer that the names are from `var_debug_info` which is technically optional and could be absent.
2025-06-24Rollup merge of #142805 - estebank:underscore-import, r=compiler-errorsMatthias Krüger-40/+188
Emit a single error when importing a path with `_` When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`. Fix rust-lang/rust#142662.
2025-06-24Rollup merge of #142799 - petrochenkov:expnop, r=bjorn3Matthias Krüger-97/+93
rustc_session: Add a structure for keeping both explicit and default sysroots Also avoid creating and cloning sysroot unnecessarily. Implements the suggestion from https://github.com/rust-lang/rust/pull/142089#discussion_r2132204079. r? ``@bjorn3``
2025-06-24Rollup merge of #142657 - tgross35:nonoptional-fragment-specifiers-cleanup, ↵Matthias Krüger-164/+216
r=petrochenkov mbe: Clean up code with non-optional `NonterminalKind` Since [rust-lang/rust#128425], the fragment specifier is unconditionally required in all editions. This means `NonTerminalKind` no longer needs to be optional, as we can reject this code during the expansion of `macro_rules!` rather than handling it throughout the code. Do this cleanup here. [rust-lang/rust#128425]: https://github.com/rust-lang/rust/pull/128425
2025-06-24Rollup merge of #142645 - Urgau:usage-non_upper_case_globals, r=fmeaseMatthias Krüger-15/+252
Also emit suggestions for usages in the `non_upper_case_globals` lint This PR adds suggestions for all the usages of the renamed item in the warning of the `non_upper_case_globals` lint. Fixes https://github.com/rust-lang/rust/issues/124061
2025-06-24Add a missing mailmap entryTrevor Gross-1/+3
2025-06-24Emit a single error when importing a path with `_`Esteban Küber-81/+138
When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`.
2025-06-24Auto merge of #142962 - GuillaumeGomez:rollup-do1coji, r=GuillaumeGomezbors-603/+700
Rollup of 7 pull requests Successful merges: - rust-lang/rust#137268 (Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`.) - rust-lang/rust#142704 (Remove the deprecated unstable `concat_idents!` macro) - rust-lang/rust#142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2) - rust-lang/rust#142843 (Enable reproducible-build-2 for Windows MSVC) - rust-lang/rust#142916 (rustdoc-json: Add test for `#[optimize(..)]`) - rust-lang/rust#142919 (rustdoc-json: Add test for `#[cold]`) - rust-lang/rust#142944 (Stats output tweaks) Failed merges: - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-24Don't include current rustc version string in feature removed helpJieyou Xu-44/+29
The version string is difficult to properly normalize out, and removing it isn't a huge deal (the user can query version info easily through `rustc --version` or `cargo --version`). The normalization options were all non-ideal: - Per-test version string normalization is nasty to maintain, and we need to maintain `n` copies of it. - Centralized compiletest normalization (with a directive opt-out) is also not ideal, because `cfg(version(..))` tests can't have those accidentally normalized out (and you'd have to remember to opt-out).
2025-06-24Ignore c-link-to-rust-va-list-fn test on SGX platformRaoul Strackx-0/+1
2025-06-24Add impl_trait_in_bindings testsMuhammad Mominul Huque-0/+36
2025-06-24Rollup merge of #142944 - nnethercote:stats-tweaks, r=lqdGuillaume Gomez-129/+167
Stats output tweaks Some improvements to `-Zinput-stats` and `-Zmeta-stat` inspired by the new `-Zmacro-stats`. r? `@lqd`
2025-06-24Rollup merge of #142919 - aDotInTheVoid:cold-cold-attr-for-you, r=GuillaumeGomezGuillaume Gomez-0/+3
rustdoc-json: Add test for `#[cold]` Follow-up to https://github.com/rust-lang/rust/pull/142491 r? `@GuillaumeGomez` CC `@jdonszelmann`
2025-06-24Rollup merge of #142916 - aDotInTheVoid:you-can-trip-on-my-optimizer, ↵Guillaume Gomez-0/+13
r=GuillaumeGomez rustdoc-json: Add test for `#[optimize(..)]` Follow up to https://github.com/rust-lang/rust/pull/138291 CC `@jdonszelmann` r? `@GuillaumeGomez`
2025-06-24Rollup merge of #142843 - dpaoliello:reproducible-build-2, r=jieyouxuGuillaume Gomez-12/+32
Enable reproducible-build-2 for Windows MSVC Works with MSVC if instructing the linker to avoid timestamps and deleting the PDB between compilations. Addresses item in rust-lang/rust#128602 --- try-job: x86_64-mingw-* try-job: x86_64-msvc-* try-job: i686-msvc-*
2025-06-24Rollup merge of #142742 - dpaoliello:arm64eclinking, r=bjorn3Guillaume Gomez-51/+197
[win][aarch64] Fix linking statics on Arm64EC, take 2 Arm64EC builds recently started to fail due to the linker not finding a symbol: ``` symbols.o : error LNK2001: unresolved external symbol #_ZN3std9panicking11EMPTY_PANIC17hc8d2b903527827f1E (EC Symbol) C:\Code\hello-world\target\arm64ec-pc-windows-msvc\debug\deps\hello_world.exe : fatal error LNK1120: 1 unresolved externals ``` It turns out that `EMPTY_PANIC` is a new static variable that was being exported then imported from the standard library, but when exporting LLVM didn't prepend the name with `#` (as only functions are prefixed with this character), whereas Rust was prefixing with `#` when attempting to import it. The fix is to have Rust not prefix statics with `#` when importing. Adding tests discovered another issue: we need to correctly mark static exported from dylibs with `DATA`, otherwise MSVC's linker assumes they are functions and complains that there is no exit thunk for them. Fixes rust-lang/rust#138541 Resurrects rust-lang/rust#140176 now that rust-lang/rust#141061 is merged, which removes the incompatibility with `__rust_no_alloc_shim_is_unstable`. r? ``@wesleywiser`` CC ``@bjorn3``
2025-06-24Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-deadGuillaume Gomez-411/+165
Remove the deprecated unstable `concat_idents!` macro In [rust-lang/rust#137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e595f8 ("Add #concat_idents[] and #ident_to_str[]"). The syntax looks a bit different but it still works about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: https://github.com/rust-lang/rust/issues/29599 [rust-lang/rust#137653]: https://github.com/rust-lang/rust/pull/137653 [`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
2025-06-24Rollup merge of #137268 - bjoernager:c-string-eq-c-str, r=AmanieuGuillaume Gomez-0/+123
Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`. Closes: #137265 This PR adds the trait implementations proposed in the [ACP](https://github.com/rust-lang/libs-team/issues/517/) under the `c_string_eq_c_str` feature gate: ```rust // core::ffi impl PartialEq<&Self> for CStr; impl PartialEq<CString> for CStr; impl PartialEq<Cow<'_, Self>> for CStr; // alloc::ffi impl PartialEq<CStr> for CString; impl PartialEq<&CStr> for CString; impl PartialEq<Cow<'_, CStr>> for CString; // alloc::borrow impl PartialEq<CStr> for Cow<'_, CStr>; impl PartialEq<&CStr> for Cow<'_, CStr>; impl PartialEq<CString> for Cow<'_, CStr>; ``` As I understand it, stable traits cannot be unstably implemented for stable types, and we would thereby be forced to skip the FCP and directly stabilise these implementations (as is done in this PR). (`@joshtriplett` mentioned that Crater may have to be run).
2025-06-24rustc_session: Add a structure for keeping both explicit and default sysrootsVadim Petrochenkov-97/+93
Also avoid creating and cloning sysroot unnecessarily.
2025-06-24Error on invalid signatures for interrupt ABIsFolkert de Vries-195/+505
2025-06-24Update tidy exceptionsbjorn3-0/+3
2025-06-24Merge commit '8c848e0604b5d26fad120914f822f564fe05c52a' into ↵bjorn3-125/+95
sync_cg_clif-2025-06-24
2025-06-24Remove the deprecated `concat_idents!` macroTrevor Gross-335/+53
In [137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e595f8 ("Add #concat_idents[] and about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: https://www.github.com/rust-lang/rust/issues/29599 [137653]: https://www.github.com/rust-lang/rust/pull/137653 [`macro_metavar_expr_concat`]: https://www.github.com/rust-lang/rust/issues/124225
2025-06-24Move some `issues-*` tests to better homesTrevor Gross-8/+6
These tests were updated in the previous commit; while they are being cleaned up, move them to a non-issue directory.
2025-06-24Migrate some tests away from `concat-idents`Trevor Gross-57/+95
`concat_idents!` is in the process of being removed, but a few things it is used to test will still be relevant. Migrate these tests to something other than `concat_idents`.
2025-06-24Rustup to rustc 1.90.0-nightly (706f244db 2025-06-23)bjorn3-1/+1
2025-06-24Auto merge of #142956 - GuillaumeGomez:rollup-867246h, r=GuillaumeGomezbors-236/+681
Rollup of 9 pull requests Successful merges: - rust-lang/rust#140005 (Set MSG_NOSIGNAL for UnixStream) - rust-lang/rust#140622 (compiletest: Improve diagnostics for line annotation mismatches) - rust-lang/rust#142354 (Fixes firefox copy paste issue) - rust-lang/rust#142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - rust-lang/rust#142779 (Add note about `str::split` handling of no matches.) - rust-lang/rust#142894 (phantom_variance_markers: fix identifier usage in macro) - rust-lang/rust#142928 (Fix hang in --print=file-names in bootstrap) - rust-lang/rust#142932 (rustdoc-json: Keep empty generic args if parenthesized) - rust-lang/rust#142933 (Simplify root goal API of solver a bit) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-24Rollup merge of #142933 - compiler-errors:refactor-solver-api, r=lcnrGuillaume Gomez-68/+41
Simplify root goal API of solver a bit Root goal API is more easily distinguished between proof tree and non-proof tree, rather than `eval_goal` vs `eval_goal_raw`. r? lcnr
2025-06-24Rollup merge of #142932 - Enselic:keep-empty-generic-params, r=aDotInTheVoidGuillaume Gomez-13/+19
rustdoc-json: Keep empty generic args if parenthesized Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements. This is an amendment to https://github.com/rust-lang/rust/pull/142502, so: r? ``@aDotInTheVoid`` cc ``@nnethercote`` cc https://github.com/cargo-public-api/cargo-public-api/pull/798
2025-06-24Rollup merge of #142928 - Noratrieb:no-more-hang, r=clubby789Guillaume Gomez-0/+6
Fix hang in --print=file-names in bootstrap In an interactive context, the subprocess inherited a real tty stdin, which lead it it waiting for something to happen, even though nothing happened. By explicitly passing null as stdin we make sure an empty file is passed, which achieves the desired behavior. Fixes rust-lang/rust#142926 (verified locally by cherry-picking the patch onto beta where I was building).
2025-06-24Rollup merge of #142894 - pthariensflame:patch-1, r=jhprattGuillaume Gomez-1/+1
phantom_variance_markers: fix identifier usage in macro This shouldn't have worked originally, as far as we can tell. Fixes an implementation detail of rust-lang/rust#135806.
2025-06-24Rollup merge of #142779 - Erk-:fix/core/142734, r=jhprattGuillaume Gomez-0/+6
Add note about `str::split` handling of no matches. Adds small note and example to the test for a non matching pattern resolves rust-lang/rust#142734
2025-06-24Rollup merge of #142695 - ↵Guillaume Gomez-41/+246
GrigorenkoPV:attributes/rustc_skip_during_method_dispatch, r=jdonszelmann Port `#[rustc_skip_during_method_dispatch]` to the new attribute system Part of rust-lang/rust#131229 r? ``@jdonszelmann``
2025-06-24Rollup merge of #142354 - gstjepan2:firefox_copy_paste_issue, r=GuillaumeGomezGuillaume Gomez-1/+29
Fixes firefox copy paste issue
2025-06-24Rollup merge of #140622 - petrochenkov:annusexp, r=jieyouxuGuillaume Gomez-111/+297
compiletest: Improve diagnostics for line annotation mismatches When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient. This PR attempts to improve the user experience. - The "expected ... not found" messages are no longer duplicated. - The `proc_res.status` and `proc_res.cmdline` message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end. - Compiletest now makes suggestions if there are fuzzy matches between expected and actually reported errors (e.g. the annotation is put on a wrong line). - Missing diagnostic kinds are no longer produce an error eagerly, but instead treated as always mismatching kinds, so they can produce suggestions telling the right kind. I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test `tests/ui/compiletest-self-test/line-annotation-mismatches.rs`. This also fixes https://github.com/rust-lang/rust/issues/140940. r? ``@jieyouxu``