about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-23Stabilize precise_capturing_in_traitsMichael Goulet-91/+22
2025-03-23Auto merge of #138602 - Veykril:push-purxoytpktpu, r=SparrowLiibors-2/+4
Slim `rustc_parse_format` dependencies down `rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead. This allows the crate to built without having to wait for `syn` (pulled in by `rustc_index_macros`) Alternatively we could inline the macro, though from the looks of it that will run into trouble with `rustc_randomized_layouts`
2025-03-23Slim `rustc_parse_format` dependencies downLukas Wirth-2/+4
`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead
2025-03-23Auto merge of #136769 - thaliaarchi:io-optional-methods/stdio, r=joboetbors-161/+136
Provide optional `Read`/`Write` methods for stdio Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types. Tracked in https://github.com/rust-lang/rust/issues/136756. try-job: x86_64-msvc-1
2025-03-23Auto merge of #138833 - joboet:optimize-repeat-n, r=thomccbors-4/+55
core: optimize `RepeatN` ...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
2025-03-22Auto merge of #138841 - matthiaskrgr:rollup-bfkls57, r=matthiaskrgrbors-105/+256
Rollup of 8 pull requests Successful merges: - #138018 (rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.) - #138294 (Mark some std tests as requiring `panic = "unwind"`) - #138468 (rustdoc js: add nonnull helper and typecheck src-script.js) - #138675 (Add release notes for 1.85.1) - #138765 (Fix Thread::set_name on cygwin) - #138786 (Move some driver code around) - #138793 (target spec check: better error when llvm-floatabi is missing) - #138822 (De-Stabilize `file_lock`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-22Auto merge of #138831 - matthiaskrgr:rollup-3t0dqiz, r=matthiaskrgrbors-86/+226
Rollup of 7 pull requests Successful merges: - #138609 (Add stack overflow handler for cygwin) - #138639 (Clean UI tests 2 of n) - #138773 (catch_unwind intrinsic: document return value) - #138782 (test(ui): add tuple-struct-where-clause-suggestion ui test for #91520) - #138794 (expand: Do not report `cfg_attr` traces on macros as unused attributes) - #138801 (triagebot: add autolabel rules for D-* and L-*) - #138804 (Allow inlining for `Atomic*::from_ptr`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-22Rollup merge of #138822 - moxian:unlock, r=joshtriplettMatthias Krüger-5/+10
De-Stabilize `file_lock` This reverts #136794 FCP on the tracking issue (#130994) passsed successfully https://github.com/rust-lang/rust/issues/130994#issuecomment-2646158607 but there are now concerns about the suitability of the proposed API (https://github.com/rust-lang/rust/issues/130994#issuecomment-2734608366) On zullip it was [suggested](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/File.3A.3Atry_lock.20API.3A.20Result.3Cbool.3E/near/506823067) that it would be better to temporarily(?) destabilize the feature ASAP to buy us some more time reflecting on the API. This PR implements the revert. The feature is not currently on beta (https://github.com/rust-lang/rust/blob/beta/library/std/src/fs.rs#L672) so a beta backport is not yet neccessary. If this revert is accepted, the tracking issue (#130994) should be reopened
2025-03-22Rollup merge of #138793 - RalfJung:arm-floatabi, r=NoratriebMatthias Krüger-1/+4
target spec check: better error when llvm-floatabi is missing
2025-03-22Rollup merge of #138786 - bjorn3:driver_code_move, r=compiler-errorsMatthias Krüger-43/+37
Move some driver code around `--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
2025-03-22Rollup merge of #138765 - Berrysoft:cygwin-thread-name, r=joboetMatthias Krüger-2/+3
Fix Thread::set_name on cygwin Just like Linux, Cygwin also sets a limitation to thread name. https://github.com/cygwin/cygwin/blob/8e50c7af7c49819245739d6f626f6fecc394ef7f/winsup/cygwin/thread.cc#L3175
2025-03-22Rollup merge of #138675 - cuviper:release-1.85.1, r=UrgauMatthias Krüger-0/+11
Add release notes for 1.85.1 Closes #138819.
2025-03-22Rollup merge of #138468 - lolbinarycat:rustdoc-js-less-expect-error-part3, ↵Matthias Krüger-9/+70
r=notriddle rustdoc js: add nonnull helper and typecheck src-script.js this removes ``@ts-nocheck`` from `src-script.js` and adds a `nonnull` helper function that assists in adding null checks to places where null values should be impossible. r? `@notriddle`
2025-03-22Rollup merge of #138294 - paulmenage:test-panic-unwind, r=bjorn3Matthias Krüger-2/+39
Mark some std tests as requiring `panic = "unwind"` This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
2025-03-22Rollup merge of #138018 - obi1kenobi:pg/librustdoc_repr_attr, r=aDotInTheVoidMatthias Krüger-43/+82
rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output. Switch away from `Debug`-like representation of `#[repr(..)]` attributes, and start using rustdoc's own logic for pretty-printing `#[repr(..)]` in rustdoc JSON. Part of addressing #137645 but not a complete solution for it. r? `@aDotInTheVoid`
2025-03-22rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.Predrag Gruevski-43/+82
2025-03-22Clarify "Windows 1607"Josh Stone-1/+1
2025-03-22Auto merge of #138830 - matthiaskrgr:rollup-gaxgfwl, r=matthiaskrgrbors-1612/+1845
Rollup of 7 pull requests Successful merges: - #138410 (Couple mir building cleanups) - #138490 (Forward `stream_position` in `Arc<File>` as well) - #138535 (Cleanup `LangString::parse`) - #138536 (stable_mir: Add `MutMirVisitor`) - #138673 (Fix build failure on Trusty) - #138750 (Make `crate_hash` not iterate over `hir_crate` owners anymore) - #138763 (jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-22core: optimize `RepeatN`joboet-4/+55
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
2025-03-22Rollup merge of #138804 - tgross35:atomic-from-ptr-inline, r=RalfJungMatthias Krüger-0/+3
Allow inlining for `Atomic*::from_ptr` Currently this cannot be inlined, which among other things means it can't be used in `compiler-builtins` [1]. These are trivial functions that should be inlineable, so add `#[inline]`. [1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
2025-03-22Rollup merge of #138801 - lolbinarycat:triagebot-autolabel-138565, r=NoratriebMatthias Krüger-0/+17
triagebot: add autolabel rules for D-* and L-* fixes #138565 r? `@Noratrieb`
2025-03-22Rollup merge of #138794 - petrochenkov:cfgtracefix, r=jieyouxuMatthias Krüger-8/+15
expand: Do not report `cfg_attr` traces on macros as unused attributes Fixes https://github.com/rust-lang/rust/issues/138779
2025-03-22Rollup merge of #138782 - karolzwolak:where-test-91520, r=compiler-errorsMatthias Krüger-0/+38
test(ui): add tuple-struct-where-clause-suggestion ui test for #91520 Fixes #91520 I tried to also make it a .fixed test, but I failed to accomplish that. That's because of the 'consider annotating `Inner<T>` with `#[derive(Clone)]`' suggestion does not compile (conflicting Clone implementations), and I can't isolate them with `rustfix-only-machine-applicable` as both suggestions are not marked as `MachineApplicable`. Instead I just test that the where clause suggestion is applied to the correct line.
2025-03-22Rollup merge of #138773 - RalfJung:catch_unwind_docs, r=jhprattMatthias Krüger-0/+1
catch_unwind intrinsic: document return value Seems like we forgot to document this. The comment reflects what Miri does, which seems to also match what codegen does at least [in `codegen_gnu_try`](https://github.com/rust-lang/rust/blob/b754ef727ca87050a8d758fc44f524cfb4310eff/compiler/rustc_codegen_llvm/src/intrinsic.rs#L953-L964).
2025-03-22Rollup merge of #138639 - spencer3035:clean-ui-tests-2-of-n, r=jieyouxuMatthias Krüger-78/+65
Clean UI tests 2 of n Modified 4 tests in tests/ui. Cleaned 3 and deleted one. I have a final commit changing the values in `src/tools/tidy/src/ui_tests.rs`. I wasn't sure if it was best practice to change this value as you go along or once at the end. I can rebase to something that incrementally changes the value in the "cleaned" commits if that is preferred. Related Issues: #73494 #133895 r? jieyouxu
2025-03-22Rollup merge of #138609 - Berrysoft:cygwin-stackoverflow, r=joboetMatthias Krüger-0/+87
Add stack overflow handler for cygwin The cygwin runtime handles stack overflow exception and converts it to `SIGSEGV`, but the passed `si_addr` is obtained from `ExceptionInformation[1]` which is actually an undocumented value when stack overflows. Thus I choose to use Windows API directly to register handler, just like how std does on native Windows. The code is basically copied from the Windows one. Ref: * https://github.com/cygwin/cygwin/blob/5ec497dc80bcb7ad78cc07bb919b2624b361f017/winsup/cygwin/exceptions.cc#L822-L823 * https://learn.microsoft.com/zh-cn/windows/win32/api/winnt/ns-winnt-exception_record
2025-03-22Rollup merge of #138763 - aDotInTheVoid:two-years-later, r=GuillaumeGomezMatthias Krüger-1192/+1259
jsondocck: Replace `jsonpath_lib` with `jsonpath-rust` The current jsonpath implementation we use isn't spec-compliant, and is buggy. See https://github.com/freestrings/jsonpath/issues/91 To solve it, it's replaced with https://github.com/besok/jsonpath-rust. This is spec-compiant, and doesn't have a really awkward bug we need to always dance around. Unfortunately, this requires rewriting almost every test, as the behaviour of `[?(```@`,``` which is *extremely* common was changed. (But the new behaviour makes way more sense, and isn't buggy with tripply nested selectors) Unblocks #110406. Makes #100515 much easier as we don't need to explain the broken JSONPath implementation Best reviewed commit-by-commit. The first does the replacement. The next two rewrite the test-suite mechanically. The last rewrites the test-suite by hand. r? ```@GuillaumeGomez```
2025-03-22Rollup merge of #138750 - oli-obk:decouple-hir-queries, r=fee1-deadMatthias Krüger-6/+5
Make `crate_hash` not iterate over `hir_crate` owners anymore cc https://github.com/rust-lang/rust/issues/95004 One more direct usage of hir::Crate removed
2025-03-22Rollup merge of #138673 - taiki-e:trusty-fix, r=NoratriebMatthias Krüger-1/+1
Fix build failure on Trusty This target is currently broken due to update to 2024 editon. ```console $ cargo new --lib repro $ cd repro $ cargo check -Z build-std=std --target aarch64-unknown-trusty Compiling std v0.0.0 ($HOME/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std) error: extern blocks must be unsafe --> $HOME/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/random/trusty.rs:1:1 | 1 | / extern "C" { 2 | | fn trusty_rng_secure_rand(randomBuffer: *mut core::ffi::c_void, randomBufferLen: libc::size_t); 3 | | } | |_^ error: could not compile `std` (lib) due to 1 previous error ``` cc ```@randomPoison``` ```@ahomescu``` ([target maintainers](https://doc.rust-lang.org/nightly/rustc/platform-support/trusty.html#target-maintainers))
2025-03-22Rollup merge of #138536 - makai410:mut-mir-visitor, r=celinvalMatthias Krüger-333/+508
stable_mir: Add `MutMirVisitor` Resolves: [rust-lang/project-stable-mir#81](https://github.com/rust-lang/project-stable-mir/issues/81). I am unsure if we should add a `MutableBody` like Kani did. Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`. r? ``````@celinval``````
2025-03-22Rollup merge of #138535 - yotamofek:pr/rustdoc/lang-string-parse-cleanup, ↵Matthias Krüger-44/+41
r=notriddle Cleanup `LangString::parse` Flatten some `if`s into match patterns Use `str::strip_prefix` instead of `starts_with`+indexing Avoid redundant tests for `extra.is_some()`
2025-03-22Rollup merge of #138490 - tbu-:pr_arc_file_pos, r=NoratriebMatthias Krüger-0/+3
Forward `stream_position` in `Arc<File>` as well It was missed in #137165.
2025-03-22Rollup merge of #138410 - bjorn3:misc_cleanups, r=compiler-errorsMatthias Krüger-36/+28
Couple mir building cleanups
2025-03-22Auto merge of #136974 - m-ou-se:fmt-options-64-bit, r=scottmcmbors-321/+363
Reduce FormattingOptions to 64 bits This is part of https://github.com/rust-lang/rust/issues/99012 This reduces FormattingOptions from 6-7 machine words (384 bits on 64-bit platforms, 224 bits on 32-bit platforms) to just 64 bits (a single register on 64-bit platforms). Before: ```rust pub struct FormattingOptions { flags: u32, // only 6 bits used fill: char, align: Option<Alignment>, width: Option<usize>, precision: Option<usize>, } ``` After: ```rust pub struct FormattingOptions { /// Bits: /// - 0-20: fill character (21 bits, a full `char`) /// - 21: `+` flag /// - 22: `-` flag /// - 23: `#` flag /// - 24: `0` flag /// - 25: `x?` flag /// - 26: `X?` flag /// - 27: Width flag (if set, the width field below is used) /// - 28: Precision flag (if set, the precision field below is used) /// - 29-30: Alignment (0: Left, 1: Right, 2: Center, 3: Unknown) /// - 31: Always set to 1 flags: u32, /// Width if width flag above is set. Otherwise, always 0. width: u16, /// Precision if precision flag above is set. Otherwise, always 0. precision: u16, } ```
2025-03-22Use unit structs for stateless stdioThalia Archibald-12/+12
This seems to be the pattern for newer pal stdio types.
2025-03-22Implement exact reads for StdinRawThalia Archibald-28/+35
2025-03-22Implement optional methods for unsupported stdioThalia Archibald-1/+64
Match what `std::io::Empty` does, since it is very similar. However, still evaluate the `fmt::Arguments` in `write_fmt` to be consistent with other platforms.
2025-03-22Auto merge of #138719 - lcnr:concrete_opaque_types-closures, r=oli-obkbors-153/+147
merge opaque types defined in nested bodies A small step towards https://github.com/rust-lang/types-team/issues/129 r? `@oli-obk`
2025-03-21cleaned and organized 3 tests in `./tests/ui/issues`Spencer-78/+65
2025-03-21Revert "Stabilize file_lock"moxian-5/+10
This reverts commit 82af73dd4c58cd6bec5fb44cf02f7ac96b1ed48b.
2025-03-22Auto merge of #138808 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 14 commits in 6cf8267012570f63d6b86e85a2ae5627de52df9e..307cbfda3119f06600e43cd38283f4a746fe1f8b 2025-03-14 15:25:36 +0000 to 2025-03-20 20:00:39 +0000 - feat: Add custom completer for cargo &lt;TAB&gt; to complete aliases defined in config.toml (rust-lang/cargo#15319) - fix(build-dir): Renamed workspace-manifest-path-hash to workspace-path-hash (rust-lang/cargo#15334) - feat: vcs, color, and message format native completion (rust-lang/cargo#15322) - Fix `[env]` `relative` description in reference (rust-lang/cargo#15332) - chore: fix some typos (rust-lang/cargo#15329) - Cleanup for rustc-link-arg-cdylib (rust-lang/cargo#15326) - fix(toml): Report '&lt;target&gt;.edition' deprecation to users (rust-lang/cargo#15321) - test(build-std): address overly-matched snapshot (rust-lang/cargo#15325) - Added `build.build_dir` templating support (rust-lang/cargo#15236) - docs: make it clearer that `rust_version` is enforced during compile (rust-lang/cargo#15303) - feat: Add custom completer for cargo +&lt;TAB&gt; to complete toolchain name (rust-lang/cargo#15301) - chore: fix some typos (rust-lang/cargo#15316) - fix: deduplicate crate types in cargo rustc command (rust-lang/cargo#15314) - docs: mention wrong URLs as a cause of git authentication errors (rust-lang/cargo#15304) r? ghost
2025-03-21Update cargoWeihang Lo-0/+0
2025-03-21triagebot: add autolabel rules for D-* and L-*binarycat-0/+17
fixes #138565
2025-03-21Auto merge of #128320 - saethlin:link-me-maybe, r=compiler-errorsbors-26/+57
Avoid no-op unlink+link dances in incr comp Incremental compilation scales quite poorly with the number of CGUs. This PR improves one reason for that. The incr comp process hard-links all the files from an old session into a new one, then it runs the backend, which may just hard-link the new session files into the output directory. Then codegen hard-links all the output files back to the new session directory. This PR (perhaps unimaginatively) fixes the silliness that ensues in the last step. The old `link_or_copy` implementation would be passed pairs of paths which are already the same inode, then it would blindly delete the destination and re-create the hard-link that it just deleted. This PR lets us skip both those operations. We don't skip the other two hard-links. `cargo +stage1 b && touch crates/core/main.rs && strace -cfw -elink,linkat,unlink,unlinkat cargo +stage1 b` before and then after on `ripgrep-13.0.0`: ``` % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 52.56 0.024950 25 978 485 unlink 34.38 0.016318 22 727 linkat 13.06 0.006200 24 249 unlinkat ------ ----------- ----------- --------- --------- ---------------- 100.00 0.047467 24 1954 485 total ``` ``` % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 42.83 0.014521 57 252 unlink 38.41 0.013021 26 486 linkat 18.77 0.006362 25 249 unlinkat ------ ----------- ----------- --------- --------- ---------------- 100.00 0.033904 34 987 total ``` This reduces the number of hard-links that are causing perf troubles, noted in https://github.com/rust-lang/rust/issues/64291 and https://github.com/rust-lang/rust/issues/137560
2025-03-21Allow inlining for `Atomic*::from_ptr`Trevor Gross-0/+3
Currently this cannot be inlined, which among other things means it can't be used in `compiler-builtins` [1]. These are trivial functions that should be inlineable, so add `#[inline]`. [1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
2025-03-21Auto merge of #138791 - matthiaskrgr:rollup-ev46cqr, r=matthiaskrgrbors-304/+457
Rollup of 9 pull requests Successful merges: - #138364 (ports the compiler test cases to new rust_intrinsic format) - #138570 (add `naked_functions_target_feature` unstable feature) - #138623 ([bootstrap] Use llvm_runtimes for compiler-rt) - #138627 (Autodiff cleanups) - #138669 (tests: accept some noise from LLVM 21 in symbols-all-mangled) - #138706 (Improve bootstrap git modified path handling) - #138709 (Update GCC submodule) - #138717 (Add an attribute that makes the spans from a macro edition 2021, and fix pin on edition 2024 with it) - #138721 (Use explicit cpu in some asm and codegen tests.) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-21Add test for Formatter flags.Mara Bos-0/+20
2025-03-21Add todo comment on using a niche type for fmt flags.Mara Bos-0/+2
2025-03-21expand: Do not report `cfg_attr` traces on macros as unused attributesVadim Petrochenkov-8/+15
2025-03-21target spec check: better error when llvm-floatabi is missingRalf Jung-1/+4