about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-29coverage: Rename `CoverageStatus` to `CoverageAttrKind`Zalathar-32/+27
This patch also prepares the affected code in `coverage_attr_on` for some subsequent changes.
2025-07-29coverage: Test how `#[automatically_derived]` affects instrumentationZalathar-0/+370
2025-07-29resuse eagerly resolved goal from previous iterationlcnr-13/+37
2025-07-29In generate_mut_trait_impl, don't add a tabstop if the client does not ↵Chayim Refael Friedman-2/+49
support snippets
2025-07-29add extra drop, panic, and unwind testsConnor Tsui-22/+80
2025-07-29add nonpoison and poison mutex testsConnor Tsui-146/+260
Adds tests for the `nonpoison::Mutex` variant by using a macro to duplicate the existing `poison` tests. Note that all of the tests here are adapted from the existing `poison` tests.
2025-07-29reorder mutex testsConnor Tsui-144/+158
This commit simply helps discern the actual changes needed to test both poison and nonpoison locks.
2025-07-29add `nonpoison::mutex` implementationConnor Tsui-32/+682
Adds the equivalent `nonpoison` types to the `poison::mutex` module. These types and implementations are gated under the `nonpoison_mutex` feature gate. Also blesses the ui tests that now have a name conflicts (because these types no longer have unique names). The full path distinguishes the different types. Co-authored-by: Aandreba <aandreba@gmail.com> Co-authored-by: Trevor Gross <tmgross@umich.edu>
2025-07-29clean up existing poison filesConnor Tsui-5/+5
2025-07-29Merge pull request #20335 from Kobzol/ci-gh-appLaurențiu Nicola-4/+2
Use GH app for authenticating sync PRs
2025-07-29Switch to using a GH app for authenticating sync PRsJakub Beránek-5/+3
So there will no longer be the need to close and reopen sync PRs in order for CI to run.
2025-07-29Merge pull request #1891 from Kobzol/ci-gh-appTrevor Gross-1/+2
Use GitHub app for authenticating sync workflows
2025-07-29Use GH app for authenticating pull PRsJakub Beránek-4/+6
2025-07-29Use GH app for authenticating sync PRsJakub Beránek-4/+2
2025-07-29Use GitHub app for authenticating sync workflowsJakub Beránek-1/+2
2025-07-29Merge pull request #2523 from Kobzol/ci-mainJakub Beránek-1/+1
Use main branch of josh-sync for CI workflow
2025-07-29Use main branch of josh-sync for CI workflowJakub Beránek-1/+1
2025-07-29Merge pull request #2521 from rust-lang/ci-gh-appJakub Beránek-5/+3
Authenticate using GitHub app for the sync workflow
2025-07-29Remove `bot-pull-requests` triagebot configJakub Beránek-3/+0
2025-07-29WIP: auth using GitHub appJakub Beránek-2/+3
2025-07-29Add a regression test for an ICE with the `generic_const_exprs` feature ↵Jacob Adam-0/+42
attribute. It ensures that using the `generic_const_exprs` feature in a library crate without enabling it in a dependent crate does not lead to an ICE.
2025-07-29cc dependencies: clarify commentRalf Jung-4/+4
2025-07-29Create two methods to fix `find_oldest_ancestor_in_same_ctxt`xizheyin-42/+58
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-29Merge pull request #20333 from Veykril/push-xmulpqkxrytnLukas Wirth-7/+2
fix: Do not require all rename definitions to be renameable
2025-07-29clearer wording for `unsafe` codegewitternacht-2/+2
2025-07-29fix: Do not require all rename definitions to be renameableLukas Wirth-7/+2
2025-07-29Auto merge of #144624 - Zalathar:rollup-w803jmq, r=Zalatharbors-281/+1045
Rollup of 10 pull requests Successful merges: - rust-lang/rust#143883 (Add `--link-targets-dir` argument to linkchecker) - rust-lang/rust#144236 (Add `core::mem::DropGuard`) - rust-lang/rust#144367 (Move dist-apple-various from x86_64 to aarch64) - rust-lang/rust#144539 (constify with_exposed_provenance) - rust-lang/rust#144569 (rustc-dev-guide subtree update) - rust-lang/rust#144573 (Raw Pointers are Constant PatKinds too) - rust-lang/rust#144575 (fixed typo chunks->as_chunks) - rust-lang/rust#144578 (Ensure correct aligement of rustc_hir::Lifetime on platforms with lower default alignments.) - rust-lang/rust#144582 (fix `Atomic*::as_ptr` wording) - rust-lang/rust#144616 (coverage: Regression test for "function name is empty" bug) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-28Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()`Scott McMurray-48/+68
2025-07-29Rollup merge of #144616 - Zalathar:try-in-macro, r=jieyouxuStuart Cook-0/+266
coverage: Regression test for "function name is empty" bug Regression test for rust-lang/rust#141577, which was triggered by rust-lang/rust#144298. The bug was triggered by a particular usage of the `?` try operator in a proc-macro expansion. Thanks to lqd for the minimization at https://github.com/rust-lang/rust/pull/144571#issuecomment-3127534223. --- I have manually verified that reverting the relevant follow-up fixes (rust-lang/rust#144480 and rust-lang/rust#144530) causes this test to reproduce the bug: ```sh git revert -m1 8aa3d41b8527f9f78e0f2459b50a6e13aea35144 c462895a6f0b463ff0c1c1db2a3a654d7e5976c7 ``` --- r? compiler
2025-07-29Rollup merge of #144582 - usamoi:docs, r=RalfJungStuart Cook-9/+9
fix `Atomic*::as_ptr` wording r? `````@RalfJung````` cc rust-lang/rust#144072
2025-07-29Rollup merge of #144578 - FractalFir:m68k_fix, r=compiler-errorsStuart Cook-0/+5
Ensure correct aligement of rustc_hir::Lifetime on platforms with lower default alignments. The compiler relies on `hir::Lifetime` being aligned to at least 4 bytes(for the purposes of pointer tagging). However, on some systems(like m68k) with lower alignment requirements(eg. usize / u32 aligned to 2 bytes),`hir::Lifetime` will be aligned to only 2 bytes. This causes the compilation to fail on those systems - a const assert in the compiler fails. This PR makes the aligement requriement of hir::Lifetime explict. This has no effect on platforms where that already is the case(repr align can only raise alignment), but ensures the alignment will stay correct no matter what.
2025-07-29Rollup merge of #144575 - xonx4l:patch-6, r=scottmcmStuart Cook-1/+1
fixed typo chunks->as_chunks Fixes rust-lang/rust#144555 info-: fix typo chunks -> as_chunks This now take us to as_chunks page when clicking on as_chunks link and not to chunks . Thanks .
2025-07-29Rollup merge of #144573 - BoxyUwU:patkind_constant_ptr_docs, r=lcnrStuart Cook-0/+2
Raw Pointers are Constant PatKinds too raw pointers can be matched on with a const pattern: ```rust const FOO: *const u8 = core::ptr::null(); fn foo(a: *const u8) { match a { FOO => (), _ => todo!(), } } ``` as far as I can tell this is represented with a `PatKind::Constant`: https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs#L333-L337
2025-07-29Rollup merge of #144569 - tshepang:rdg-sync, r=KobzolStuart Cook-242/+449
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/e19866a61df01efa7e7fd6fdaff571909534da4e. Created using https://github.com/rust-lang/josh-sync. r? `````@ghost`````
2025-07-29Rollup merge of #144539 - RalfJung:const_with_exposed_provenance, r=oli-obkStuart Cook-2/+4
constify with_exposed_provenance We allow `int as ptr` in const, so it only makes sense to also allow this function. Otherwise, `const fn` can't be ported to use the more explicit exposed provenance APIs. Note that as of today, `with_exposed_provenance` in const is equivalent to `without_provenance`. However, we probably don't want to promise that: if someone does `with_exposed_provenance(MMIO_ADDR)` in const and then uses that pointer at runtime, that is something we should ensure keeps working; if someone does the same with `without_provenance` then I would consider that UB. Tracking: https://github.com/rust-lang/rust/issues/144538 Cc `````@rust-lang/wg-const-eval````` `````@rust-lang/opsem`````
2025-07-29Rollup merge of #144367 - shepmaster:reduce-x86-macos-runner-usage, ↵Stuart Cook-1/+1
r=Mark-Simulacrum Move dist-apple-various from x86_64 to aarch64 `macos-13` is going away soonish.
2025-07-29Rollup merge of #144236 - yoshuawuyts:drop-guard, r=Mark-SimulacrumStuart Cook-0/+207
Add `core::mem::DropGuard` ## 1.0 Summary This PR introduces a new type `core::mem::DropGuard` which wraps a value and runs a closure when the value is dropped. ```rust use core::mem::DropGuard; // Create a new guard around a string that will // print its value when dropped. let s = String::from("Chashu likes tuna"); let mut s = DropGuard::new(s, |s| println!("{s}")); // Modify the string contained in the guard. s.push_str("!!!"); // The guard will be dropped here, printing: // "Chashu likes tuna!!!" ``` ## 2.0 Motivation A number of programming languages include constructs like `try..finally` or `defer` to run code as the last piece of a particular sequence, regardless of whether an error occurred. This is typically used to clean up resources, like closing files, freeing memory, or unlocking resources. In Rust we use the `Drop` trait instead, allowing us to [never having to manually close sockets](https://blog.skylight.io/rust-means-never-having-to-close-a-socket/). While `Drop` (and RAII in general) has been working incredibly well for Rust in general, sometimes it can be a little verbose to setup. In particular when upholding invariants are local to functions, having a quick inline way to setup an `impl Drop` can be incredibly convenient. We can see this in use in the Rust stdlib, which has a number of private `DropGuard` impls used internally: - [library/alloc/src/vec/drain.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/vec/drain.rs#L177) - [library/alloc/src/boxed/thin.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/boxed/thin.rs#L362) - [library/alloc/src/slice.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/slice.rs#L413) - [library/alloc/src/collections/linked_list.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/collections/linked_list.rs#L1135) - [library/alloc/src/collections/binary_heap/mod.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/collections/binary_heap/mod.rs#L1816) - [library/alloc/src/collections/btree/map.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/collections/btree/map.rs#L1715) - [library/alloc/src/collections/vec_deque/drain.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/collections/vec_deque/drain.rs#L95) - [library/alloc/src/vec/into_iter.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/alloc/src/vec/into_iter.rs#L488) - [library/std/src/os/windows/process.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/library/std/src/os/windows/process.rs#L320) - [tests/ui/process/win-proc-thread-attributes.rs](https://github.com/rust-lang/rust/blob/9982d6462bedf1e793f7b2dbd655a4e57cdf67d4/tests/ui/process/win-proc-thread-attributes.rs#L17) ## 3.0 Design This PR implements what can be considered about the simplest possible design: 1. A single type `DropGuard` which takes both a generic type `T` and a closure `F`. 2. `Deref` + `DerefMut` impls to make it easy to work with the `T` in the guard. 3. An `impl Drop` on the guard which calls the closure `F` on drop. 4. An inherent `fn into_inner` which takes the type `T` out of the guard without calling the closure `F`. Notably this design does not allow divergent behavior based on the type of drop that has occurred. The [`scopeguard` crate](https://docs.rs/scopeguard/latest/scopeguard/index.html) includes additional `on_success` and `on_onwind` variants which can be used to branch on unwind behavior instead. However [in a lot of cases](https://github.com/rust-lang/rust/issues/143612#issuecomment-3053928328) this doesn’t seem necessary, and using the arm/disarm pattern seems to provide much the same functionality: ```rust let guard = DropGuard::new((), |s| ...); // 1. Arm the guard other_function(); // 2. Perform operations guard.into_inner(); // 3. Disarm the guard ``` `DropGuard` combined with this pattern seems like it should cover the vast majority of use cases for quick, inline destructors. It certainly seems like it should cover all existing uses in the stdlib, as well as all existing uses in crates like [hashbrown](https://github.com/search?q=repo%3Arust-lang%2Fhashbrown%20guard&type=code). ## 4.0 Acknowledgements This implementation is based on the [mini-scopeguard crate](https://github.com/yoshuawuyts/mini-scopeguard) which in turn is based on the [scopeguard crate](https://docs.rs/scopeguard). The implementations only differ superficially; because of the nature of the problem there is only really one obvious way to structure the solution. And the scopeguard crate got that right! ## 5.0 Conclusion This PR adds a new type `core::mem::DropGuard` to the stdlib which adds a small convenience helper to create inline destructors with. This would bring the majority of the functionality of the `scopeguard` crate into the stdlib, which is the [49th most downloaded crate](https://crates.io/crates?sort=downloads) on crates.io (387 million downloads). Given the actual implementation of `DropGuard` is only around 60 lines, it seems to hit that sweet spot of low-complexity / high-impact that makes for a particularly efficient stdlib addition. Which is why I’m putting this forward for consideration; thanks!
2025-07-29Rollup merge of #143883 - pietroalbini:pa-linkchecker-extra-target, r=ehussStuart Cook-26/+101
Add `--link-targets-dir` argument to linkchecker In my release notes API list tool (rust-lang/rust#143053) I want to check whether all links generated by the tool are actually valid, and using linkchecker seems to be the most sensible choice. Linkchecker currently has a fairly big limitation though: it can only check a single directory, it checks *all* of the files within it, and link targets must point inside that same directory. This works great when checking the whole documentation package, but in my case I only need to check that one file contains valid links to the standard library docs. To solve that, this PR adds a new `--link-targets-dir` flag to linkchecker. Directories passed to it will be valid link targets (with lower priority than the root being checked), but links within them will not be checked. I'm not that happy with the name of the flag, happy for it to be bikeshedded.
2025-07-28Add a MIR test for `align_of_val` on a sliceScott McMurray-0/+33
2025-07-28Add a mir-opt pre-codegen test for dropping a `Box<[impl Copy]>`Scott McMurray-0/+463
2025-07-29update lockfile and bless tidyRalf Jung-0/+144
2025-07-29Merge pull request #20300 from A4-Tacks/fix-debug_assert-doc-genChayim Refael Friedman-6/+62
Fix gen panics doc template for debug_assert
2025-07-29Auto merge of #143289 - scottmcm:remove-array-chunks, r=jhprattbors-540/+23
Remove `[T]::array_chunks(_mut)` Since libs-api is proposing as much in https://github.com/rust-lang/rust/issues/74985#issuecomment-3024465102 Closes rust-lang/rust#74985 Closes rust-lang/rust#76354 try-job: dist-various-1 try-job: dist-various-2
2025-07-29coverage: Regression test for "function name is empty" bugZalathar-0/+266
The bug was triggered by a particular usage of the `?` try operator in a proc-macro expansion. Thanks to lqd for the minimization. Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2025-07-29Add the CRC instructions.Philip Woolford-1/+1
2025-07-29Fortify RemoveUnneededDrops test.Camille GILLOT-222/+94
2025-07-29Make resolve_fn_signature responsible for its own rib.Camille GILLOT-75/+54
2025-07-29Enable features that are always available in a live system.Philip Woolford-1/+1
While some neon and crypto features may not be supported on the switch at boot (e.g. on the a53 cores), the features will _always_ be available if running as a sysmodule or homebrew application under Horizon/Atmosphere.
2025-07-28Auto merge of #144524 - rust-lang:cargo_update, r=clubby789bors-17/+17
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. r? dep-bumps The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 3 packages to latest compatible versions Updating ipc-channel v0.20.0 -> v0.20.1 Updating rand v0.9.1 -> v0.9.2 Updating redox_syscall v0.5.13 -> v0.5.16 note: pass `--verbose` to see 37 unchanged dependencies behind latest library dependencies: Locking 1 package to latest compatible version Updating rand v0.9.1 -> v0.9.2 note: pass `--verbose` to see 2 unchanged dependencies behind latest rustbook dependencies: Locking 1 package to latest compatible version Updating redox_syscall v0.5.13 -> v0.5.16 ```
2025-07-28feat: Right align line numbersScott Schafer-54/+64