The Rust Programming Language Blog's Avatar

The Rust Programming Language Blog

@blog.rust-lang.org.web.brid.gy

Empowering everyone to build reliable and efficient software. [bridged from https://blog.rust-lang.org/ on the web: https://fed.brid.gy/web/blog.rust-lang.org ]

570 Followers  |  0 Following  |  153 Posts  |  Joined: 01.01.0001  |  4.6973

Latest posts by blog.rust-lang.org.web.brid.gy on Bluesky

Announcing Rust 1.89.0 The Rust team is happy to announce a new version of Rust, 1.89.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.89.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.89.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.89.0 stable ### Explicitly inferred arguments to const generics Rust now supports `_` as an argument to const generic parameters, inferring the value from surrounding context: pub fn all_false<const LEN: usize>() -> [bool; LEN] { [false; _] } Similar to the rules for when `_` is permitted as a type, `_` is not permitted as an argument to const generics when in a signature: // This is not allowed pub const fn all_false<const LEN: usize>() -> [bool; _] { [false; LEN] } // Neither is this pub const ALL_FALSE: [bool; _] = all_false::<10>(); ### Mismatched lifetime syntaxes lint Lifetime elision in function signatures is an ergonomic aspect of the Rust language, but it can also be a stumbling point for newcomers and experts alike. This is especially true when lifetimes are inferred in types where it isn't syntactically obvious that a lifetime is even present: // The returned type `std::slice::Iter` has a lifetime, // but there's no visual indication of that. // // Lifetime elision infers the lifetime of the return // type to be the same as that of `scores`. fn items(scores: &[u8]) -> std::slice::Iter<u8> { scores.iter() } Code like this will now produce a warning by default: warning: hiding a lifetime that's elided elsewhere is confusing --> src/lib.rs:1:18 | 1 | fn items(scores: &[u8]) -> std::slice::Iter<u8> { | ^^^^^ -------------------- the same lifetime is hidden here | | | the lifetime is elided here | = help: the same lifetime is referred to in inconsistent ways, making the signature confusing = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default help: use `'_` for type paths | 1 | fn items(scores: &[u8]) -> std::slice::Iter<'_, u8> { | +++ We first attempted to improve this situation back in 2018 as part of the `rust_2018_idioms` lint group, but strong feedback about the `elided_lifetimes_in_paths` lint showed that it was too blunt of a hammer as it warns about lifetimes which don't matter to understand the function: use std::fmt; struct Greeting; impl fmt::Display for Greeting { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // -----^^^^^^^^^ expected lifetime parameter // Knowing that `Formatter` has a lifetime does not help the programmer "howdy".fmt(f) } } We then realized that the confusion we want to eliminate occurs when both 1. lifetime elision inference rules _connect_ an input lifetime to an output lifetime 2. it's not syntactically obvious that a lifetime exists There are two pieces of Rust syntax that indicate that a lifetime exists: `&` and `'`, with `'` being subdivided into the inferred lifetime `'_` and named lifetimes `'a`. When a type uses a named lifetime, lifetime elision will not infer a lifetime for that type. Using these criteria, we can construct three groups: Self-evident it has a lifetime| Allow lifetime elision to infer a lifetime| Examples ---|---|--- No| Yes| `ContainsLifetime` Yes| Yes| `&T`, `&'_ T`, `ContainsLifetime<'_>` Yes| No| `&'a T`, `ContainsLifetime<'a>` The `mismatched_lifetime_syntaxes` lint checks that the inputs and outputs of a function belong to the same group. For the initial motivating example above, `&[u8]` falls into the second group while `std::slice::Iter<u8>` falls into the first group. We say that the lifetimes in the first group are _hidden_. Because the input and output lifetimes belong to different groups, the lint will warn about this function, reducing confusion about when a value has a meaningful lifetime that isn't visually obvious. The `mismatched_lifetime_syntaxes` lint supersedes the `elided_named_lifetimes` lint, which did something similar for named lifetimes specifically. Future work on the `elided_lifetimes_in_paths` lint intends to split it into more focused sub-lints with an eye to warning about a subset of them eventually. ### More x86 target features The `target_feature` attribute now supports the `sha512`, `sm3`, `sm4`, `kl` and `widekl` target features on x86. Additionally a number of `avx512` intrinsics and target features are also supported on x86: #[target_feature(enable = "avx512bw")] pub fn cool_simd_code(/* .. */) -> /* ... */ { /* ... */ } ### Cross-compiled doctests Doctests will now be tested when running `cargo test --doc --target other_target`, this may result in some amount of breakage due to would-be-failing doctests now being tested. Failing tests can be disabled by annotating the doctest with `ignore-<target>` (docs): /// ```ignore-x86_64 /// panic!("something") /// ``` pub fn my_function() { } ### `i128` and `u128` in `extern "C"` functions `i128` and `u128` no longer trigger the `improper_ctypes_definitions` lint, meaning these types may be used in `extern "C"` functions without warning. This comes with some caveats: * The Rust types are ABI- and layout-compatible with (unsigned) `__int128` in C when the type is available. * On platforms where `__int128` is not available, `i128` and `u128` do not necessarily align with any C type. * `i128` is _not_ necessarily compatible with `_BitInt(128)` on any platform, because `_BitInt(128)` and `__int128` may not have the same ABI (as is the case on x86-64). This is the last bit of follow up to the layout changes from last year: https://blog.rust-lang.org/2024/03/30/i128-layout-update. ### Demoting `x86_64-apple-darwin` to Tier 2 with host tools GitHub will soon discontinue providing free macOS x86_64 runners for public repositories. Apple has also announced their plans for discontinuing support for the x86_64 architecture. In accordance with these changes, the Rust project is in the process of demoting the `x86_64-apple-darwin` target from Tier 1 with host tools to Tier 2 with host tools. This means that the target, including tools like `rustc` and `cargo`, will be guaranteed to build but is not guaranteed to pass our automated test suite. We expect that the RFC for the demotion to Tier 2 with host tools will be accepted between the releases of Rust 1.89 and 1.90, which means that Rust 1.89 will be the last release of Rust where `x86_64-apple-darwin` is a Tier 1 target. For users, this change will not immediately cause impact. Builds of both the standard library and the compiler will still be distributed by the Rust Project for use via `rustup` or alternative installation methods while the target remains at Tier 2. Over time, it's likely that reduced test coverage for this target will cause things to break or fall out of compatibility with no further announcements. ### Standards Compliant C ABI on the `wasm32-unknown-unknown` target `extern "C"` functions on the `wasm32-unknown-unknown` target now have a standards compliant ABI. See this blog post for more information: https://blog.rust-lang.org/2025/04/04/c-abi-changes-for-wasm32-unknown-unknown. ### Platform Support * `x86_64-apple-darwin` is in the process of being demoted to Tier 2 with host tools * Add new Tier-3 targets `loongarch32-unknown-none` and `loongarch32-unknown-none-softfloat` Refer to Rust’s platform support page for more information on Rust’s tiered platform support. ### Stabilized APIs * `NonZero<char>` * Many intrinsics for x86, not enumerated here * AVX512 intrinsics * `SHA512`, `SM3` and `SM4` intrinsics * `File::lock` * `File::lock_shared` * `File::try_lock` * `File::try_lock_shared` * `File::unlock` * `NonNull::from_ref` * `NonNull::from_mut` * `NonNull::without_provenance` * `NonNull::with_exposed_provenance` * `NonNull::expose_provenance` * `OsString::leak` * `PathBuf::leak` * `Result::flatten` * `std::os::linux::net::TcpStreamExt::quickack` * `std::os::linux::net::TcpStreamExt::set_quickack` These previously stable APIs are now stable in const contexts: * `<[T; N]>::as_mut_slice` * `<[u8]>::eq_ignore_ascii_case` * `str::eq_ignore_ascii_case` ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.89.0 Many people came together to create Rust 1.89.0. We couldn't have done it without all of you. Thanks!
07.08.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Project goals update β€” July 2025 The Rust Project is currently working towards a slate of 40 project goals, with 3 of them designated as flagship goals. This post provides selected updates on our progress towards these goals (or, in some cases, lack thereof). The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. This is the final update for the first half of 2025. We're in the process of selecting goals for the second half of the year. Here are the goals that are currently proposed for 2025H2. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** **Why this goal?** This work continues our drive to improve support for async programming in Rust. In 2024H2 we stabilized async closures; explored the generator design space; and began work on the `dynosaur` crate, an experimental proc-macro to provide dynamic dispatch for async functions in traits. In 2025H1 our plan is to deliver (1) improved support for async-fn-in-traits, completely subsuming the functionality of the `async-trait` crate; (2) progress towards sync and async generators, simplifying the creation of iterators and async data streams; (3) and improve the ergonomics of `Pin`, making lower-level async coding more approachable. These items together start to unblock the creation of the next generation of async libraries in the wider ecosystem, as progress there has been blocked on a stable solution for async traits and streams. **H1 Recap from @tmandry:** **What went well** : This cycle we saw significant progress in a few areas: * We had productive conversations with the language team on generators, and landed an experimental implementation for a builtin `iter!` macro that implements unpinned generators. * We shipped async closures and the new lifetime capture rules as part of Rust 2024. * We developed a proc macro, dynosaur, that can be used to support `async fn` together with `dyn Trait`. * We landed an early-stage experiment to support `async Drop` in the compiler. * We landed an experimental implementation of autoreborrowing for pinned references, along with a number of other improvements for pin ergonomics. **What didn't:** In some areas, we didn't make as much progress as we hoped. In retrospect, the scope of this goal was too large for one person to manage. With flagship project goals, there this a desire to paint a grand vision that I think would be better served by another mechanism without a time bound on it. I've been calling this a "north star". In some cases, like RTN, progress has been by technical debt in the Rust compiler's type system. For that there is an ongoing project goal to replace the trait solver with a next-generation version. Finally, on the design front, progress is sometimes slowed by uncertainty and disagreement around the future of pinning in the Rust language. **Looking forward:** My takeaway from this is that in the next project goals cycle, we should focus on answering more fundamental questions of Rust's evolution. These should reduce uncertainty and pave the way for us to unblock major features for async in future cycles. For example, how far we can push pin ergonomics? What approach should we take for in-place initialization, and can it support `async fn` in `dyn Trait`? How will we support evolving trait hierarchies in a general way that allows us to support the Tower "middleware" pattern with `async fn`? I'm excited by the lineup of goals we have for this next cycle. See you on the other side! 2 detailed updates available. Comment by @tmandry posted on 2025-07-17: > dynosaur v0.3 has been released. This release contains some breaking changes in preparation for an upcoming 1.0 release. See the linked release notes for more details. Comment by @tmandry posted on 2025-07-30: > **H1 Recap** > > **What went well** : This cycle we saw significant progress in a few areas: > > * We had productive conversations with the language team on generators, and landed an experimental implementation for a builtin `iter!` macro that implements unpinned generators. > * We shipped async closures and the new lifetime capture rules as part of Rust 2024. > * We developed a proc macro, dynosaur, that can be used to support `async fn` together with `dyn Trait`. > * We landed an early-stage experiment to support `async Drop` in the compiler. > * We landed an experimental implementation of autoreborrowing for pinned references, along with a number of other improvements for pin ergonomics. > > > **What didn't:** In some areas, we didn't make as much progress as we hoped. In retrospect, the scope of this goal was too large for one person to manage. With flagship project goals, there this a desire to paint a grand vision that I think would be better served by another mechanism without a time bound on it. I've been calling this a "north star". > > In some cases, like RTN, progress has been by technical debt in the Rust compiler's type system. For that there is an ongoing project goal to replace the trait solver with a next-generation version. Finally, on the design front, progress is sometimes slowed by uncertainty and disagreement around the future of pinning in the Rust language. > > **Looking forward:** My takeaway from this is that in the next project goals cycle, we should focus on answering more fundamental questions of Rust's evolution. These should reduce uncertainty and pave the way for us to unblock major features for async in future cycles. For example, how far we can push pin ergonomics? What approach should we take for in-place initialization, and can it support `async fn` in `dyn Trait`? How will we support evolving trait hierarchies in a general way that allows us to support the Tower "middleware" pattern with `async fn`? > > I'm excited by the lineup of goals we have for this next cycle. See you on the other side! **Organize Rust All-Hands 2025** **Why this goal?** May 15, 2025 marks the 10-year anniversary of Rust's 1.0 release; it also marks 10 years since the creation of the Rust subteams. At the time there were 6 Rust teams with 24 people in total. There are now 57 teams with 166 people. In-person All Hands meetings are an effective way to help these maintainers get to know one another with high-bandwidth discussions. This year, the Rust Project will be coming together for RustWeek 2025, a joint event organized with RustNL. Participating project teams will use the time to share knowledge, make plans, or just get to know one another better. One particular goal for the All Hands is reviewing a draft of the Rust Vision Doc, a document that aims to take stock of where Rust is and lay out high-level goals for the next few years. **Stabilize tooling needed by Rust for Linux** **Why this goal?** This goal continues our work from 2024H2 in supporting the experimental support for Rust development in the Linux kernel. Whereas in 2024H2 we were focused on stabilizing required language features, our focus in 2025H1 is stabilizing compiler flags and tooling options. We will (1) implement RFC #3716 which lays out a design for ABI-modifying flags; (2) take the first step towards stabilizing `build-std` by creating a stable way to rebuild core with specific compiler options; (3) extending rustdoc, clippy, and the compiler with features that extract metadata for integration into other build systems (in this case, the kernel's build system). **What has happened?** * Ding opened a PR#142518 that implements the in-place initialization experiment. * Ding is working on an experimental implementation (PR#143527) for `arbitrary_self_types`. * Ding opened a PR to Clang (a C frontend for LLVM): Queries on GCC-style inline assembly statements and got it merged. * @ojeda opened two Rust for Linux goals for the next period: * https://github.com/rust-lang/rust-project-goals/pull/347 * https://github.com/rust-lang/rust-project-goals/pull/346 2 detailed updates available. Comment by @tomassedovic posted on 2025-07-07: > ## In-place initialization > > Ding opened a PR#142518 that implements the in-place initialization experiment. > > ## `arbitrary_self_types` > > Ding is working on an experimental implementation (PR#143527). > > ## Queries on GCC-style inline assembly statements: > > Ding opened a PR to Clang (a C frontend for LLVM): https://github.com/llvm/llvm-project/pull/143424 and got it merged. > > This is part of the LLVM/Clang issues the Rust for Linux project needs: https://github.com/Rust-for-Linux/linux/issues/1132. > > ## `-Zindirect-branch-cs-prefix`: > > We've discussed whether this needs to be a separate target feature vs. a modifier on the existing `retpoline` one. Josh argued that since having this enabled without retpoline doesn't make sense, it should be a modifier. On the other hand, Miguel mentioned that it would be clearer on the user's side (easier to map the names from GCC and Clang to `rustc` when they're the same and see that we're enabling the same thing in Rust and Linux kernel's `Makefiles`). > > It seems that `-Cmin-function-alignment` will be another similar case. > > Ultimately, this is a compiler question and should be resolved here: https://github.com/rust-lang/rust/pull/140740 > > The Rust for Linux team was asked to submit a new MCP (Major Change Proposal) for the `-Zindirect-branch-cs-prefix` flag. @ojeda opened it here: https://github.com/rust-lang/compiler-team/issues/899 and it's now been accepted. > > ## Stabilizing `AddressSanitizer` and `LeakSanitizer`: > > * https://github.com/rust-lang/rust/pull/123617 > * https://github.com/rust-lang/rust/pull/142681 > > > In light of the newly-proposed `#[sanitize(xyz = "on|off")]` syntax, we've discussed whether it makes sense to add a shorthand to enable/disable all of them at once (e.g. `#[sanitize(all = "on|off")]`). The experience from the field suggests that this is rarely something people do. > > We've also discussed what values should the options have (e.g. `"yes"`/`"no"` vs. `"on"`/`"off"` or `true`/`false`). No strong preferences, but in case of an error, the compiler should suggest the correct value to use. > > P.S.: There will be a Lang design meeting regarding in-place initialization on Wednesday 2025-07-30: https://github.com/rust-lang/lang-team/issues/332. Comment by @tomassedovic posted on 2025-07-18: > ## 2025H2 Goals > > @ojeda proposed two goals to move the effort forward: one for the language and the other for the compiler. > > * https://github.com/rust-lang/rust-project-goals/pull/347 > * https://github.com/rust-lang/rust-project-goals/pull/346 > > > ## Ongoing work updates > > @dingxiangfei2009 drafted a Pre-RFC for the supertrait-item-in-subtrait-impl work. Need to add two modifications to the RFC to incorporate t-lang requests. ## Goals looking for help **Promoting Parallel Front End** _Help wanted:_ Help test the deadlock code in the issue list and try to reproduce the issue 1 detailed update available. Comment by @SparrowLii posted on 2025-07-11: > * **Key developments:** We bring rustc-rayon in rustc's working tree, the PR that fixes several deadlock issues has been merged. > * **Blockers:** null > * **Help wanted:** Help test the deadlock code in the issue list and try to reproduce the issue > **Stabilize public/private dependencies** _Help wanted:_ this project goal needs a compiler developer to move forward. 3 detailed updates available. Comment by @epage posted on 2025-07-10: > Help wanted: this project goal needs a compiler developer to move forward. Comment by @sladyn98 posted on 2025-07-11: > @epage hey i would like to help contribute with this, if you could probably mentor me in the right direction, i could learn and ramp up and move this forward, i could start with some tasks, scope them out into small bite sized chunks and contribute Comment by @epage posted on 2025-07-11: > This is mostly in the compiler atm and I'm not in a position to mentor or review compiler changes; my first compiler PR is being merged right now. I'm mostly on this from the Cargo side and overall coordination. **Stabilize cargo-script** _Help wanted_ : I'll be working towards verifying rustfmt, rust-analyzer, and other tooling support and will be needing at least reviews from people, if not some mentorship. 1 detailed update available. Comment by @epage posted on 2025-07-10: > Key developments: > > * @epage is shifting attention back to this now that toml v0.9 is out > * `-Zunpretty` support is being added in rust-lang/rust#143708 > > > Blockers > > Help wanted > > * I'll be working towards verifying rustfmt, rust-analyzer, and other tooling support and will be needing at least reviews from people, if not some mentorship. > ## Other goal updates **" Stabilizable" prototype for expanded const generics** 1 detailed update available. Comment by @BoxyUwU posted on 2025-07-25: > Not much to say since the last update- I have been focused on other areas of const generics and I believe camelid has been relatively busy with other things too. I intend for the next const generics project goal to be more broadly scoped than just `min_generic_const_args` so that other const generics work can be given a summary here :) **build-std** * Discussed the latest round of feedback on the pre-RFC, the most significant of which is that the scope of the RFC is almost certainly too large for an MVP. * @davidtwco presented a reformulation of the plan which focuses on the core components of build-std and leaves more features for future extensions after a minimal MVP: * Stage 1a: Introduce manual controls for enabling the build-std behavior in Cargo. * Stage 1b: Introduce Cargo syntax to declare explicit dependencies on core, alloc and std crates. * This stage enables the use of Tier 3 targets on stable Rust and allows the ecosystem to start transitioning to explicit dependencies on the standard library. * This stage would be considered the minimal MVP. * Stage 2: Teach Cargo to build std with different codegen/target modifier options. * This stage allows the standard library to be compiled with custom codegen options. * Stage 3: Enable automatic standard library rebuilds. * This stage focuses on making build-std behave ergonomically and naturally without users having to manually ask for the standard library to be built. * General consensus was reached that this plan feels viable. @davidtwco will write the Stage 1a/b RFC. * Submitted a 2025H2 goal proposal 2 detailed updates available. Comment by @wesleywiser posted on 2025-07-22: > * Updates from our biweekly sync call: > * Discussed the latest round of feedback on the pre-RFC, the most significant of which is that the scope of the RFC is almost certainly too large for an MVP. > * @davidtwco presented a reformulation of the plan which focuses on the core components of build-std and leaves more features for future extensions after a minimal MVP: > * Stage 1a: Introduce manual controls for enabling the build-std behavior in Cargo. > * Stage 1b: Introduce Cargo syntax to declare explicit dependencies on core, alloc and std crates. > * This stage enables the use of Tier 3 targets on stable Rust and allows the ecosystem to start transitioning to explicit dependencies on the standard library. > * This stage would be considered the minimal MVP. > * Stage 2: Teach Cargo to build std with different codegen/target modifier options. > * This stage allows the standard library to be compiled with custom codegen options. > * Stage 3: Enable automatic standard library rebuilds. > * This stage focuses on making build-std behave ergonomically and naturally without users having to manually ask for the standard library to be built. > * General consensus was reached that this plan feels viable. @davidtwco will write the Stage 1a/b RFC. > * Some discussion on various threads from the previous RFC draft. > Comment by @wesleywiser posted on 2025-07-28: > Continuing the build-std work has been submitted as a Project Goal for 2025H2: https://rust-lang.github.io/rust-project-goals/2025h2/build-std.html **Continue resolving `cargo-semver-checks` blockers for merging into cargo** Belated update for May and June: RustWeek was _extremely_ productive! It was great to sit down in a room with all the stakeholders and talk about what it would take to get cross-crate linting working reliably at scale. As a result of this work we identified a lot of previously-unknown blockers, as well as some paths forward. More work remains, but it's nice that we now have a much better idea of what that work should look like. TL;DR: * `?Sized` linting is blocked since it requires additional data in rustdoc JSON. * Currently we get information on the _syntactic_ presence of `?Sized`. But another bound might be implying `Sized`, which makes `?Sized` not true overall. * Failing to account for this would mean we get both false negatives and false positives. This is effectively a dual of the the "implied bounds" issue in the previous post. * Cross-crate linting has had some positive movement, and some additional blockers identified. * docs.rs has begun hosting rustdoc JSON, allowing us to use it as a cache to avoid rebuilding rustdoc JSON in cross-crate linting scenarios where those builds could get expensive. * We need a way to determine which features in dependencies are active (recursively) given a set of features active in the the top crate, so we know how to generate accurate rustdoc JSON. That information is not currently available via the lockfile or any cargo interface. * We need to work with the rustdoc and cargo teams to make it possible to use rmeta files to correctly combine data across crates. This has many moving parts and will take time to get right, but based on in-person conversations at RustWeek we all agreed was the best and most reliable path forward. * Other improvements to `cargo-semver-checks` are ongoing: a full set of `#[target_feature]` lints ships in the next release, and two folks participating in Google Summer of Code have begun contributing to `cargo-semver-checks` already! While the targets for the 2025H1 goals proved a bit too ambitious to hit in this timeline, I'm looking forward to continuing my work on the goal in the 2025H2 period! 1 detailed update available. Comment by @obi1kenobi posted on 2025-07-04: > Belated update for May and June: RustWeek was _extremely_ productive! It was great to sit down in a room with all the stakeholders and talk about what it would take to get cross-crate linting working reliably at scale. > > As a result of this work we identified a lot of previously-unknown blockers, as well as some paths forward. More work remains, but it's nice that we now have a much better idea of what that work should look like. > > TL;DR: > > * `?Sized` linting is blocked since it requires additional data in rustdoc JSON. > * Currently we get information on the _syntactic_ presence of `?Sized`. But another bound might be implying `Sized`, which makes `?Sized` not true overall. > * Failing to account for this would mean we get both false negatives and false positives. This is effectively a dual of the the "implied bounds" issue in the previous post. > * Cross-crate linting has had some positive movement, and some additional blockers identified. > * docs.rs has begun hosting rustdoc JSON, allowing us to use it as a cache to avoid rebuilding rustdoc JSON in cross-crate linting scenarios where those builds could get expensive. > * We need a way to determine which features in dependencies are active (recursively) given a set of features active in the the top crate, so we know how to generate accurate rustdoc JSON. That information is not currently available via the lockfile or any cargo interface. > * We need to work with the rustdoc and cargo teams to make it possible to use rmeta files to correctly combine data across crates. This has many moving parts and will take time to get right, but based on in-person conversations at RustWeek we all agreed was the best and most reliable path forward. > * Other improvements to `cargo-semver-checks` are ongoing: a full set of `#[target_feature]` lints ships in the next release, and two folks participating in Google Summer of Code have begun contributing to `cargo-semver-checks` already! > > > While the targets for the 2025H1 goals proved a bit too ambitious to hit in this timeline, I'm looking forward to continuing my work on the goal in the 2025H2 period! **Declarative ( `macro_rules!`) macro improvements** Current status: * @joshtriplett authored RFCs for both attribute macros and derive macros. * After some further iteration with the lang team, both RFCs were accepted and merged. * @joshtriplett, @eholk, and @vincenzopalazzo did some successful group-spelunking into the implementation of macros in rustc. * @joshtriplett rewrote the `macro_rules!` parser, which enabled future extensibility _and_ resulted in better error messages. This then enabled several follow-up refactors and simplifications. * @joshtriplett wrote a PR implementing attribute macros. 2 detailed updates available. Comment by @joshtriplett posted on 2025-07-21: > Current status: > > * @joshtriplett authored RFCs for both attribute macros and derive macros. Both were accepted and merged. > * @joshtriplett, @eholk, and @vincenzopalazzo did some successful group-spelunking into the implementation of macros in rustc. > * @joshtriplett rewrote the `macro_rules!` parser, which enabled future extensibility _and_ resulted in better error messages. This then enabled several follow-up refactors and simplifications. > * @joshtriplett wrote a PR implementing attribute macros (review in progress). > Comment by @joshtriplett posted on 2025-07-29: > Update: Implementation PR for attribute macros is up. **Evaluate approaches for seamless interop between C++ and Rust** **Recap** by @tmandry: This project goals cycle was important for C++ interop. With the language team we established that we should evolve Rust to enable a first-class C++ interop story, making rich and automatic bindings possible between the two languages. At the Rust All Hands, people from across the industry met to describe their needs to each other, what is working for them, and what isn't. This process of discovery has led to a lot of insight into where we can make progress now and ideas for what it will take to really "solve" interop. One thing I think we can say with certainty is that interop is a vast problem space, and that any two groups who want interop are very likely to have different specific needs. I'm excited about the project goal proposal by @baumanj to begin mapping this problem space out in the open, so that as we refer to problems we can better understand where our needs overlap and diverge. Despite the diversity of needs, we've noticed that there is quite a bit of overlap when it comes to language evolution. This includes many features requested by Rust for Linux, a flagship customer of the Rust Project. In retrospect, this is not surprising: Rust for Linux needs fine-grained interop with C APIs, which is roughly a subset of the needs for interop with C++ APIs. Often the need runs deeper than interop, and is more about supporting patterns in Rust that existing systems languages already support as a first-class feature. I'm looking forward to tackling areas where we can "extend the fundamentals" of Rust in a way that makes these, and other use cases, possible. This includes H2 project goal proposals like pin ergonomics, reborrowing, field projections, and in-place initialization. Thanks to everyone who contributed to the discussions this past cycle. Looking forward to seeing you in the next one! 2 detailed updates available. Comment by @tmandry posted on 2025-07-29: > Ahead of the all hands, @cramertj and @tmandry collaborated on a prototype called ecdysis that explored the viability of instantiating types "on-demand" in the Rust compiler. These types are intended to look like C++ template instantiations. The prototype was a success in that it made the direction look viable and also surfaced some foundational work that needs to happen in the compiler first. That said, continuing to pursue it is not the highest priority for either of us at the moment. > > Many thanks to @oli-obk for their advice and pointers. Comment by @tmandry posted on 2025-07-29: > **Recap** > > This project goals cycle was important for C++ interop. With the language team we established that we should evolve Rust to enable a first-class C++ interop story, making rich and automatic bindings possible between the two languages. At the Rust All Hands, people from across the industry met to describe their needs to each other, what is working for them, and what isn't. This process of discovery has led to a lot of insight into where we can make progress now and ideas for what it will take to really "solve" interop. > > One thing I think we can say with certainty is that interop is a vast problem space, and that any two groups who want interop are very likely to have different specific needs. I'm excited about the project goal proposal by @baumanj to begin mapping this problem space out in the open, so that as we refer to problems we can better understand where our needs overlap and diverge. > > Despite the diversity of needs, we've noticed that there is quite a bit of overlap when it comes to language evolution. This includes many features requested by Rust for Linux, a flagship customer of the Rust Project. In retrospect, this is not surprising: Rust for Linux needs fine-grained interop with C APIs, which is roughly a subset of the needs for interop with C++ APIs. Often the need runs deeper than interop, and is more about supporting patterns in Rust that existing systems languages already support as a first-class feature. > > I'm looking forward to tackling areas where we can "extend the fundamentals" of Rust in a way that makes these, and other use cases, possible. This includes H2 project goal proposals like pin ergonomics, reborrowing, field projections, and in-place initialization. > > Thanks to everyone who contributed to the discussions this past cycle. Looking forward to seeing you in the next one! **Experiment with ergonomic ref-counting** 1 detailed update available. Comment by @spastorino posted on 2025-06-30: > We're currently working on the last-use optimization. We've the liveness analysis needed implemented and we need to extensively test it. **Expose experimental LLVM features for GPU offloading** @ZuseZ4: The last update for this project-goal period! I have continued to work on the gpu support, while our two Rust/LLVM autodiff gsoc students made great progress with their corresponding projects. **Key developments:** 1. My memory-movement PR got reviewed and after a few iterations landed in nightly. That means you now don't even have to build your own rustc to move data to and from a GPU (with the limitations mentioned in my previous post). As part of my PR, I also updated the rustc-dev-guide: https://rustc-dev-guide.rust-lang.org/offload/installation.html. 2. Now that the host (CPU) code landed, I looked into compiling rust kernels to GPUs. When experimenting with the amdgcn target for rustc I noticed a regression, due to which all examples for that target failed. I submitted a small patch to fix it. It landed a few days ago, and prevents rustc from generating f128 types on AMD GPUs: https://github.com/rust-lang/rust/pull/144383. 3. I looked into HIP and OpenMP (managed/kernel-mode) examples to see what's needed to launch the kernels. I should already have most of the code upstream, since it landed as part of my host PR, so I think I should soon be able to add the remaining glue code to start running Rust code on GPUs. https://github.com/rust-lang/rust/pull/142696. 4. The main PR of @KMJ-007 is up, to start generating typetrees for Enzyme, the backend of our std::autodiff module. Enzyme sometimes wants more information about a type than it can get from LLVM, so it either needs to deduce it (slow), or it will fail to compile (bad). In the future we hope to lower MIR information to Enzyme, and this is the first step for it. I just submitted the first round of reviews: https://github.com/rust-lang/rust/pull/142640 5. The main PR of @Sa4dUs is up, it replaces my historically grown middle-end with a proper rustc-autodiff-intrinsic. This allows us to remove a few hacks and thus makes it easier to maintain. It will also handle more corner-cases, and reduces the amount of autodiff related code in rustc by ~400 lines. I also gave it a first review pass. I also submitted an updated project-goal to finish the `std::offload` module, to the point where we can write an interesting amount of kernels in pure (nightly) Rust and launch them to GPUs. All new project goals are supposed to have "champions" from the teams they are related to, which in the case of my autodiff/batching/offload work would be t-compiler and t-lang (see Niko's blog post for more details). Since I joined the compiler team a while ago I can now champion for it myself on the compiler side, and @traviscross volunteered to continue the support on the language side, thank you! 1 detailed update available. Comment by @ZuseZ4 posted on 2025-07-30: > The last update for this project-goal period! I have continued to work on the gpu support, while our two Rust/LLVM autodiff gsoc students made great progress with their corresponding projects. > > **Key developments:** > > 1. My memory-movement PR got reviewed and after a few iterations landed in nightly. That means you can now don't even have to build your own rustc to move data to and from a GPU (with the limitations mentioned in my previous post). As part of my PR, I also updated the rustc-dev-guide: https://rustc-dev-guide.rust-lang.org/offload/installation.html > > 2. Now that the host (CPU) code landed, I looked into compiling rust kernels to GPUs. When experimenting with the amdgcn target for rustc I noticed a regression, due to which all examples for that target failed. I submitted a small patch to fix it. It landed a few days ago, and prevents rustc from generating f128 types on AMD GPUs: https://github.com/rust-lang/rust/pull/144383 > > 3. I looked into HIP and OpenMP (managed/kernel-mode) examples to see what's needed to launch the kernels. I should already have most of the code upstream, since it landed as part of my host PR, so I think I should soon be able to add the remaining glue code to start running Rust code on GPUs. https://github.com/rust-lang/rust/pull/142696. > > 4. The main PR of @KMJ-007 is up, to start generating typetrees for Enzyme, the backend of our std::autodiff module. Enzyme sometimes wants more information about a type than it can get from LLVM, so it either needs to deduce it (slow), or it will fail to compile (bad). In the future we hope to lower MIR information to Enzyme, and this is the first step for it. I just submitted the first round of reviews: https://github.com/rust-lang/rust/pull/142640 > > 5. The main PR of @Sa4dUs is up, it replaces my historically grown middle-end with a proper rustc-autodiff-intrinsic. This allows us to remove a few hacks and thus makes it easier to maintain. It will also handle more corner-cases, and reduces the amount of autodiff related code in rustc by ~400 lines. I also gave it a first review pass. > > > > I also submitted an updated project-goal to finish the `std::offload` module, to the point where we can write an interesting amount of kernels in pure (nightly) Rust and launch them to GPUs. All new project goals are supposed to have "champions" from the teams they are related to, which in the case of my autodiff/batching/offload work would be t-compiler and t-lang (see Niko's blog post for more details). Since I joined the compiler team a while ago I can now champion for it myself on the compiler side, and @traviscross volunteered to continue the support on the language side, thank you! **Extend pubgrub to match cargo 's dependency resolution** 2 detailed updates available. @Eh2406: My time at Amazon is coming to an end. They supported the very successful effort with the 2024h2 goal, and encouraged me to propose the 2025h1 goal that is now wrapping up. Unfortunately other work efforts led to the very limited progress on the 2025h1 goal. I do not know what comes next, but it definitely involves taking time to relax and recover. Recovering involves rediscovering the joy in the work that I love. And, I have a deep passion for this problem. I hope to make some time to work on this. But, relaxing requires reducing the commitments I have made to others and the associated stress. So I will not promise progress, nor will I renew the goal for 2025h2. Comment by @Eh2406 posted on 2025-07-02: > My time at Amazon is coming to an end. They supported the very successful effort with the 2024h2 goal, and encouraged me to propose the 2025h1 goal that is now wrapping up. Unfortunately other work efforts led to the very limited progress on the 2025h1 goal. I do not know what comes next, but it definitely involves taking time to relax and recover. Recovering involves rediscovering the joy in the work that I love. And, I have a deep passion for this problem. I hope to make some time to work on this. But, relaxing requires reducing the commitments I have made to others and the associated stress. So I will not promise progress, nor will I renew the goal for 2025h2. Comment by @tomassedovic posted on 2025-07-25: > Thank you for everything Jacob and good luck! > > As the 2025 H1 period is coming to an end and we're focusing on the goals for the second half of the year, we will close this issue by the end of this month (July 2025). > > If you or someone else out there is working on this and has updates to share, please add them as a comment here by 2025-07-29 so they can be included in the final blog post. > > Even after the issue is closed, the work here _can_ be picked up -- we'll just no longer track it as part of the 2025H1 goals effort. **Externally Implementable Items** **Finish the libtest json output experiment** 2 detailed updates available. Comment by @epage posted on 2025-07-10: > Key developments: > > Blockers > > * Staffing wise, attention was taken by toml v0.9 and now cargo-script > > > Help wanted > > * Help in writing out the end-user API on top of the raw harness > Comment by @epage posted on 2025-07-28: > Key developments: > > * https://github.com/assert-rs/libtest2/pull/94 > * https://github.com/assert-rs/libtest2/pull/99 > * https://github.com/assert-rs/libtest2/pull/100 > **Implement Open API Namespace Support** 1 detailed update available. Comment by @b-naber posted on 2025-07-28: > Chiming in for @epage here since further progress is still blocked on the compiler implementation. Unfortunately things have been moving more slowly than I had initially hoped. We have been doing some refactoring (https://github.com/rust-lang/rust/pull/142547 and https://github.com/rust-lang/rust/pull/144131) that allow us to introduce a new `Scope` for namespaced crates inside name resolution. There's a draft PR (https://github.com/rust-lang/rust/pull/140271) that should be straightforward to adapt to the refactoring. **Implement restrictions, prepare for stabilization** **Improve state machine codegen** **Instrument the Rust standard library with safety contracts** 2 detailed updates available. Comment by @celinval posted on 2025-07-03: > Unfortunately, we didn't make much progress since April except for a very useful discussion during Rust all hands. A few notes can be found here: https://hackmd.io/@qnR1-HVLRx-dekU5dvtvkw/SyUuR6SZgx. We're still waiting for the design discussion meeting with the compiler team. Comment by @celinval posted on 2025-07-25: > @dawidl022 is working as part of GSoC to improve contracts implementation under @tautschnig mentorship. Additionally, @tautschnig and @carolynzech are working on porting contracts from https://github.com/model-checking/verify-rust-std to the Rust repo. **Making compiletest more maintainable: reworking directive handling** **Metrics Initiative** 1 detailed update available. Comment by @yaahc posted on 2025-07-11: > No update for this month beyond the previous finalish update. I still intend to publish the json->influxdb conversion code **Model coherence in a-mir-formality** **Next-generation trait solver** 2 detailed updates available. Comment by @lcnr posted on 2025-07-14: > We - or well, overwhelmingly @compiler-errors - continued to make performance improvements to the new solver over the last month: https://github.com/rust-lang/rust/pull/142802 https://github.com/rust-lang/rust/pull/142732 https://github.com/rust-lang/rust/pull/142317 https://github.com/rust-lang/rust/pull/142316 https://github.com/rust-lang/rust/pull/142223 https://github.com/rust-lang/rust/pull/142090 https://github.com/rust-lang/rust/pull/142088 https://github.com/rust-lang/rust/pull/142085 https://github.com/rust-lang/rust/pull/141927 https://github.com/rust-lang/rust/pull/141581 https://github.com/rust-lang/rust/pull/141451. `nalgebra` is currently 70% slower than with the old solver implementation and we seem to be about 30-50% slower in most _normal_ crates. > > I've been working on strengthening the search graph to avoid the hang in rayon and https://github.com/rust-lang/trait-system-refactor-initiative/issues/210 in a principled way. This has been more challenging than expected and will take at least another week to get done. Comment by @lcnr posted on 2025-07-29: > Since the last update @compiler-errors landed two additional perf optimizations: https://github.com/rust-lang/rust/pull/143500 https://github.com/rust-lang/rust/pull/143309. > > I am still working on the hang in rayon and https://github.com/rust-lang/trait-system-refactor-initiative/issues/210. I've ended up having to change the invariants of the type system to support a fast paths based on structural identity, e.g. quickly proving `T: Trait<'a>` via a `T: Trait<'a>` where-bound, in https://github.com/rust-lang/rust/pull/144405. Changing this invariant requires some additional work in HIR typeck, so I am currently reducing the perf impact of that change. > > With this I can then land the actual fast paths which fix both rayon and similar hangs due to a large number of where-bounds. This should also be done soon. I will then go back to implement the new opaque type handling approach as that's the only remaining issue before we can call for testing. **Nightly support for ergonomic SIMD multiversioning** 1 detailed update available. Comment by @veluca93 posted on 2025-07-10: > Key developments: https://github.com/rust-lang/rust/issues/143352 proposes an experimental feature to investigate an effect-based approach to integrate generics and target features, effectively giving ways to have different monomorphizations of a function have different target features. **Null and enum-discriminant runtime checks in debug builds** 1 detailed update available. Comment by @1c3t3a posted on 2025-07-25: > **Key developments** : Landed the enum discriminant check and enabled it for transmutes to enums for now (this is not so powerful), currently extending it to union reads and pointer reads. > > **Blockers:** question of how to insert a check if we already observe UB (e.g. the enum is only represented by an i1 in LLVM IR). This is to be addressed by the next project goal: https://rust-lang.github.io/rust-project-goals/2025h2/comprehensive-niche-checks.html. **Optimizing Clippy & linting** @blyxyas: **Final monthly update!** * Even more optimizations have been achieved on the documentation lints front. https://github.com/rust-lang/rust-clippy/pull/15030 (-6.7% on `bumpalo`). * The 3rd heaviest function was optimized away by 99.75%, along with the `strlen_on_c_strings` lint. This gives us about a 15% optimization on `tokio`. https://github.com/rust-lang/rust-clippy/pull/15043. * As a minor improvement, we now instantiate a lot less types on `unit_return_expecting_ord` (89% less calls in some benchmarks). This saves us a lot of locks on the type interner. As a final update to the project goal, I'd like to say a little bit more: I'm very happy with how this project goal has turned out. We've seen improvements in the 35-60% range for your real world projects and while I couldn't deliver the two objectives the project goal promised because of an excess in ambition, I still don't think that these are too far-fetched by any means. As some specific examples, you can now witness a **38%** performance improvements in analyzing Cargo, and a **61%** in analyzing Tokio! Much more to come, and thanks for sticking by while we make Clippy a better project, with better developer experience. Have a great week, and I hope that you can enjoy all the performance improvements that we've delivered across this project goal. 1 detailed update available. Comment by @blyxyas posted on 2025-06-27: > **Final monthly update!** > > * Even more optimizations have been achieved on the documentation lints front. https://github.com/rust-lang/rust-clippy/pull/15030. (-6.7% on `bumpalo`). > > * The 3rd heaviest function was optimized away by 99.75%, along with the `strlen_on_c_strings` lint. This gives us about a 15% optimization on `tokio`. https://github.com/rust-lang/rust-clippy/pull/15043 > > * As a minor improvement, we now instantiate a lot less types on `unit_return_expecting_ord` (89% less calls in some benchmarks). This saves us a lot of locks on the type interner. > > > > As a final update to the project goal, I'd like to say a little bit more: > > I'm very happy with how this project goal has turned out. We've seen improvements in the 35-60% range for your real world projects and while I couldn't deliver the two objectives the project goal promised because of an excess in ambition, I still don't think that these are too far-fetched by any means. > > As some specific examples, you can now witness a **38%** performance improvements in analyzing Cargo, and a **61%** in analyzing Tokio! > > Much more to come, and thanks for sticking by while we make Clippy a better project, with better developer experience. Have a great week, and I hope that you can enjoy all the performance improvements that we've delivered across this project goal. **Prepare const traits for stabilization** @oli-obk: The following contributors have made many libcore traits `const`: * @Daniel-Aaron-Bloom * @estebank * @Randl * @SciMind2460 @fee1-dead has also updated the syntax to allow for `const trait Trait {}` declarations instead of `#[const_trait] trait Trait {}`. Thanks y'all for moving this feature along! We have encountered few issues, but there is one major one: without `dyn [const] Trait` support we cannot turn any of the `core::fmt` traits const in a usable way. This in turn makes things like `Result::unwrap` not usable in const contexts without using `const_eval_select` to not actually perform any formatting within const contexts. It is my belief that now would be a good time to call for testing to get community input on the current syntax and behaviour. 2 detailed updates available. Comment by @oli-obk posted on 2025-07-10: > The current proposal is `[const] Trait` syntax for bounds, `impl const Trait for Type` syntax for impls and `const Trait` for trait declarations. No annotations on methods in traits or impls required, but all implied from the trait or impl. > > Re-constification of libstd has commenced Comment by @oli-obk posted on 2025-07-28: > The following contributors have made many libcore traits `const`: > > * @Daniel-Aaron-Bloom > * @estebank > * @Randl > * @SciMind2460 > > > @fee1-dead has also updated the syntax to allow for `const trait Trait {}` declarations instead of `#[const_trait] trait Trait {}`. > > Thanks y'all for moving this feature along! > > We have encountered few issues, but there is one major one: > > without `dyn [const] Trait` support we cannot turn any of the `core::fmt` traits const in a usable way. This in turn makes things like `Result::unwrap` not usable in const contexts without using `const_eval_select` to not actually perform any formatting within const contexts. > > It is my belief that now would be a good time to call for testing to get community input on the current syntax and behaviour. **Prototype a new set of Cargo "plumbing" commands** 2 detailed updates available. Comment by @epage posted on 2025-07-10: > * Key developments: > * GSoC work has started on https://github.com/crate-ci/cargo-plumbing > * `cargo locate-manifest` is merged > * `cargo read-manifest` is merged > * Investigation is on-going for dependency resolution > * Blockers > * Help wanted > Comment by @epage posted on 2025-07-28: > Key developments: > > * https://github.com/crate-ci/cargo-plumbing/pull/50 has been posted > **Publish first rust-lang-owned release of "FLS"** Key Developments: **Goal Complete.** The FLS is now an independent repository within the Rust Project, not relying on imported Ferrocene packages for building (we have brought them in locally). A version of the FLS has been published at https://rust-lang.github.io/fls using the new build process. The content changes were mostly non-normative at this point, but we have officially published the first rust-lang owned release of the FLS. Next steps: Continue adding/modifying appropriate content for the FLS moving forward. Determine any potential H2 2025 spec-related project goals. 1 detailed update available. Comment by @JoelMarcey posted on 2025-06-30: > Key Developments: **Goal Complete.** > > The FLS is now an independent repository within the Rust Project, not relying on imported Ferrocene packages for building (we have brought them in locally). A version of the FLS has been published at https://rust-lang.github.io/fls using the new build process. The content changes were mostly non-normative at this point, but we have officially published the first rust-lang owned release of the FLS. > > Next steps: Continue adding/modifying appropriate content for the FLS moving forward. Determine any potential H2 2025 spec-related project goals. **Publish first version of StableMIR on crates.io** We're almost done with the refactoring thanks again to @makai410 who is part of the GSoC. The `stable_mir` crate is now `rustc_public`. We are now finalizing the infrastructure and working on a compiler MCP. We should be ready to publish version 0.1 in the second half of the year. Thanks to everyone who helped, especially @makai410, who did most of the work. 2 detailed updates available. Comment by @celinval posted on 2025-07-03: > We're almost done with the refactoring thanks again to @makai410 who is part of the GSoC. We are now considering renaming the crate before publishing, if you have any suggestion, please post it in https://rust-lang.zulipchat.com/#narrow/channel/320896-project-stable-mir/topic/Renaming.20StableMIR/with/520505712. > > Finally, we're designing the test and release automation. Comment by @celinval posted on 2025-07-25: > The `stable_mir` crate is now `rustc_public`. We are now finalizing the infrastructure and working on a compiler MCP. We should be ready to publish version 0.1 in the second half of the year. Thanks to everyone who helped, especially @makai410, who did most of the work. **Research: How to achieve safety when linking separately compiled code** **Run the 2025H1 project goal program** **Rust Vision Document** **rustc-perf improvements** We made further progress on the new benchmarking scheme. The side of the website is nearing MVP status, currently we are switching focus on the side of the collector tha truns the benchmarks. Some notable PRs: * Benchmark request queue for try builds and release artifacts (https://github.com/rust-lang/rustc-perf/pull/2166, https://github.com/rust-lang/rustc-perf/pull/2192, https://github.com/rust-lang/rustc-perf/pull/2197, https://github.com/rust-lang/rustc-perf/pull/2201). * Splitting of benchmark requests into benchmark jobs, including backfilling (https://github.com/rust-lang/rustc-perf/pull/2207). * Benchmark sets (https://github.com/rust-lang/rustc-perf/pull/2206). 1 detailed update available. Comment by @Kobzol posted on 2025-07-29: > We made further progress on the new benchmarking scheme. The side of the website is nearing MVP status, currently we are switching focus on the side of the collector tha truns the benchmarks. > > Some notable PRs: > > * Benchmark request queue for try builds and release artifacts (https://github.com/rust-lang/rustc-perf/pull/2166, https://github.com/rust-lang/rustc-perf/pull/2192, https://github.com/rust-lang/rustc-perf/pull/2197, https://github.com/rust-lang/rustc-perf/pull/2201). > * Splitting of benchmark requests into benchmark jobs, including backfilling (https://github.com/rust-lang/rustc-perf/pull/2207). > * Benchmark sets (https://github.com/rust-lang/rustc-perf/pull/2206). > **Scalable Polonius support on nightly** @lqd: Here are the key developments for the month of June, the last of this H1 project goal period. Amanda has been preparing a **couple of papers** on polonius πŸ”₯! As for me, I've continued on the previous threads of work: * the drop-liveness dataflow optimization landed, and I've also changed the bitset used in the loans-in-scope computation to better support the sparser cases with a lot of loans that we see in a handful of benchmarks (and we could tune that cutoff if we wanted to, it's currently around 2K by default in the `MixedBitSet` implementation IIRC). * the rustc-perf benchmarks we have mostly exercise the move/init dataflow parts of borrow-checking, so I've created a stress test that puts emphasis on the loans-in-scope computation in particular, and have started gathering stats on crates.io code to have realistic examples. There are juicy functions in there, where one of the dataflow passes can take 40 seconds. * I reworked the in-tree analysis to what should be close to a "polonius alpha" version of the analysis -- modulo a few loose ends that still need to be fixed -- and did some perf runs and a few crater runs with it enabled by default: nothing exploded. We know that this version based on reachability fixes fewer issues than a full version handling 100% of the flow-sensitivity problem -- like the datalog implementation did, albeit too slowly -- but is _actionable_ and meaningful progress: it fixes many cases of NLL problem 3. We're also reasonably confident that we can make a production-ready version of this alpha algorithm, and in this project goal period we have identified the areas where improvements can be made to gradually improve expressiveness, and that we wish to explore later. * I also discovered a couple of failing examples with the new edition edition 2024 capture rules, and generally need to take care of member constraints, so it's not unexpected. Another small signal to improve test coverage, but not specific to borrowck: it's for all tests and editions in general, as seen in MCP #861. * I've opened PR #143093 to land this polonius alpha analysis, and after looking into fixing member constraints, it should be the behavioral basis of what we hope to stabilize in the future, once it's more suited to production (e.g. better perf, better test coverage, more edge cases analyses, formalism) be it by incremental improvements, or via a different rewritten version of this algorithm -- with modifications to NLLs to make the interactions lazier/on-demand, so that we don't run a more expensive analysis if we don't need to. In the future, hopefully for a h2 project goal, I plan to do that work towards stabilizing this alpha version of the analysis. 1 detailed update available. Comment by @lqd posted on 2025-06-30: > Here are the key developments for the month of June, the last of this H1 project goal period. > > Amanda has been preparing a **couple of papers** on polonius πŸ”₯! > > As for me, I've continued on the previous threads of work: > > * the drop-liveness dataflow optimization landed, and I've also changed the bitset used in the loans-in-scope computation to better support the sparser cases with a lot of loans that we see in a handful of benchmarks (and we could tune that cutoff if we wanted to, it's currently around 2K by default in the `MixedBitSet` implementation IIRC). > * the rustc-perf benchmarks we have mostly exercise the move/init dataflow parts of borrow-checking, so I've created a stress test that puts emphasis on the loans-in-scope computation in particular, and have started gathering stats on crates.io code to have realistic examples. There are juicy functions in there, where one of the dataflow passes can take 40 seconds. > * I reworked the in-tree analysis to what should be close to a "polonius alpha" version of the analysis -- modulo a few loose ends that still need to be fixed -- and did some perf runs and a few crater runs with it enabled by default: nothing exploded. We know that this version based on reachability fixes fewer issues than a full version handling 100% of the flow-sensitivity problem -- like the datalog implementation did, albeit too slowly -- but is _actionable_ and meaningful progress: it fixes many cases of NLL problem 3. We're also reasonably confident that we can make a production-ready version of this alpha algorithm, and in this project goal period we have identified the areas where improvements can be made to gradually improve expressiveness, and that we wish to explore later. > * I also discovered a couple of failing examples with the new edition edition 2024 capture rules, and generally need to take care of member constraints, so it's not unexpected. Another small signal to improve test coverage, but not specific to borrowck: it's for all tests and editions in general, as seen in MCP #861. > * I've opened PR #143093 to land this polonius alpha analysis, and after looking into fixing member constraints, it should be the behavioral basis of what we hope to stabilize in the future, once it's more suited to production (e.g. better perf, better test coverage, more edge cases analyses, formalism) be it by incremental improvements, or via a different rewritten version of this algorithm -- with modifications to NLLs to make the interactions lazier/on-demand, so that we don't run a more expensive analysis if we don't need to. > > > In the future, hopefully for a h2 project goal, I plan to do that work towards stabilizing this alpha version of the analysis. **Secure quorum-based cryptographic verification and mirroring for crates.io** @walterhpearce: Hello All - Following is a status update and breakdown on where things currently stand for the MVP implementation of TUF and the choices we’ve landed at so far with the discussion via this goal. At the end of this update is a briefer list-form of this update. In summary, we have landed at moving forward with a TAP-16 Merkle Tree implementation of TUF for crates.io, with technical choices pending on the best balance and optimization for our specific performance needs. We are still currently on track to have a MVP public implementation by the end of July of this implementation, which optimizations will be tested against. This includes: * Test repositories and tooling for rustup, releases and crates.io * Temporary repository tooling for updates (We are currently outside these services, and so updates occur via periodic checks) * An out-of-band index copy for crates.io for in-line signing testing * cargo-signing subcommand tooling for end-user functionality (TUF updates, validation and downloading) We still have open questions for the specific approach of the Merkle tree, which is continuing into H2. We have also reached an acceptable consensus with the infrastructure team for deployment planning. TUF Implementation During H1, we experimented with 4 implementations of TUF: To-spec, Hashed Bins, Succinct Hashed Bins, and TUF TAP-16 Merkle Trees. Hashed Bins & Succinct Hashed Bins are the current approaches being experimented with in the Python community, and we wanted to see how that would align with our growth and bandwidth requirements. After experimenting, we found the linear growth models to still be unacceptable, thus landing at the Merkle Tree implementation. This still comes at a round-trip increase cost, however, and for H2 we are now experimenting with how to implement the Merkle tree to reduce round-trips - via balancing, implementation details and tree slicing - or a combination of the three.. Quorum & Roles On the higher level grounds of quorums and infrastructure, through discussions, we have come to a consensus on maintaining a top-level quorum, but removing intermediate levels for simplicity. The root quorum shall be the Infrastructure team for initial deployment; roles under this quorum will be nightly, releases, rustup and crates.io; each one of these keys will be a single live key which resides in KMS. We will leverage KMS API’s to perform live signing for all actions of those roles (new releases and crates). The hierarchy initially proposed in the RFC will be removed in favor of this approach. The root quorum will manage the roles via tuf-on-ci on a github repository, while actual signing actions using the live keys will all occur via local tooling in their CI. Choices Made Listed here the choices made as a part of this goal: * Initial root quorum will be the infrastructure team with a 3-member threshold. This can be rotated or grown at any time by that team in the future. * Role keys will live in KMS and be used in the appropriate CI/infrastructure of those teams (Infra for nightly, releases and rustup; the crates.io team for crates). This will be managed via IAM access to the KMS. * TAP-16 Merkle Tree implementation of TUF was chosen. Other methods linear+ growth models were unacceptable. We still have open questions to resolve around bandwidth vs. round-trips * tuf-on-ci will only be used for the root quorum and role changes, to leverage PR-workflows for easy management. * The source-of-truth TUF repository will live in an S3 bucket. * We will rely on cloudtrail for audit logging of KMS and work to make those logs available for transparency Next Steps * A public MVP will go live at the end of July / August, and live changes/tests will be made of the Merkle tree implementation there. * We still need to determine the appropriate trade off for round trips vs. bandwidth for the Merkle Tree. We are collecting more granular logs from the sparse index and crates.io index as a whole to accomplish this. Crate downloads vs. updates are very unbalanced, and we expect to get significant reductions of both by appropriately balancing the tree. * Work needs to start on beginning to stand up infrastructure in the project to house this in the simpleinfra repository. Besides the raw infrastructure, this needs to be tooling for the initial creation ceremony. * We’ve begun thinking about what different mirroring strategies look like when utilizing TUF, to make sure we consider those when deploying this. The MVP provides basic validation of any mirror, but how can mirroring and fallbacks possibly be integrated? 1 detailed update available. Comment by @walterhpearce posted on 2025-07-29: > Hello All - > > Following is a status update and breakdown on where things currently stand for the MVP implementation of TUF and the choices we’ve landed at so far with the discussion via this goal. At the end of this update is a briefer list-form of this update. > > In summary, we have landed at moving forward with a TAP-16 Merkle Tree implementation of TUF for crates.io, with technical choices pending on the best balance and optimization for our specific performance needs. We are still currently on track to have a MVP public implementation by the end of July of this implementation, which optimizations will be tested against. This includes: > > * Test repositories and tooling for rustup, releases and crates.io > * Temporary repository tooling for updates (We are currently outside these services, and so updates occur via periodic checks) > * An out-of-band index copy for crates.io for in-line signing testing > * cargo-signing subcommand tooling for end-user functionality (TUF updates, validation and downloading) > > > We still have open questions for the specific approach of the Merkle tree, which is continuing into H2. We have also reached an acceptable consensus with the infrastructure team for deployment planning. > > TUF Implementation > > During H1, we experimented with 4 implementations of TUF: To-spec, Hashed Bins, Succinct Hashed Bins, and TUF TAP-16 Merkle Trees. Hashed Bins & Succinct Hashed Bins are the current approaches being experimented with in the Python community, and we wanted to see how that would align with our growth and bandwidth requirements. After experimenting, we found the linear growth models to still be unacceptable, thus landing at the Merkle Tree implementation. This still comes at a round-trip increase cost, however, and for H2 we are now experimenting with how to implement the Merkle tree to reduce round-trips - via balancing, implementation details and tree slicing - or a combination of the three.. > > Quorum & Roles > > On the higher level grounds of quorums and infrastructure, through discussions, we have come to a consensus on maintaining a top-level quorum, but removing intermediate levels for simplicity. The root quorum shall be the Infrastructure team for initial deployment; roles under this quorum will be nightly, releases, rustup and crates.io; each one of these keys will be a single live key which resides in KMS. We will leverage KMS API’s to perform live signing for all actions of those roles (new releases and crates). The hierarchy initially proposed in the RFC will be removed in favor of this approach. > > The root quorum will manage the roles via tuf-on-ci on a github repository, while actual signing actions using the live keys will all occur via local tooling in their CI. > > Choices Made > > Listed here the choices made as a part of this goal: > > * Initial root quorum will be the infrastructure team with a 3-member threshold. This can be rotated or grown at any time by that team in the future. > * Role keys will live in KMS and be used in the appropriate CI/infrastructure of those teams (Infra for nightly, releases and rustup; the crates.io team for crates). This will be managed via IAM access to the KMS. > * TAP-16 Merkle Tree implementation of TUF was chosen. Other methods linear+ growth models were unacceptable. We still have open questions to resolve around bandwidth vs. round-trips > * tuf-on-ci will only be used for the root quorum and role changes, to leverage PR-workflows for easy management. > * The source-of-truth TUF repository will live in an S3 bucket. > * We will rely on cloudtrail for audit logging of KMS and work to make those logs available for transparency > > > Next Steps > > * A public MVP will go live at the end of July / August, and live changes/tests will be made of the Merkle tree implementation there. > * We still need to determine the appropriate trade off for round trips vs. bandwidth for the Merkle Tree. We are collecting more granular logs from the sparse index and crates.io index as a whole to accomplish this. Crate downloads vs. updates are very unbalanced, and we expect to get significant reductions of both by appropriately balancing the tree. > * Work needs to start on beginning to stand up infrastructure in the project to house this in the simpleinfra repository. Besides the raw infrastructure, this needs to be tooling for the initial creation ceremony. > * We’ve begun thinking about what different mirroring strategies look like when utilizing TUF, to make sure we consider those when deploying this. The MVP provides basic validation of any mirror, but how can mirroring and fallbacks possibly be integrated? > **SVE and SME on AArch64** @davidtwco: * rust-lang/rust#137944 got merged with Part I of the Sized Hierarchy work * A bug was discovered through fuzzing when the feature was enabled, users could write `dyn PointeeSized` which would trigger the builtin impl for `PointeeSized`, which doesn't exist. rust-lang/rust#143104 was merged to fix that. * In attempt to experiment with relaxing `Deref::Target`, we discovered that sizedness supertraits weren't being elaborated from where bounds on projections. * Adding those bounds meant that there could be two candidates for some obligations - from a where bound and from an item bound - where previously there would only be the item bound. Where bounds take priority and this could result in regions being equated that did not previously. * By fixing that, we ran into issues with normalisation that was happening which restricted what code using GATs was accepted. Fixing this got everything passing but more code is accepted. * rust-lang/rust#142712 has this fixed, but isn't yet merged as it's quite involved. * I've still not made any changes to the Sized Hierarchy RFC, there's a small amount of discussion which will be responded to once the implementation has landed. * While implementing Part II of the Sized Hierarchy work, we ran into limitations of the old solver w/r/t host effect predicates around coinductive cycles. We've put that aside until there's nothing else to do or the new solver is ready. * We've been reviving the RFC and implementation of the SVE infrastructure, relying on some exceptions because of not having const sizedness yet, but knowing that we've got a solution for that coming, we're hoping to see this merged as an experiment once it is ready. * We've opened rust-lang/rust#144404 that documents the current status of the Sized Hierarchy feature and our plans for it. * As before, implementing const sizedness is on hold until the next solver is ready or there's nothing else to do. * We've opened rust-lang/rust#144064 with the interesting parts of rust-lang/rust#142712 from a t-types perspective, that's currently waiting on FCP checkboxes. * This will enable experimentation with relaxing `Deref::Target` to `PointeeSized`. * We've opened rust-lang/rfcs#3838 and rust-lang/rust#143924 updating rust-lang/rfcs#3268 and rust-lang/rust#118917 respectively. * There's been lots of useful feedback on this that we're working on addressing and will have an update soon 2 detailed updates available. Comment by @davidtwco posted on 2025-07-11: > * rust-lang/rust#137944 got merged with Part I of the Sized Hierarchy work > * A bug was discovered through fuzzing when the feature was enabled, users could write `dyn PointeeSized` which would trigger the builtin impl for `PointeeSized`, which doesn't exist. rust-lang/rust#143104 was merged to fix that. > * In attempt to experiment with relaxing `Deref::Target`, we discovered that sizedness supertraits weren't being elaborated from where bounds on projections. > * Adding those bounds meant that there could be two candidates for some obligations - from a where bound and from an item bound - where previously there would only be the item bound. Where bounds take priority and this could result in regions being equated that did not previously. > * By fixing that, we ran into issues with normalisation that was happening which restricted what code using GATs was accepted. Fixing this got everything passing but more code is accepted. > * rust-lang/rust#142712 has this fixed, but isn't yet merged as it's quite involved. > * I've still not made any changes to the Sized Hierarchy RFC, there's a small amount of discussion which will be responded to once the implementation has landed. > * While implementing Part II of the Sized Hierarchy work, we ran into limitations of the old solver w/r/t host effect predicates around coinductive cycles. We've put that aside until there's nothing else to do or the new solver is ready. > * We've been reviving the RFC and implementation of the SVE infrastructure, relying on some exceptions because of not having const sizedness yet, but knowing that we've got a solution for that coming, we're hoping to see this merged as an experiment once it is ready. > Comment by @davidtwco posted on 2025-07-29: > * We've opened rust-lang/rust#144404 that documents the current status of the Sized Hierarchy feature and our plans for it. > * As before, implementing const sizedness is on hold until the next solver is ready or there's nothing else to do. > * We've opened rust-lang/rust#144064 with the interesting parts of rust-lang/rust#142712 from a t-types perspective, that's currently waiting on FCP checkboxes. > * This will enable experimentation with relaxing `Deref::Target` to `PointeeSized`. > * We've opened rust-lang/rfcs#3838 and rust-lang/rust#143924 updating rust-lang/rfcs#3268 and rust-lang/rust#118917 respectively. > * There's been lots of useful feedback on this that we're working on addressing and will have an update soon > **Unsafe Fields** **Use annotate-snippets for rustc diagnostic output** 1 detailed update available. Comment by @Muscraft posted on 2025-07-10: > Key developments > > * The new API for `annotate-snippets` got merged (and tweaked) > * `annotate-snippets` passed all of `rustc`'s UI tests for the first time > * I started getting `annotate-snippets` ready for release > * I started opening PRs to get `rustc` to match `annotate-snippets` planned output changes > > > Blockers > > Help wanted
05.08.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
crates.io: development update Since our last development update in February 2025, we have continued to make significant improvements to crates.io. In this blog post, we want to give you an update on the latest changes that we have made to crates.io over the past few months. ## Trusted Publishing We are excited to announce that we have implemented "Trusted Publishing" support on crates.io, as described in RFC #3691. This feature was inspired by the PyPI team's excellent work in this area, and we want to thank them for the inspiration! Trusted Publishing eliminates the need for GitHub Actions secrets when publishing crates from your CI/CD pipeline. Instead of managing API tokens, you can now configure which GitHub repository you trust directly on crates.io. That repository is then allowed to request a short-lived API token for publishing in a secure way using OpenID Connect (OIDC). While Trusted Publishing is currently limited to GitHub Actions, we have built it in a way that allows other CI/CD providers like GitLab CI to be supported in the future. To get started with Trusted Publishing, you'll need to publish your first release manually. After that, you can set up trusted publishing for future releases. The detailed documentation is available at https://crates.io/docs/trusted-publishing. Here's an example of how to set up GitHub Actions to use Trusted Publishing: name: Publish to crates.io on: push: tags: ['v*'] # Triggers when pushing tags starting with 'v' jobs: publish: runs-on: ubuntu-latest environment: release # Optional: for enhanced security permissions: id-token: write # Required for OIDC token exchange steps: - uses: actions/checkout@v4 - uses: rust-lang/crates-io-auth-action@v1 id: auth - run: cargo publish env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} ## OpenGraph Images Previously, crates.io used a single OpenGraph image for all pages. We have now implemented dynamic OpenGraph image generation, where each crate has a dedicated image that is regenerated when new versions are published. These images include the crate name, keywords, description, latest version (or rather the default version that we show for the crate), number of releases, license, and crate size. This provides much more useful information when crates.io links are shared on social media platforms or in chat applications. The image generation has been extracted to a dedicated crate: crates_io_og_image (GitHub). We're also adding basic theming support in PR #3 to allow docs.rs to reuse the code for their own OpenGraph images. Under the hood, the image generation uses two other excellent Rust projects: Typst for layout and text rendering, and oxipng for PNG optimization. ## docs.rs rebuilds Crate owners can now trigger documentation rebuilds for docs.rs directly from the crate's version list on crates.io. This can be useful when docs.rs builds have failed or when you want to take advantage of new docs.rs features without having to publish a new release just for that. We would like to thank our crates.io team member @eth3lbert for implementing the initial version of this feature in PR #11422. ## README alert support We've added support for rendering GitHub-style alerts in README files. This feature allows crate authors to use alert blocks like `> [!NOTE]`, `> [!WARNING]`, and `> [!CAUTION]` in their README markdown, which will now be properly styled and displayed on crates.io. This enhancement was also implemented by @eth3lbert in PR #11441, building on initial work by @kbdharun. ## Miscellaneous These were some of the more visible changes to crates.io over the past couple of months, but a lot has happened "under the hood" as well. Here are a couple of examples: ### Email system refactoring Previously, we used the `format!()` macro and string concatenation to create emails, which made them hard to maintain and inconsistent in styling. We have migrated to the minijinja crate and now use templates instead. The new system includes a template inheritance system for consistent branding across all emails. This change also enables us to support HTML emails in the future. ### SemVer sorting optimization Previously, we had to load all versions from the database and sort them by SemVer on the API server, which was inefficient for crates with many versions. Our PostgreSQL provider did not support the semver extension, so we had to implement sorting in application code. PR #10763 takes advantage of JSONB support in PostgreSQL and their btree ordering specification to implement SemVer sorting on the database side. This reduces the load on our API servers and improves response times for crates with many versions. ## Feedback We hope you enjoyed this update on the development of crates.io. If you have any feedback or questions, please let us know on Zulip or GitHub. We are always happy to hear from you and are looking forward to your feedback!
11.07.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Stabilizing naked functions Rust 1.88.0 stabilizes the `#[unsafe(naked)]` attribute and the `naked_asm!` macro which are used to define naked functions. A naked function is marked with the `#[unsafe(naked)]` attribute, and its body consists of a single `naked_asm!` call. For example: /// SAFETY: Respects the 64-bit System-V ABI. #[unsafe(naked)] pub extern "sysv64" fn wrapping_add(a: u64, b: u64) -> u64 { // Equivalent to `a.wrapping_add(b)`. core::arch::naked_asm!( "lea rax, [rdi + rsi]", "ret" ); } What makes naked functions special β€” and gives them their name β€” is that the handwritten assembly block defines the _entire_ function body. Unlike non-naked functions, the compiler does not add any special handling for arguments or return values. This feature is a more ergonomic alternative to defining functions using `global_asm!`. Naked functions are used in low-level settings like Rust's `compiler-builtins`, operating systems, and embedded applications. ## Why use naked functions? But wait, if naked functions are just syntactic sugar for `global_asm!`, why add them in the first place? To see the benefits, let's rewrite the `wrapping_add` example from the introduction using `global_asm!`: // SAFETY: `wrapping_add` is defined in this module, // and expects the 64-bit System-V ABI. unsafe extern "sysv64" { safe fn wrapping_add(a: u64, b: u64) -> u64 } core::arch::global_asm!( r#" // Platform-specific directives that set up a function. .section .text.wrapping_add,"ax",@progbits .p2align 2 .globl wrapping_add .type wrapping_add,@function wrapping_add: lea rax, [rdi + rsi] ret .Ltmp0: .size wrapping_add, .Ltmp0-wrapping_add "# ); The assembly block starts and ends with the directives (`.section`, `.p2align`, etc.) that are required to define a function. These directives are mechanical, but they are different between object file formats. A naked function will automatically emit the right directives. Next, the `wrapping_add` name is hardcoded, and will not participate in Rust's name mangling. That makes it harder to write cross-platform code, because different targets have different name mangling schemes (e.g. x86_64 macOS prefixes symbols with `_`, but Linux does not). The unmangled symbol is also globally visible β€” so that the `extern` block can find it β€” which can cause symbol resolution conflicts. A naked function's name does participate in name mangling and won't run into these issues. A further limitation that this example does not show is that functions defined using global assembly cannot use generics. Especially const generics are useful in combination with assembly. Finally, having just one definition provides a consistent place for (safety) documentation and attributes, with less risk of them getting out of date. Proper safety comments are essential for naked functions. The `naked` attribute is unsafe because the ABI (`sysv64` in our example), the signature, and the implementation have to be consistent. ## How did we get here? Naked functions have been in the works for a long time. The original RFC for naked functions is from 2015. That RFC was superseded by RFC 2972 in 2020. Inline assembly in Rust had changed substantially at that point, and the new RFC limited the body of naked functions to a single `asm!` call with some additional constraints. And now, 10 years after the initial proposal, naked functions are stable. Two additional notable changes helped prepare naked functions for stabilization: ##### Introduction of the `naked_asm!` macro The body of a naked function must be a single `naked_asm!` call. This macro is a blend between `asm!` (it is in a function body) and `global_asm!` (only some operand types are accepted). The initial implementation of RFC 2972 added lints onto a standard `asm!` call in a naked function. This approach made it hard to write clear error messages and documentation. With the dedicated `naked_asm!` macro the behavior is much easier to specify. ##### Lowering to `global_asm!` The initial implementation relied on LLVM to lower functions with the `naked` attribute for code generation. This approach had two issues: * LLVM would sometimes add unexpected additional instructions to what the user wrote. * Rust has non-LLVM code generation backends now, and they would have had to implement LLVM's (unspecified!) behavior. The implementation that is stabilized now instead converts the naked function into a piece of global assembly. The code generation backends can already emit global assembly, and this strategy guarantees that the whole body of the function is just the instructions that the user wrote. ## What's next for assembly? We're working on further assembly ergonomics improvements. If naked functions are something you are excited about and (may) use, we'd appreciate you testing these new features and providing feedback on their designs. ##### `extern "custom"` functions Naked functions usually get the `extern "C"` calling convention. But often that calling convention is a lie. In many cases, naked functions don't implement an ABI that Rust knows about. Instead they use some custom calling convention that is specific to that function. The `abi_custom` feature adds `extern "custom"` functions and blocks, which allows us to correctly write code like this example from compiler-builtins: #![feature(abi_custom)] /// Division and modulo of two numbers using Arm's nonstandard ABI. /// /// ```c /// typedef struct { int quot; int rem; } idiv_return; /// __value_in_regs idiv_return __aeabi_idivmod(int num, int denom); /// ``` // SAFETY: The assembly implements the expected ABI, and "custom" // ensures this function cannot be called directly. #[unsafe(naked)] pub unsafe extern "custom" fn __aeabi_idivmod() { core::arch::naked_asm!( "push {{r0, r1, r4, lr}}", // Back up clobbers. "bl {trampoline}", // Call an `extern "C"` function for a / b. "pop {{r1, r2}}", "muls r2, r2, r0", // Perform the modulo. "subs r1, r1, r2", "pop {{r4, pc}}", // Restore clobbers, implicit return by setting `pc`. trampoline = sym crate::arm::__aeabi_idiv, ); } A consequence of using a custom calling convention is that such functions cannot be called using a Rust call expression; the compiler simply does not know how to generate correct code for such a call. Instead the compiler will error when the program does try to call an `extern "custom"` function, and the only way to execute the function is using inline assembly. ##### `cfg` on lines of inline assembly The `cfg_asm` feature adds the ability to annotate individual lines of an assembly block with `#[cfg(...)]` or `#[cfg_attr(..., ...)]`. Configuring specific sections of assembly is useful to make assembly depend on, for instance, the target, target features, or feature flags. For example: #![feature(cfg_asm)] global_asm!( // ... // If enabled, initialise the SP. This is normally // initialised by the CPU itself or by a bootloader, but // some debuggers fail to set it when resetting the // target, leading to stack corruptions. #[cfg(feature = "set-sp")] "ldr r0, =_stack_start msr msp, r0", // ... ) This example is from the cortex-m crate that currently has to use a custom macro that duplicates the whole assembly block for every use of `#[cfg(...)]`. With `cfg_asm`, that will no longer be necessary.
03.07.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.88.0 The Rust team is happy to announce a new version of Rust, 1.88.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.88.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.88.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.88.0 stable ### Let chains This feature allows `&&`-chaining `let` statements inside `if` and `while` conditions, even intermingling with boolean expressions, so there is less distinction between `if`/`if let` and `while`/`while let`. The patterns inside the `let` sub-expressions can be irrefutable or refutable, and bindings are usable in later parts of the chain as well as the body. For example, this snippet combines multiple conditions which would have required nesting `if let` and `if` blocks before: if let Channel::Stable(v) = release_info() && let Semver { major, minor, .. } = v && major == 1 && minor == 88 { println!("`let_chains` was stabilized in this version"); } Let chains are only available in the Rust 2024 edition, as this feature depends on the `if let` temporary scope change for more consistent drop order. Earlier efforts tried to work with all editions, but some difficult edge cases threatened the integrity of the implementation. 2024 made it feasible, so please upgrade your crate's edition if you'd like to use this feature! ### Naked functions Rust now supports writing naked functions with no compiler-generated epilogue and prologue, allowing full control over the generated assembly for a particular function. This is a more ergonomic alternative to defining functions in a `global_asm!` block. A naked function is marked with the `#[unsafe(naked)]` attribute, and its body consists of a single `naked_asm!` call. For example: #[unsafe(naked)] pub unsafe extern "sysv64" fn wrapping_add(a: u64, b: u64) -> u64 { // Equivalent to `a.wrapping_add(b)`. core::arch::naked_asm!( "lea rax, [rdi + rsi]", "ret" ); } The handwritten assembly block defines the _entire_ function body: unlike non-naked functions, the compiler does not add any special handling for arguments or return values. Naked functions are used in low-level settings like Rust's `compiler-builtins`, operating systems, and embedded applications. Look for a more detailed post on this soon! ### Boolean configuration The `cfg` predicate language now supports boolean literals, `true` and `false`, acting as a configuration that is always enabled or disabled, respectively. This works in Rust conditional compilation with `cfg` and `cfg_attr` attributes and the built-in `cfg!` macro, and also in Cargo `target]` tables in both configuration and [manifests. Previously, empty predicate lists could be used for unconditional configuration, like `cfg(all())` for enabled and `cfg(any())` for disabled, but this meaning is rather implicit and easy to get backwards. `cfg(true)` and `cfg(false)` offer a more direct way to say what you mean. See RFC 3695 for more background! ### Cargo automatic cache cleaning Starting in 1.88.0, Cargo will automatically run garbage collection on the cache in its home directory! When building, Cargo downloads and caches crates needed as dependencies. Historically, these downloaded files would never be cleaned up, leading to an unbounded amount of disk usage in Cargo's home directory. In this version, Cargo introduces a garbage collection mechanism to automatically clean up old files (e.g. `.crate` files). Cargo will remove files downloaded from the network if not accessed in 3 months, and files obtained from the local system if not accessed in 1 month. Note that this automatic garbage collection will not take place if running offline (using `--offline` or `--frozen`). Cargo 1.78 and newer track the access information needed for this garbage collection. This was introduced well before the actual cleanup that's starting now, in order to reduce cache churn for those that still use prior versions. If you regularly use versions of Cargo even older than 1.78, in addition to running current versions of Cargo, and you expect to have some crates accessed exclusively by the older versions of Cargo and don't want to re-download those crates every ~3 months, you may wish to set `cache.auto-clean-frequency = "never"` in the Cargo configuration, as described in the docs. For more information, see the original unstable announcement of this feature. Some parts of that design remain unstable, like the `gc` subcommand tracked in cargo#13060, so there's still more to look forward to! ### Stabilized APIs * `Cell::update` * `impl Default for *const T` * `impl Default for *mut T` * `mod ffi::c_str` * `HashMap::extract_if` * `HashSet::extract_if` * `hint::select_unpredictable` * `proc_macro::Span::line` * `proc_macro::Span::column` * `proc_macro::Span::start` * `proc_macro::Span::end` * `proc_macro::Span::file` * `proc_macro::Span::local_file` * `<[T]>::as_chunks` * `<[T]>::as_rchunks` * `<[T]>::as_chunks_unchecked` * `<[T]>::as_chunks_mut` * `<[T]>::as_rchunks_mut` * `<[T]>::as_chunks_unchecked_mut` These previously stable APIs are now stable in const contexts: * `NonNull<T>::replace` * `<*mut T>::replace` * `std::ptr::swap_nonoverlapping` * `Cell::replace` * `Cell::get` * `Cell::get_mut` * `Cell::from_mut` * `Cell::as_slice_of_cells` ### Other changes The `i686-pc-windows-gnu` target has been demoted to Tier 2, as mentioned in an earlier post. This won't have any immediate effect for users, since both the compiler and standard library tools will still be distributed by `rustup` for this target. However, with less testing than it had at Tier 1, it has more chance of accumulating bugs in the future. Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.88.0 Many people came together to create Rust 1.88.0. We couldn't have done it without all of you. Thanks!
26.06.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
May Project Goals Update The Rust project is currently working towards a slate of 40 project goals, with 3 of them designated as Flagship Goals. This post provides selected updates on our progress towards these goals (or, in some cases, lack thereof). The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** **Why this goal?** This work continues our drive to improve support for async programming in Rust. In 2024H2 we stabilized async closures; explored the generator design space; and began work on the `dynosaur` crate, an experimental proc-macro to provide dynamic dispatch for async functions in traits. In 2025H1 our plan is to deliver (1) improved support for async-fn-in-traits, completely subsuming the functionality of the `async-trait` crate; (2) progress towards sync and async generators, simplifying the creation of iterators and async data streams; (3) and improve the ergonomics of `Pin`, making lower-level async coding more approachable. These items together start to unblock the creation of the next generation of async libraries in the wider ecosystem, as progress there has been blocked on a stable solution for async traits and streams. **What has happened?** **Generators.** Experimental support for an `iter!` macro has landed in nightly. This is intended for nightly-only experimentation and will still need an RFC before it can stabilize. Tracking issue is rust-lang/rust#142269. **Async book.** @nrc has been hard at work filling out the official Async Rust book, recently adding chapters on concurrency primitives, structured concurrency, and pinning. **dynosaur.** A dynosaur RFC was opened describing what blanket impls we think the proc macro should generate for a trait, to make the trait usable as `impl Trait` in argument position in other traits. This is the last remaining open design question before we release dynosaur 0.3 as a candidate for 1.0. Please chime in on the RFC if you have thoughts. 1 detailed update available. Comment by @tmandry posted on 2025-06-09: > **Generators.** Experimental support for an `iter!` macro has landed in nightly. This is intended for nightly-only experimentation and will still need an RFC before it can stabilize. Tracking issue is rust-lang/rust#142269. > > **Async book.** @nrc has been hard at work filling out the official Async Rust book, recently adding chapters on concurrency primitives, structured concurrency, and pinning. > > **dynosaur.** A dynosaur RFC was opened describing what blanket impls we think the proc macro should generate for a trait, to make the trait usable as `impl Trait` in argument position in other traits. This is the last remaining open design question before we release dynosaur 0.3 as a candidate for 1.0. Please chime in on the RFC if you have thoughts. **Organize Rust All-Hands 2025** **Why this goal?** May 15, 2025 marks the 10-year anniversary of Rust's 1.0 release; it also marks 10 years since the creation of the Rust subteams. At the time there were 6 Rust teams with 24 people in total. There are now 57 teams with 166 people. In-person All Hands meetings are an effective way to help these maintainers get to know one another with high-bandwidth discussions. This year, the Rust project will be coming together for RustWeek 2025, a joint event organized with RustNL. Participating project teams will use the time to share knowledge, make plans, or just get to know one another better. One particular goal for the All Hands is reviewing a draft of the Rust Vision Doc, a document that aims to take stock of where Rust is and lay out high-level goals for the next few years. **What has happened?** The **All-Hands** did! More than 150 project members and invited guests attended, making this the largest in-person collaborative event in the history of the Rust project. We celebrated the 10 year birthday of Rust 1.0. With over 300 people, we celebrated, listened to speeches from various former and current team members and contributors, and watched the live release of Rust 1.87.0 on stage. The feedback from the participants was overwhelmingly positive with an average score of 9.5/10. πŸŽ‰ The vast majority would like this to be a yearly event -- which Mara started working on. 1 detailed update available. Comment by @m-ou-se posted on 2025-06-19: > Update! > > The all-hands has happened! > > More than 150 project members and invited guests attended, making this the largest in-person collaborative event in the history of the Rust project. > > On Wednesday, several Rust project members gave talks to other project members and (potential) contributors, as part of the "Rust Project Track" at the RustWeek conference. The recordings are available on YouTube. πŸ“Ή > > On Thursday, we celebrated the 10 year birthday of Rust 1.0. With over 300 people, we celebrated, listened to speeches from various former and current team members and contributors, and watched the live release of Rust 1.87.0 on stage. > > On Friday and Saturday, the actual Rust All-Hands 2025 took place. For two full days spread over 10 different meeting rooms, both pre-planned and ad-hoc discussions took place on a very wide range of topics. Meeting notes have been collected in this Zulip topic: #all-hands-2025 > Meeting notes! > > Many many long standing issues have been unblocked. Many new ideas were discussed, both small and big. Conflicts were resolved. Plans were made. And many personal connections were formed and improved. ❀ > > I've collected feedback from the participants (67 of you replied so far), and the replies where overwhelmingly positive with an average score of 9.5/10. πŸŽ‰ The vast majority would like this to be a yearly event. I've started working on making that happen! > > Thank you all for attending! See you all next year! 🎊 **Stabilize tooling needed by Rust for Linux** **Why this goal?** This goal continues our work from 2024H2 in supporting the experimental support for Rust development in the Linux kernel. Whereas in 2024H2 we were focused on stabilizing required language features, our focus in 2025H1 is stabilizing compiler flags and tooling options. We will (1) implement RFC #3716 which lays out a design for ABI-modifying flags; (2) take the first step towards stabilizing `build-std` by creating a stable way to rebuild core with specific compiler options; (3) extending rustdoc, clippy, and the compiler with features that extract metadata for integration into other build systems (in this case, the kernel's build system). **What has happened?** May saw significant progress on compiler flags, with MCPs for `-Zharden-sls` and `-Zretpoline*` being accepted. Several PRs were in progress (#135927, #140733, #140740) that could potentially be combined, with the implementation approach matching clang's flag naming conventions for consistency. The RFC for configuring no-std externally #3791 entered T-compiler FCP with positive signals, and build-std discussions at the All Hands produced some consensus between libs and compiler teams, though more Cargo team involvement was needed. The Rust for Linux team had strong participation at Rust Week, with many team members attending (Alice, Benno, BjΓΆrn, Boqun, Gary, Miguel, Trevor). During the All Hands, attendees participated in a fun exercise predicting what percentage of the kernel will be written in Rust by 2035 - currently only about 0.1% of the kernel's 40M total lines are in Rust. On language features, during May we continued work on arbitrary self types v2, where Ding focused on resolving the dichotomy between `Deref::Target` vs `Receiver::Target`. One potential approach discussed was splitting the feature gate to allow arbitrary self types only for types implementing `Deref`, which would cover the kernel use case. For `derive(CoercePointee)`, we continued waiting on PRs #136764 and #136776, with the latter needing diagnostic work. The All Hands meeting also produced interesting developments on field projections, with Benno working on an approach that reuses borrow checker logic to extend what we do for `&` and `&mut` to custom types using the `->` syntax. Alice also presented a new proposal for AFIDT/RPITIDT and placement (discussed here). 2 detailed updates available. Comment by @ojeda posted on 2025-05-20: > Update from our 2025-05-07 meeting (full minutes): > > * Enthusiasm and plans for RustWeek. > > * `arbitrary_self_types`: update from @dingxiangfei2009 at https://rust-lang.zulipchat.com/#narrow/channel/425075-rust-for-linux/topic/2025-05-07.20meeting/near/516734641 -- he plans to talk to types in order to find a solution. @davidtwco will ping @petrochenkov about `rustc_resolve`. > > * Sanitizer support and `#[sanitize(off)]`: discussed by lang at https://github.com/rust-lang/rust/pull/123617#issuecomment-2859621119. Discussion about allowing to disable particular sanitizers. Older concern from compiler at https://github.com/rust-lang/rust/pull/123617#issuecomment-2192330122. > > * `asm_const` with pointers support: lang talked about it -- lang will want an RFC: https://github.com/rust-lang/rust/issues/128464#issuecomment-2861515372. > > * ABI-modifying compiler flags: two MCPs filled: https://github.com/rust-lang/compiler-team/issues/868 (`-Zretpoline` and `-Zretpoline-external-thunk`) and https://github.com/rust-lang/compiler-team/issues/869 (`-Zharden-sls`). > > Implementation PR for `-Zindirect-branch-cs-prefix` at https://github.com/rust-lang/rust/pull/140740 that goes on top of https://github.com/rust-lang/rust/pull/135927. > > @davidtwco agreed there is likely no need for a separate MCP for this last one, i.e. it could go into the `-Zretpoline*` one. @azhogin pinged about this at https://github.com/rust-lang/rust/pull/135927#issuecomment-2859906060. > > * `--crate-attr`: @Mark-Simulacrum was pinged and he is OK to adopt the RFC (https://github.com/rust-lang/rfcs/pull/3791). > > Comment by @nikomatsakis posted on 2025-05-20: > TL;DR: > > The primary focus for this year is compiled flags, and we are continuing to push on the various compiler flags and things that are needed to support building RFL on stable (e.g., RFC #3791 proposed adding `--crate-attr`, which permits injecting attributes into crates externally to allow the Kernel's build process to add things like `#!no_std]` so they don't have to be inserted manually into every file; MCPs for ABI flags like `retpoline` and `harden-sls` and [implementation of `-Zindirect-branch-cs-prefix`). A number of issues had minor design questions (how to manage clippy configuration; best approach for rustdoc tests) and we plan to use the RustWeek time to hash those out. > > We are also finishing up some of the work on language items. We have had two stabilizations of lang features needed by Rust for Linux (naked functions, `asm_goto` syntax). The trickiest bit here is arbitrary self types, where we encountered a concern relating to pin and are still discussing the best resolution. ## Goals looking for help **Promoting Parallel Front End** The main bottleneck is the customization of the dependent `rustc-rayon` library. @oli-obk and @Zoxc are helping to move this forward. _Help wanted:_ Help test the deadlock code in the issue list and try to reproduce the issues. If you'd like to help, please post in this goal's dedicated zulip topic. **Stabilize public/private dependencies** _Help wanted:_ T-compiler people to work on the blocking issues #119428 and #71043. If you'd like to help, please post in this goal's dedicated zulip topic. **Expose experimental LLVM features for GPU offloading** _Help wanted:_ @ZuseZ4: there is only really one issue left which I'd like to see fixed before enabling autodiff on nightly, and that is MacOS support. Most of the MacOS CI already works, we can now build Enzyme, LLVM, and rustc, but later fail when we build Cranelift due to linker flag issues. The person who was looking into it got busy with other things, so I would really appreciate it if someone could pick it up! Otherwise I can also just start by shipping autodiff on Linux only, but given how close we are to MacOS support, I feel like it would be a shame. Since it's only an issue in CI, you don't need an own Mac to help with this. If anyone has time, I'm happy to chat here here or on Zulip/Discord. 3 detailed updates available. Comment by @ZuseZ4 posted on 2025-05-25: > And another round of updates. First of all, Google approved two GSoC projects for the summer, where @Sa4dUs will work on the autodiff frontend and @KMJ-007 will work on the backend. The frontend project is about improving our ABI handling to remove corner-cases around specific types that we currently can not differentiate. If time permits he might also get to re-model our frontend to lower our autodiff macro to a proper rustc intrinsic, which should allow us to simplify our logic a lot. The backend project will look at how Enzyme uses TypeTrees, and create those during the lowering to LLVM-IR. This should allow autodiff to become more reliable, work on debug builds, and generally compile a lot faster. Comment by @ZuseZ4 posted on 2025-05-25: > The last weeks were focused on enabling autodiff in a lot more locations, as well as doing a lot of CI and Cmake work to be able to ship it on nightly. At the same time, autodiff is also gaining increasingly more contributors. That should help a lot with the uptick in issues, which I expect once we enable autodiff in nightly builds. > > **Key developments:** > > 1. @Shourya742 added support for applying autodiff inside of `inherent impl blocks`. https://github.com/rust-lang/rust/pull/140104 > 2. @haenoe added support for applying autodiff to generic functions. https://github.com/rust-lang/rust/pull/140049 > 3. @Shourya742 added an optimization to inline the generated function, removing one layer of indirection. That should improve performance when differentiating tiny functions. https://github.com/rust-lang/rust/pull/139308 > 4. @haenoe added support for applying autodiff to inner (nested) functions. https://github.com/rust-lang/rust/pull/138314 > 5. I have found a bugfix for building rustc with both debug and autodiff enabled. This previously failed during bootstrap. This bugfix also solved the last remaining (compile time) performance regression of the autodiff feature. That means that if we now enable autodiff on nightly, it won't affect compile times for people not using it. https://github.com/rust-lang/rust/pull/140030 > 6. After a hint from Onur I also fixed autodiff check builds:https://github.com/rust-lang/rust/pull/140000, which makes contributing to autodiff easier. > 7. I ran countless experiments on improving and fixing Enzyme's CMake and merged a few PRs into Enzyme. We don't fully support the macos dist runners yet and some of my CMake improvements only live in our Enzyme fork and aren't accepted by upstream yet, but the CI is now able to run longer before failing with the next bug, which should hopefully be easy to fix. At least I already received a hint on how to solve it. > 8. @Shourya742 also helped with an experiment on how to bundle Enzyme with the Rust compiler. We ended up selecting a different distribution path, but the PR was helpful to discuss solutions with Infra contributors. https://github.com/rust-lang/rust/pull/140244 > 9. @Sa4dUs implemented a PR to split our `#[autodiff]` macro into `autodiff_forward` and `autodiff_reverse`. They behave quite differently in some ways that might surprise users, so I decided it's best for now to have them separated, which also will make teaching and documenting easier. https://github.com/rust-lang/rust/pull/140697 > > > **Help Wanted:** There are two or three smaller issues remaining to distribute Enzyme/autodiff. If anyone is open to help, either with bootstrap, CI, or CMake issues, I'd appreciate any support. Please feel free to ping me on Discord, Zulip, or in https://github.com/rust-lang/rust/pull/140064 to discuss what's left to do. > > In general, we solved most of the distribution issues over the last weeks, and autodiff can now be applied to almost all functions. That's a pretty good base, so I will now start to look again more into the GPU support for rustc. Comment by @ZuseZ4 posted on 2025-06-15: > The last three weeks I had success in shifting away from autodiff, towards my other projects. > > **Key developments:** > > 1. I forgot to mention it in a previous update, but I have added support for sret (struct return) handling to std::autodiff, so we now can differentiate a lot more functions reliably. https://github.com/rust-lang/rust/pull/139465 > > 2. I added more support for batched autodiff in: https://github.com/rust-lang/rust/pull/139351 > > 3. I have started working on a std::batching PR, which just allows fusing multiple function calls into one. https://github.com/rust-lang/rust/pull/141637. I am still not fully sure on how to design the frontend, but in general it will allow Array-of-Struct and Struct-of-Array vectorization. Based on a popular feedback I received it's now also generating SIMD types. So you can write your function in a scalar way, and just use the macro to generate a vectorized version which accepts and generates SIMD types. > > 4. My first PR to handle automatic data movement to and from a GPU is up! https://github.com/rust-lang/rust/pull/142097 It can handle data movements for almost arbitrary functions, as long as your function is named `kernel_{num}`, and each of your arguments is a pointer to exactly 256 f32 values. As the next step, I will probably work on the backend to generate the actual kernel launches, so people can run their Rust code on the GPU. Once I have that tested and working I will go back to develop a frontend, to remove the input type limitations and give users a way to manually schedule data transfers. The gpu/offload frontend will likely be very simple compared to my autodiff frontend, so I don't expect many complications and therefore leave it to the end. > > > > **Help Wanted:** > > There is only really one issue left which I'd like to see fixed before enabling autodiff on nightly, and that is MacOS support. Most of the MacOS CI already works, we can now build Enzyme, LLVM, and rustc, but later fail when we build Cranelift due to linker flag issues. The person who was looking into it got busy with other things, so I would really appreciate it if someone could pick it up! Otherwise I can also just start by shipping autodiff on Linux only, but given how close we are to MacOS support, I feel like it would be a shame. Since it's only an issue in CI, you don't need an own Mac to help with this. If anyeone has time, I'm happy to chat here here or on Zulip/Discord. **Null and enum-discriminant runtime checks in debug builds** _Help wanted_ : 1c3t3a: happy to join forces on general checks and for advice what other UB would be great to check!! :). 1 detailed update available. Comment by @1c3t3a posted on 2025-05-22: > Upps, giving another status update here: > > **Key developments** : Landed an extension of the alignment check to include (mutable) borrows in rust#137940. Working on the enums check (no draft PR yet). Hope to open a PR by mid next week. > > **Blockers** : None so far. > > **Help wanted** : Happy to join forces on general checks and for advice what other UB would be great to check!! :) **Optimizing Clippy & linting** _Help wanted:_ Help is appreciated in anything with the `performance-project` label in the Clippy repository. 1 detailed update available. Comment by @blyxyas posted on 2025-05-25: > Monthly update! > > **Key developments:** > > * Documentation lints have been optimized greatly, giving us up to a 13.5% decrease in documentation-heavy crates. See https://github.com/rust-lang/rust-clippy/pull/14693 and https://github.com/rust-lang/rust-clippy/pull/14870 > > * The efforts on getting Clippy benchmarked on the official @rust-timer bot account are getting started by the infra team. This allows us to do per-PR benchmarking instead of fixing performance problems ad-hoc. > > * We need to do further testing on the **early parallel lints effort**. While I have a working patch, no performance improvement has yet been proven. > > * Work on making an interface for a single-lint Clippy, for denoising benchmarks is getting in the works. > > > > **Blockers** The query system not being parallelized. Currently working on a work-around but a parallel query system would make things a lot easier. > > **Help wanted:** Help is appreciated in anything with the `performance-project` label in the Clippy repository. ## Other goal updates **" Stabilizable" prototype for expanded const generics** 1 detailed update available. Comment by @BoxyUwU posted on 2025-05-23: > We should now be correctly deferring evaluation of type system constants making use of generic parameters or inference variables. There's also been some work to make our normalization infrastructure more term agnostic (i.e. work on both types and consts). Camelid's PR mentioned in the previous update has also made great progress. **build-std** Comment by @wesleywiser posted on 2025-06-19: > * @adamgemmell and @davidtwco hosted a session on build-std at the All Hands with members from various teams discussing some of the design questions. > * We've continued our biweekly sync call with lang, compiler and cargo team members. > * @davidtwco and @adamgemmell have been hard at work preparing a compendium detailing the history of build-std and the wg-cargo-std-aware repo. > * Reviewing and editing this document is ongoing and a continuing topic of discussion for the sync call. > * In the last sync call, we discussed: > * Renewing the project goal for another cycle: enthusiastic agreement from many participants. > * Posting updates to the project goal page biweekly after each sync call. > * Discussion on the content and format of the compendium. Most of the content appears to be done but further editing and restructuring will make it clearer and more easily digestible. > 1 detailed update available. **Continue resolving `cargo-semver-checks` blockers for merging into cargo** No detailed updates available. **Declarative ( `macro_rules!`) macro improvements** No detailed updates available. **Evaluate approaches for seamless interop between C++ and Rust** 1 detailed update available. Comment by @tmandry posted on 2025-05-22: > Last week was the Rust All Hands. There were three days of discussions about interop at the all hands, led by @baumanj and including members from the Rust Project and C++ standards bodies as well as the developers of foundational Rust/C++ interop tools. The topics included > > * Comparing differing needs of interop across the industry > * Sharing the design philosophy and approach of different interop tools > * Brainstorming how to tackle common interop problems between the languages, like differences in integer types, memory/object models, and move semantics > * Discussing ways the Rust and C++ languages and toolchains can develop to make interop easier in the future > > > Speaking for myself from the Rust Project side, it was a real pleasure to meet some of the faces from the C++ side! I look forward to working with them more in the future. **Experiment with ergonomic ref-counting** No detailed updates available. **Extend pubgrub to match cargo 's dependency resolution** 1 detailed update available. Comment by @Eh2406 posted on 2025-05-27: > The talk went smoothly and was well received. I had several useful and interesting conversations at Rust Week about effort. That is all I have to report. **Externally Implementable Items** No detailed updates available. **Finish the libtest json output experiment** 1 detailed update available. Comment by @epage posted on 2025-05-21: > * Key developments: > * Moved crates to https://github.com/crate-ci/libtest2 > * Blockers > * Help wanted > **Implement Open API Namespace Support** 1 detailed update available. Comment by @b-naber posted on 2025-06-10: > We have reached an agreement on the compiler implementation, and will implement it in the next 2-3 weeks hopefully. **Implement restrictions, prepare for stabilization** 1 detailed update available. Comment by @jhpratt posted on 2025-05-30: > https://github.com/rust-lang/rust/pull/141754 has been opened to parse `impl` restrictions and lower them to `rustc_middle`. A separate pull request will be opened to enforce the restriction soon after that is merged. **Improve state machine codegen** No detailed updates available. **Instrument the Rust standard library with safety contracts** No detailed updates available. **Making compiletest more maintainable: reworking directive handling** No detailed updates available. **Metrics Initiative** 2 detailed updates available. Comment by @yaahc posted on 2025-05-26: > Quick update, Data is currently being gathered (and has been for almost 2 weeks now) on docs.rs and I should have it uploaded and accessible on the PoC dashboard within the next week or two (depending on how long I want to let the data gather). Comment by @yaahc posted on 2025-06-03: > Bigger Update, > > I've done the initial integration with the data gathered so far since rustweek. I have the data uploaded to the influxdb cloud instance managed by the infra team, I connected the infra team's grafana instance to said influxdb server and I imported my dashboards so we now have fancy graphs with real data on infra managed servers :tada: > > I'm now working with the infra team to see how we can open up access of the graphana dashboard so that anyone can go and poke around and look at the data. > > Another issue that came up is that the influxdb cloud serverless free instance that we're currently using has a mandatory max 30 day retention policy, so either I have to figure out a way to get that disabled on our instance or our data will get steadily deleted and will only be useful as a PoC demo dashboard for a short window of time. **Model coherence in a-mir-formality** No detailed updates available. **Next-generation trait solver** 2 detailed updates available. Comment by @lcnr posted on 2025-05-29: > We have triaged all major regressions discovered by the full crater run. While there are still some untriaged root regressions impacting a single crate, we've either fixed all major regressions or opened fixes to the affected crates in cases where the breakage is intended. We've started to track intended breakage in https://github.com/rust-lang/trait-system-refactor-initiative/issues/211. > > We've fixed quite a few additional issues encountered via crater: https://github.com/rust-lang/rust/pull/140672 https://github.com/rust-lang/rust/pull/140678 https://github.com/rust-lang/rust/pull/140707 https://github.com/rust-lang/rust/pull/140711 https://github.com/rust-lang/rust/pull/140712 https://github.com/rust-lang/rust/pull/140713 https://github.com/rust-lang/rust/pull/141125 https://github.com/rust-lang/rust/pull/141332 https://github.com/rust-lang/rust/pull/141333 https://github.com/rust-lang/rust/pull/141334 https://github.com/rust-lang/rust/pull/141347 https://github.com/rust-lang/rust/pull/141359. > > We are now tracking performance of some benchmarks with the new solver in our test suite and have started to optimize the new solver. Thank you @Kobzol for this! There are a lot of long-hanging fruit so we've made some large improvements already: https://github.com/rust-lang/rust/pull/141442 https://github.com/rust-lang/rust/pull/141500. There are also a bunch of additional improvements in-flight right now, e.g. https://github.com/rust-lang/rust/pull/141451. We still have a few crates which are _significantly_ slower with the new solver, most notably `nalgebra` and `diesel`. I am confident we'll get the new solver a lot more competitive here over the next few months. > > Going forward, we will continue to improve the performance of the new solver. We will also finally work through our backlog of in-process changes and land the new opaque type handling. Comment by @lcnr posted on 2025-05-29: > Ah, also @jackh726 continued to work on integrating the new solver in RustAnalyzer and it looks like we will be able to replace chalk in the near future. **Nightly support for ergonomic SIMD multiversioning** 1 detailed update available. Comment by @veluca93 posted on 2025-05-25: > Key developments: https://github.com/rust-lang/rust/issues/139368 was opened, which poses some possibly-relevant questions on the interaction between the `target_feature` attribute and traits. Otherwise, still trying to get a better understanding of the interaction between target feature and effects. **Prepare const traits for stabilization** 1 detailed update available. Comment by @oli-obk posted on 2025-05-21: > No updates on my side, but we may be going back to the original proposal (modulo syntax) with a syntax that is extensible to more opt-out marker effects without lots of repetition of the `const` keyword **Prototype a new set of Cargo "plumbing" commands** 1 detailed update available. Comment by @epage posted on 2025-05-27: > This has been approved as a GSoC project. **Publish first rust-lang-owned release of "FLS"** 1 detailed update available. Comment by @JoelMarcey posted on 2025-06-01: > Key Developments: A PR is ready for review and merging to update the FLS to be self-sufficient, not relying on external Ferrocene packages for building. This will give us more control of changes we would like to make to the document, including theming, logos, naming, etc. > > Next step: Make some modifications to the FLS content and have it published at https://rust-lang.github.io/fls > > Blockers: Potential blocker around the (re)naming / rebranding of the FLS. **Publish first version of StableMIR on crates.io** No detailed updates available. **Research: How to achieve safety when linking separately compiled code** No detailed updates available. **Run the 2025H1 project goal program** No detailed updates available. **Rust Vision Document** No detailed updates available. **rustc-perf improvements** 2 detailed updates available. Comment by @davidtwco posted on 2025-06-02: > * @Jamesbarford has added the ability to write tests against the database to `rustc-perf` (rust-lang/rustc-perf#2119) > * @Jamesbarford has started to submit parts of rust-lang/rustc-perf#2081 in smaller chunks, with review feedback addressed, starting with rust-lang/rustc-perf#2134 (originally rust-lang/rustc-perf#2096) > * @Jamesbarford has prepared a HackMD describing the design considerations involved in making rustc-perf support multiple collectors. > Comment by @Jamesbarford posted on 2025-06-20: > * @Kobzol & @Jamesbarford collaborated on finishing a workable draft for the new architecture of the `rustc-perf` benchmarking; https://hackmd.io/wq30YNEIQMSFLWWcWDSI9A > * @Kobzol PR enabling backfilling of data, required for the new system design https://github.com/rust-lang/rustc-perf/pull/2161 > * @Jamesbarford PR for creating a cron job and doing a first stage queue of master commits; https://github.com/rust-lang/rustc-perf/pull/2163 > * @Jamesbarford PR for the collectors configuration, holding off merging for the time being as we learn more about the system through building. https://github.com/rust-lang/rustc-perf/pull/2157 > * @Kobzol PR allowing running the database tests on SQLite too; https://github.com/rust-lang/rustc-perf/pull/2152 > **Scalable Polonius support on nightly** 1 detailed update available. Comment by @lqd posted on 2025-05-27: > Here are the key developments for May, though there was a bit less time this month due to the All Hands. > > @amandasystems: A few more rounds of reviews were done on https://github.com/rust-lang/rust/pull/140466 (thanks to lcnr!), and most, if not all, of the feedback has been addressed already. Another PR was opened as a successor, containing another big chunk of work from the initial PR #130227: https://github.com/rust-lang/rust/pull/140737. > > @tage64: The work discussed in the previous updates has been extracted into a few PRs, mostly to do perf runs to be able to gauge the overhead in the in-progress implementation. First, an alternative implementation to rustc's dense bitset, which is used extensively in dataflow analyses such as the ones in the borrow checker, for example. Then, a prototype of the algorithm discussed in prior updates, trying to make the location-sensitive constraints built lazily, as well as the loans in scope themselves. (And the union of these two in #141583) > > @lqd: As discussed in the previous update, I've tried to see if we can limit scope here by evaluating the current algorithm a bit more: the expressiveness it allows, and where it fails. I've also evaluated all the open issues about NLL expressiveness that we hoped to fix, and see the ones we support now or could defer to future improvements. It seems _possible_. I've also started to have some idea of the work needed to make it more production-ready. That includes the experiments made with Tage above, but also trying to lower the total overhead by finding wins in NLLs, and here I e.g. have some improvements in-flight for the dataflow analysis used in liveness. > > All Hands: we discussed with t-types the plan and in-progress PRs about opaque types, how they impact member constraints and in turn the constraint graph and SCCs. Some more work is needed here to ensure member constraints are correctly handled, even though they should only impact the SCCs and not the borrow checking algorithm per se (but there still are possible ambiguity issues if we don't take flow sensitivity into account here). > > (Fun and interesting aside: there's an RFC to add a polonius-like lifetime analysis to clang) **Secure quorum-based cryptographic verification and mirroring for crates.io** No detailed updates available. **Stabilize cargo-script** 1 detailed update available. Comment by @epage posted on 2025-05-21: > Key developments: > > * rust-lang/rust#140035 has been merged > > > Blockers: > > Help wanted: **SVE and SME on AArch64** 1 detailed update available. Comment by @davidtwco posted on 2025-05-07: > * We've resolved a handful of rounds of feedback on rust-lang/rust#137944 from @oli-obk, @lcnr and @fee1-dead; resolved issues from a crater run (bar one); and worked to decrease the performance regression. > * We've removed the constness parts of the patch to make it smaller and easier to review. Constness will come in a Part II. > * There's currently a -1% mean regression (min 0.1%, max 5.3%) that we're working to improve, but starting to run out of ideas. Regressions are just a consequence of the compiler having to prove more things with the addition of `MetaSized` bounds, rather than hot spots in newly introduced code. > * Given the large impact of the change, we ran a crater run and found three distinct issues, two have been fixed. The remaining issue is a overflow in a single niche crate which we're working out how we can resolve. > * We're largely just waiting on hearing from our reviewers what would be needed to see this change land. > * We've not made any changes to the Sized Hierarchy RFC, there's a small amount of discussion which will be responded to once the implementation has landed. > * We're working on changes to the SVE RFC which further clarifies that the language changes are decided by the Sized RFC and that the SVE RFC is only proposing the forever-unstable `repr(scalable)` attribute which are non-`const Sized` and lower to `vscale` in LLVM. > Comment by @davidtwco posted on 2025-06-02: > * rust-lang/rust#137944 is ready! It's in a t-types FCP to merge as there's a small unavoidable breakage (unless we wanted to wait for the new trait solver). > * Once this is merged, I'll work on a `#[rustc_no_implicit_bounds]` attribute for tests, testing whether `Deref::Target` can be relaxed, and Part II. > * I've still not made any changes to the Sized Hierarchy RFC, there's a small amount of discussion which will be responded to once the implementation has landed. > **Unsafe Fields** 1 detailed update available. Comment by @jswrenn posted on 2025-05-22: > **Key developments:** No significant developments since previous updates. > > **Blockers:** Waiting on lang team review. **Use annotate-snippets for rustc diagnostic output** No detailed updates available.
20.06.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Rust compiler performance survey 2025 We're launching a Rust Compiler Performance Survey. Long compile times of Rust code are frequently being cited as one of the biggest challenges limiting the productivity of Rust developers. Rust compiler contributors are of course aware of that, and they are continuously working to improve the situation, by finding new ways of speeding up the compiler, triaging performance regressions and measuring our long-term performance improvements. Recently, we also made progress on some large changes that have been in the making for a long time, which could significantly improve compiler performance by default. When we talk about compilation performance, it is important to note that it is not always so simple as determining how long does it take `rustc` to compile a crate. There are many diverse development workflows that might have competing trade-offs, and that can be bottlenecked by various factors, such as the integration of the compiler with the used build system. In order to better understand these workflows, we have prepared a Rust Compiler Performance Survey. This survey is focused specifically on compilation performance, which allows us to get more detailed data than what we usually get from the annual State of Rust survey. The data from this survey will help us find areas where we should focus our efforts on improving the productivity of Rust developers. **You can fill out the surveyhere.** Filling the survey should take you approximately 10 minutes, and the survey is fully anonymous. We will accept submissions until Monday, July 7th, 2025. After the survey ends, we will evaluate the results and post key insights on this blog. We invite you to fill the survey, as your responses will help us improve Rust compilation performance. Thank you!
16.06.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Demoting i686-pc-windows-gnu to Tier 2 In Rust 1.88.0, the Tier 1 target `i686-pc-windows-gnu` will be demoted to Tier 2. As a Tier 2 Target, builds will continue to be distributed for both the standard library and the compiler. ## Background Rust has supported Windows for a long time, with two different flavors of Windows targets: MSVC-based and GNU-based. MSVC-based targets (for example the most popular Windows target `x86_64-pc-windows-msvc`) use Microsoft’s native linker and libraries, while GNU-based targets (like `i686-pc-windows-gnu`) are built entirely from free software components like `gcc`, `ld`, and mingw-w64. The major reason to use a GNU-based toolchain instead of the native MSVC-based one is cross-compilation and licensing. `link.exe` only runs on Windows (barring Wine hacks) and requires a license for commercial usage. `x86_64-pc-windows-gnu` and `i686-pc-windows-gnu` are currently both Tier 1 with host tools. The Target Tier Policy contains more details on what this entails, but the most important part is that tests for these targets are being run on every merged PR. This is the highest level of support we have, and is only used for the most high value targets (the most popular Linux, Windows, and Apple targets). The `*-windows-gnu` targets currently do not have any dedicated target maintainers. We do not have a lot of expertise for this toolchain, and issues often aren't fixed and cause problems in CI that we have a hard time to debug. The 32-bit version of this target is especially problematic and has significantly less usage than `x86_64-pc-windows-gnu`, which is why `i686-pc-windows-gnu` is being demoted to Tier 2. ## What changes? After Rust 1.88.0, `i686-pc-windows-gnu` will now be Tier 2 with host tools. For users, nothing will change immediately. Builds of both the standard library and the compiler will still be distributed by the Rust Project for use via `rustup` or alternative installation methods. This does mean that this target will likely accumulate bugs faster in the future because of the reduced testing. ## Future If no maintainers are found and the `*-windows-gnu` targets continue causing problems, they may be demoted further. No concrete plans about this have been made yet. If you rely on the `*-windows-gnu` targets and have expertise in this area, we would be very happy to have you as a target maintainer. You can check the Target Tier Policy for what exactly that would entail. For more details on the motivation of the demotion, see RFC 3771 which proposed this change.
26.05.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.87.0 and ten years of Rust! Live from the 10 Years of Rust celebration in Utrecht, Netherlands, the Rust team is happy to announce a new version of Rust, 1.87.0! Today's release day happens to fall exactly on the 10 year anniversary of Rust 1.0! Thank you to the myriad contributors who have worked on Rust, past and present. Here's to many more decades of Rust! πŸŽ‰ * * * As usual, the new version includes all the changes that have been part of the beta version in the past six weeks, following the consistent regular release cycle that we have followed since Rust 1.0. If you have a previous version of Rust installed via `rustup`, you can get 1.87.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.87.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.87.0 stable ### Anonymous pipes 1.87 adds access to anonymous pipes to the standard library. This includes integration with `std::process::Command`'s input/output methods. For example, joining the stdout and stderr streams into one is now relatively straightforward, as shown below, while it used to require either extra threads or platform-specific functions. use std::process::Command; use std::io::Read; let (mut recv, send) = std::io::pipe()?; let mut command = Command::new("path/to/bin") // Both stdout and stderr will write to the same pipe, combining the two. .stdout(send.try_clone()?) .stderr(send) .spawn()?; let mut output = Vec::new(); recv.read_to_end(&mut output)?; // It's important that we read from the pipe before the process exits, to avoid // filling the OS buffers if the program emits too much output. assert!(command.wait()?.success()); ### Safe architecture intrinsics Most `std::arch` intrinsics that are unsafe only due to requiring target features to be enabled are now callable in safe code that has those features enabled. For example, the following toy program which implements summing an array using manual intrinsics can now use safe code for the core loop. #![forbid(unsafe_op_in_unsafe_fn)] use std::arch::x86_64::*; fn sum(slice: &[u32]) -> u32 { #[cfg(target_arch = "x86_64")] { if is_x86_feature_detected!("avx2") { // SAFETY: We have detected the feature is enabled at runtime, // so it's safe to call this function. return unsafe { sum_avx2(slice) }; } } slice.iter().sum() } #[target_feature(enable = "avx2")] #[cfg(target_arch = "x86_64")] fn sum_avx2(slice: &[u32]) -> u32 { // SAFETY: __m256i and u32 have the same validity. let (prefix, middle, tail) = unsafe { slice.align_to::<__m256i>() }; let mut sum = prefix.iter().sum::<u32>(); sum += tail.iter().sum::<u32>(); // Core loop is now fully safe code in 1.87, because the intrinsics require // matching target features (avx2) to the function definition. let mut base = _mm256_setzero_si256(); for e in middle.iter() { base = _mm256_add_epi32(base, *e); } // SAFETY: __m256i and u32 have the same validity. let base: [u32; 8] = unsafe { std::mem::transmute(base) }; sum += base.iter().sum::<u32>(); sum } ### `asm!` jumps to Rust code Inline assembly (`asm!`) can now jump to labeled blocks within Rust code. This enables more flexible low-level programming, such as implementing optimized control flow in OS kernels or interacting with hardware more efficiently. * The `asm!` macro now supports a label operand, which acts as a jump target. * The label must be a block expression with a return type of `()` or `!`. * The block executes when jumped to, and execution continues after the `asm!` block. * Using output and label operands in the same `asm!` invocation remains unstable. unsafe { asm!( "jmp {}", label { println!("Jumped from asm!"); } ); } For more details, please consult the reference. ### Precise capturing (`+ use<...>`) in `impl Trait` in trait definitions This release stabilizes specifying the specific captured generic types and lifetimes in trait definitions using `impl Trait` return types. This allows using this feature in trait definitions, expanding on the stabilization for non-trait functions in 1.82. Some example desugarings: trait Foo { fn method<'a>(&'a self) -> impl Sized; // ... desugars to something like: type Implicit1<'a>: Sized; fn method_desugared<'a>(&'a self) -> Self::Implicit1<'a>; // ... whereas with precise capturing ... fn precise<'a>(&'a self) -> impl Sized + use<Self>; // ... desugars to something like: type Implicit2: Sized; fn precise_desugared<'a>(&'a self) -> Self::Implicit2; } ### Stabilized APIs * `Vec::extract_if` * `vec::ExtractIf` * `LinkedList::extract_if` * `linked_list::ExtractIf` * `<[T]>::split_off` * `<[T]>::split_off_mut` * `<[T]>::split_off_first` * `<[T]>::split_off_first_mut` * `<[T]>::split_off_last` * `<[T]>::split_off_last_mut` * `String::extend_from_within` * `os_str::Display` * `OsString::display` * `OsStr::display` * `io::pipe` * `io::PipeReader` * `io::PipeWriter` * `impl From<PipeReader> for OwnedHandle` * `impl From<PipeWriter> for OwnedHandle` * `impl From<PipeReader> for Stdio` * `impl From<PipeWriter> for Stdio` * `impl From<PipeReader> for OwnedFd` * `impl From<PipeWriter> for OwnedFd` * `Box<MaybeUninit<T>>::write` * `impl TryFrom<Vec<u8>> for String` * `<*const T>::offset_from_unsigned` * `<*const T>::byte_offset_from_unsigned` * `<*mut T>::offset_from_unsigned` * `<*mut T>::byte_offset_from_unsigned` * `NonNull::offset_from_unsigned` * `NonNull::byte_offset_from_unsigned` * `<uN>::cast_signed` * `NonZero::<uN>::cast_signed`. * `<iN>::cast_unsigned`. * `NonZero::<iN>::cast_unsigned`. * `<uN>::is_multiple_of` * `<uN>::unbounded_shl` * `<uN>::unbounded_shr` * `<iN>::unbounded_shl` * `<iN>::unbounded_shr` * `<iN>::midpoint` * `<str>::from_utf8` * `<str>::from_utf8_mut` * `<str>::from_utf8_unchecked` * `<str>::from_utf8_unchecked_mut` These previously stable APIs are now stable in const contexts: * `core::str::from_utf8_mut` * `<[T]>::copy_from_slice` * `SocketAddr::set_ip` * `SocketAddr::set_port`, * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port`, * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `char::is_digit` * `char::is_whitespace` * `<[[T; N]]>::as_flattened` * `<[[T; N]]>::as_flattened_mut` * `String::into_bytes` * `String::as_str` * `String::capacity` * `String::as_bytes` * `String::len` * `String::is_empty` * `String::as_mut_str` * `String::as_mut_vec` * `Vec::as_ptr` * `Vec::as_slice` * `Vec::capacity` * `Vec::len` * `Vec::is_empty` * `Vec::as_mut_slice` * `Vec::as_mut_ptr` ### `i586-pc-windows-msvc` target removal The Tier 2 target `i586-pc-windows-msvc` has been removed. `i586-pc-windows-msvc`'s difference to the much more popular Tier 1 target `i686-pc-windows-msvc` is that `i586-pc-windows-msvc` does not require SSE2 instruction support. But Windows 10, the minimum required OS version of all `windows` targets (except the `win7` targets), requires SSE2 instructions itself. All users currently targeting `i586-pc-windows-msvc` should migrate to `i686-pc-windows-msvc`. You can check the Major Change Proposal for more information. ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.87.0 Many people came together to create Rust 1.87.0. We couldn't have done it without all of you. Thanks!
15.05.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Google Summer of Code 2025 selected projects The Rust Project is participating in Google Summer of Code (GSoC) again this year. GSoC is a global program organized by Google that is designed to bring new contributors to the world of open-source. In March, we published a list of GSoC project ideas, and started discussing these projects with potential GSoC applicants on our Zulip. We had many interesting discussions with the potential contributors, and even saw some of them making non-trivial contributions to various Rust Project repositories, even before GSoC officially started! After the initial discussions, GSoC applicants prepared and submitted their project proposals. We received 64 proposals this year, almost exactly the same number as last year. We are happy to see that there was again so much interest in our projects. A team of mentors primarily composed of Rust Project contributors then thoroughly examined the submitted proposals. GSoC required us to produce a ranked list of the best proposals, which was a challenging task in itself since Rust is a big project with many priorities! Same as last year, we went through several rounds of discussions and considered many factors, such as prior conversations with the given applicant, the quality of their proposal, the importance of the proposed project for the Rust Project and its wider community, but also the availability of mentors, who are often volunteers and thus have limited time available for mentoring. As is usual in GSoC, even though some project topics received multiple proposals1, we had to pick only one proposal per project topic. We also had to choose between great proposals targeting different work to avoid overloading a single mentor with multiple projects. In the end, we narrowed the list down to a smaller number of the best proposals that we could still realistically support with our available mentor pool. We submitted this list and eagerly awaited how many of them would be accepted into GSoC. ## Selected projects On the 8th of May, Google has announced the accepted projects. We are happy to share that **19** Rust Project proposals were accepted by Google for Google Summer of Code 2025. That's a lot of projects, which makes us super excited about GSoC 2025! Below you can find the list of accepted proposals (in alphabetical order), along with the names of their authors and the assigned mentor(s): * **ABI/Layout handling for the automatic differentiation feature** by Marcelo DomΓ­nguez, mentored by Manuel Drehwald and Oli Scherer * **Add safety contracts** by Dawid Lachowicz, mentored by Michael Tautschnig * **Bootstrap of rustc with rustc_codegen_gcc** by MichaΕ‚ Kostrubiec, mentored by antoyo * **Cargo: Build script delegation** by Naman Garg, mentored by Ed Page * **Distributed and resource-efficient verification** by Zhou Jiping, mentored by Michael Tautschnig * **Enable Witness Generation in cargo-semver-checks** by Talyn Veugelers, mentored by Predrag Gruevski * **Extend behavioural testing of std::arch intrinsics** by Madhav Madhusoodanan, mentored by Amanieu d'Antras * **Implement merge functionality in bors** by Sakibul Islam, mentored by Jakub BerΓ‘nek * **Improve bootstrap** by Shourya Sharma, mentored by Jakub BerΓ‘nek, Jieyou Xu and Onur Γ–zkan * **Improve Wild linker test suites** by Kei Akiyama, mentored by David Lattimore * **Improving the Rustc Parallel Frontend: Parallel Macro Expansion** by Lorrens, mentored by Sparrow Li * **Make cargo-semver-checks faster** by JosephC, mentored by Predrag Gruevski * **Make Rustup Concurrent** by Francisco Gouveia, mentored by rami3l * **Mapping the Maze of Rust's UI Test Suite with Established Continuous Integration Practices** by Julien Robert, mentored by Jieyou Xu * **Modernising the libc Crate** by Abdul Muiz, mentored by Trevor Gross * **New proc-macro Server API for Rust-Analyzer** by Neil Wang, mentored by Lukas Wirth * **Prepare stable_mir crate for publishing** by Makai, mentored by Celina Val * **Prototype an alternative architecture for cargo fix using cargo check** by Glen Thalakottur, mentored by Ed Page * **Prototype Cargo Plumbing Commands** by Vito Secona, mentored by Cassaundra **Congratulations to all applicants whose project was selected!** The mentors are looking forward to working with you on these exciting projects to improve the Rust ecosystem. You can expect to hear from us soon, so that we can start coordinating the work on your GSoC projects. We would also like to thank all the applicants whose proposal was sadly not accepted, for their interactions with the Rust community and contributions to various Rust projects. There were some great proposals that did not make the cut, in large part because of limited mentorship capacity. However, even if your proposal was not accepted, we would be happy if you would consider contributing to the projects that got you interested, even outside GSoC! Our project idea list is still actual and could serve as a general entry point for contributors that would like to work on projects that would help the Rust Project maintainers and the Rust ecosystem. Some of the Rust Project Goals are also looking for help. There is also a good chance we'll participate in GSoC next year as well (though we can't promise anything at this moment), so we hope to receive your proposals again in the future! The accepted GSoC projects will run for several months. After GSoC 2025 finishes (in autumn of 2025), we will publish a blog post in which we will summarize the outcome of the accepted projects. 1. The most popular project topic received seven different proposals! ↩
08.05.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing rustup 1.28.2 The rustup team is happy to announce the release of rustup version 1.28.2. Rustup is the recommended tool to install Rust, a programming language that empowers everyone to build reliable and efficient software. ## What's new in rustup 1.28.2 The headlines of this release are: * The cURL download backend and the native-tls TLS backend are now officially deprecated and a warning will start to show up when they are used. pr#4277 * While rustup predates reqwest and rustls, the rustup team has long wanted to standardize on an HTTP + TLS stack with more components in Rust, which should increase security, potentially improve performance, and simplify maintenance of the project. With the default download backend already switched to reqwest since 2019, the team thinks it is time to focus maintenance on the default stack powered by these two libraries. * For people who have set `RUSTUP_USE_CURL=1` or `RUSTUP_USE_RUSTLS=0` in their environment to work around issues with rustup, please try to unset these after upgrading to 1.28.2 and file an issue if you still encounter problems. * The version of `rustup` can be pinned when installing via `rustup-init.sh`, and `rustup self update` can be used to upgrade/downgrade rustup 1.28.2+ to a given version. To do so, set the `RUSTUP_VERSION` environment variable to the desired version (for example `1.28.2`). pr#4259 * `rustup set auto-install disable` can now be used to disable automatic installation of the toolchain. This is similar to the `RUSTUP_AUTO_INSTALL` environment variable introduced in 1.28.1 but with a lower priority. pr#4254 * Fixed a bug in Nushell integration that might generate invalid commands in the shell configuration. Reinstalling rustup might be required for the fix to work. pr#4265 ## How to update If you have a previous version of rustup installed, getting the new one is as easy as stopping any programs which may be using rustup (e.g. closing your IDE) and running: $ rustup self update Rustup will also automatically update itself at the end of a normal toolchain update: $ rustup update If you don't have it already, you can get rustup from the appropriate page on our website. Rustup's documentation is also available in the rustup book. ## Caveats Rustup releases can come with problems not caused by rustup itself but just due to having a new release. In particular, anti-malware scanners might block rustup or stop it from creating or copying files, especially when installing `rust-docs` which contains many small files. Issues like this should be automatically resolved in a few weeks when the anti-malware scanners are updated to be aware of the new rustup release. ## Thanks Thanks again to all the contributors who made this rustup release possible!
05.05.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
crates.io security incident: improperly stored session cookies Today the crates.io team discovered that the contents of the `cargo_session` cookie were being persisted to our error monitoring service, Sentry, as part of event payloads sent when an error occurs in the crates.io backend. The value of this cookie is a signed value that identifies the currently logged in user, and therefore these cookie values could be used to impersonate any logged in user. Sentry access is limited to a trusted subset of the crates.io team, Rust infrastructure team, and the crates.io on-call rotation team, who already have access to the production environment of crates.io. There is no evidence that these values were ever accessed or used. Nevertheless, out of an abundance of caution, we have taken these actions today: 1. We have merged and deployed a change to redact all cookie values from all Sentry events. 2. We have invalidated all logged in sessions, thus making the cookies stored in Sentry useless. In effect, this means that every crates.io user has been logged out of their browser session(s). Note that API tokens are **not** affected by this: they are transmitted using the `Authorization` HTTP header, and were already properly redacted before events were stored in Sentry. All existing API tokens will continue to work. We apologise for the inconvenience. If you have any further questions, please contact us on Zulip or GitHub.
11.04.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
March Project Goals Update The Rust project is currently working towards a slate of 40 project goals, with 3 of them designated as Flagship Goals. This post provides selected updates on our progress towards these goals (or, in some cases, lack thereof). The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** **Why this goal?** This work continues our drive to improve support for async programming in Rust. In 2024H2 we stabilized async closures; explored the generator design space; and began work on the `dynosaur` crate, an experimental proc-macro to provide dynamic dispatch for async functions in traits. In 2025H1 our plan is to deliver (1) improved support for async-fn-in-traits, completely subsuming the functionality of the `async-trait` crate; (2) progress towards sync and async generators, simplifying the creation of iterators and async data streams; (3) and improve the ergonomics of `Pin`, making lower-level async coding more approachable. These items together start to unblock the creation of the next generation of async libraries in the wider ecosystem, as progress there has been blocked on a stable solution for async traits and streams. **What has happened?** **Generators.** Initial implementation work has started on an `iter!` macro experiment in https://github.com/rust-lang/rust/pull/137725. Discussions have centered around whether the macro should accept blocks in addition to closures, whether thunk closures with an empty arguments list should implement `IntoIterator`, and whether blocks should evaluate to a type that is `Iterator` as well as `IntoIterator`. See the design meeting notes for more. **dynosaur.** We released dynosaur v0.2.0 with some critical bug fixes and one breaking change. We have several more breaking changes queued up for an 0.3 release line that we also use plan to use as a 1.0 candidate. **Pin ergonomics.** https://github.com/rust-lang/rust/pull/135733 landed to implement `&pin const self` and `&pin mut self` sugars as part of the ongoing pin ergonomics experiment. Another PR is open with an early implementation of applying this syntax to borrowing expressions. There has been some discussion within parts of the lang team on whether to prefer this `&pin mut T` syntax or `&mut pin T`, the latter of which applies equally well to `Box<pin T>` but requires an edition. No detailed updates available. **Organize Rust All-Hands 2025** **Why this goal?** May 15, 2025 marks the 10-year anniversary of Rust's 1.0 release; it also marks 10 years since the creation of the Rust subteams. At the time there were 6 Rust teams with 24 people in total. There are now 57 teams with 166 people. In-person All Hands meetings are an effective way to help these maintainers get to know one another with high-bandwidth discussions. This year, the Rust project will be coming together for RustWeek 2025, a joint event organized with RustNL. Participating project teams will use the time to share knowledge, make plans, or just get to know one another better. One particular goal for the All Hands is reviewing a draft of the Rust Vision Doc, a document that aims to take stock of where Rust is and lay out high-level goals for the next few years. **What has happened?** > * Invite more guests, after deciding on who else to invite. (To be discussed today in the council meeting.) > * Figure out if we can fund the travel+hotel costs for guests too. (To be discussed today in the council meeting.) > Mara has asked all attendees for suggestions for guests to invite. Based on that, Mara has invited roughly 20 guests so far. Only two of them needed funding for their travel, which we can cover from the same travel budget. > * Open the call for proposals for talks for the Project Track (on wednesday) as part of the RustWeek conference. > The Rust Project Track at RustWeek has been published: https://rustweek.org/schedule/wednesday/ This track is filled with talks that are relevant to folks attending the all-hands afterwards. 1 detailed update available. Comment by @m-ou-se posted on 2025-04-01: > > * Invite more guests, after deciding on who else to invite. (To be discussed today in the council meeting.) >> * Figure out if we can fund the travel+hotel costs for guests too. (To be discussed today in the council meeting.) >> > > I've asked all attendees for suggestions for guests to invite. Based on that, I've invited roughly 20 guests so far. Only two of them needed funding for their travel, which we can cover from the same travel budget. **Stabilize tooling needed by Rust for Linux** **Why this goal?** This goal continues our work from 2024H2 in supporting the experimental support for Rust development in the Linux kernel. Whereas in 2024H2 we were focused on stabilizing required language features, our focus in 2025H1 is stabilizing compiler flags and tooling options. We will (1) implement RFC #3716 which lays out a design for ABI-modifying flags; (2) take the first step towards stabilizing `build-std` by creating a stable way to rebuild core with specific compiler options; (3) extending rustdoc, clippy, and the compiler with features that extract metadata for integration into other build systems (in this case, the kernel's build system). **What has happened?** Most of the major items are in an iteration phase. The rustdoc changes for exporting doctests are the furthest along, with a working prototype; the RFL project has been integrating that prototype and providing feedback. Clippy stabilization now has a pre-RFC and there is active iteration towards support for build-std. Other areas of progress: * We have an open PR to stabilize `-Zdwarf-version`. * The lang and types team have been discussing the best path forward to resolve #136702. This is a soundness concern that was raised around certain casts, specifically, casts from a type like `*mut dyn Foo + '_` (with some lifetime) to `*mut dyn Foo + 'static` (with a static lifetime). Rust's defaulting rules mean that the latter is more commonly written with a defaulted lifetime, i.e., just `*mut dyn Foo`, which makes this an easy footgun. This kind of cast has always been dubious, as it disregards the lifetime in a rather subtle way, but when combined with arbitrary self types it permits users to disregard safety invariants making it hard to enforce soundness (see #136702 for details). The current proposal under discussion in #136776 is to make this sort of cast a hard error at least outside of an unsafe block; we evaluated the feasibility of doing a future-compatibility-warning and found it was infeasible. Crater runs suggest very limited fallout from this soundness fix but discussion continues about the best set of rules to adopt so as to balance minimizing fallout with overall language simplicity. 2 detailed updates available. Comment by @nikomatsakis posted on 2025-03-13: > Update from our 2025-03-12 meeting (full minutes): > > * RFL team requests someone to look at #138368 which is needed by kernel, @davidtwco to do so. > * `-Zbinary-dep-info` may not be needed; RFL may be able to emulate it. > * `rustdoc` changes for exporting doctests are being incorporated. @GuillaumeGomez is working on the kernel side of the feature too. @ojeda thinks it would be a good idea to do it in a way that does not tie both projects too much, so that `rustdoc` has more flexibility to change the output later on. > * Pre-RFC authored for clippy stabilization. > * Active iteration on the build-std design; feedback being provided by cargo team. > * @wesleywiser sent a PR to stabilize `-Zdwarf-version`. > * RfL doesn't use `cfg(no_global_oom_handling)` anymore. Soon, stable/LTS kernels that support several Rust versions will not use it either. Thus upstream Rust could potentially remove the `cfg` without breaking Linux, though other users like Windows may be still using it (#**t-libs >no_global_oom_handling removal**). > * Some discussion about best way forward for disabling orphan rule to allow experimentation with no firm conclusion. > Comment by @nikomatsakis posted on 2025-03-26: > Updates from today's meeting: > > ### Finalizing 2024h2 goals > > * asm-goto is now stabilized! will be released in 1.87. > * asm-const has a preliminary impl, gcc support is needed. > * While not used in RFL, `naked_asm` is not on the list but it will be moving forward for stabilization. It suffers from the same LLVM bug as `global_asm` forgetting target feature flags. > > > ### ABI-modifying compiler flags > > * Andrew Zhogin has opened a draft PR (https://github.com/rust-lang/rust/pull/138736) following Alice's issue about which santisers should be modifiers (https://github.com/rust-lang/rust/issues/138453) > > > ### Extract dependency information, configure no-std externally (-Zcrate-attr) > > * We decided we don't need to be able to extract dependency information > * `-Zcrate-attr` has an RFC from jyn: https://github.com/rust-lang/rfcs/pull/3791 > > > ### Rustdoc features to extract doc tests > > * No update. > > > ### Clippy configuration > > * Pre-RFC was published but hasn't (to our knowledge) made progress. Would be good to sync up on next steps with @flip1995. > > > ### Build-std > > * No update. Progress will resume next week when the contributor working on this returns from holiday. > > > ### `-Zsanitize-kcfi-arity` > > * Added this as a new deliverable. These kind of "emerging codegen flag" requests can be expected from time to time. Notes available here and here. > * The PR has been reviewed and is unblocked to land. > ## Goals looking for help **Promoting Parallel Front End** _Help wanted:_ Help test the deadlock code in the issue list and try to reproduce the issues. If you'd like to help, please post in this goal's dedicated zulip topic. 1 detailed update available. Comment by @SparrowLii posted on 2025-03-18: > * **Key developments:** Several deadlock issue that remain for more than a year were resolved by #137731 The new test suit for parallel front end is being improved > * **Blockers:** null > * **Help wanted:** Help test the deadlock code in the issue list and try to reproduce the issue > **Stabilize public/private dependencies** _Help wanted:_ T-compiler people to work on the blocking issues #119428 and #71043. If you'd like to help, please post in this goal's dedicated zulip topic. 1 detailed update available. Comment by @epage posted on 2025-03-17: > * Key developments: @tgross35 got rust-lang/rust#135501 merged which improved which made progress on rust-lang/rust#119428, one of the two main blockers. In rust-lang/rust#119428, we've further discussed further designs and trade offs. > * Blockers: Further work on rust-lang/rust#119428 and rust-lang/rust#71043 > * Help wanted: T-compiler people to work on those above issues. > ## Other goal updates **" Stabilizable" prototype for expanded const generics** 1 detailed update available. Comment by @BoxyUwU posted on 2025-03-17: > camelids PR has been merged, we now correctly (to the best of my knowledge) lower const paths under mgca. I have a PR open to ensure that we handle evaluation of paths to consts with generics or inference variables correctly, and that we do not attempt to evaluate constants before they have been checked to be well formed. I'm also currently mentoring someone to implement proper handling of normalization of inherent associated constants under mgca. **build-std** 1 detailed update available. Comment by @davidtwco posted on 2025-03-03: > A small update, @adamgemmell shared revisions to the aforementioned document, further feedback to which is being addressed. **Continue resolving `cargo-semver-checks` blockers for merging into cargo** Earlier this month, we completed one checkbox of the goal: `#[doc(hidden)]` in sealed trait analysis, live in `cargo-semver-checks` v0.40. We also made significant progress on type system modeling, which is part of two more checkboxes. * We shipped method receiver types in our schema, enabling more than a dozen new lints. * We have a draft schema for `?Sized` bounds, and are putting the finishing touches on `'static` and "outlives" bounds. More lints will follow here. * We also have a draft schema for the new `use<>` precise capturing syntax. Additionally, `cargo-semver-checks` is participating in Google Summer of Code, so this month we had the privilege of merging many contributions from new contributors who are considering applying for GSoC with us! We're looking forward to this summer, and would like to wish the candidates good luck in the application process! 1 detailed update available. Comment by @obi1kenobi posted on 2025-03-08: > **Key developments:** > > * Sealed trait analysis correctly handles `#[doc(hidden)]` items. This completes one checkbox of this goal! > * We shipped a series of lints detecting breakage in generic types, lifetimes, and const generics. One of them has already caught accidental breakage in the real world! > > > `cargo-semver-checks` v0.40, released today, includes a variety of improvements to sealed trait analysis. They can be summarized as "smarter, faster, more correct," and will have an immediate positive impact on popular crates such as `diesel` and `zerocopy`. > > While we already shipped a series of lints detecting generics-related breakage, more work is needed to complete that checkbox. This, and the "special cases like `'static` and `?Sized`", will be the focus of upcoming work. **Declarative ( `macro_rules!`) macro improvements** No detailed updates available. **Evaluate approaches for seamless interop between C++ and Rust** 1 detailed update available. Comment by @tmandry posted on 2025-03-25: > Since our last update, there has been talk of dedicating some time at the Rust All Hands for interop discussion; @baumanj and @tmandry are going to work on fleshing out an agenda. @cramertj and @tmandry brainstormed with @oli-obk (who was very helpful) about ways of supporting a more ambitious "template instantiation from Rust" goal, and this may get turned into a prototype at some point. **Experiment with ergonomic ref-counting** There is now an early prototype available that allows you to write `x.use`; if the type of `X` implements `UseCloned`, then this is equivalent to `x.clone()`, else it is equivalent to a move. This is not the desired end semantics in a few ways, just a step along the road. Nothing to see here (yet). 1 detailed update available. Comment by @nikomatsakis posted on 2025-03-17: > Update: rust-lang/rust#134797 has landed. > > Semantics as implemented in the PR: > > * Introduced a trait `UseCloned` implemented for `Rc` and `Arc` types. > * `x.use` checks whether `x`'s type `X` implements the `UseCloned` trait; if so, then `x.use` is equivalent to `x.clone()`, otherwise it is a copy/move of `x`; > * `use || ...x...` closures act like `move` closures but respect the `UseCloned` trait, so they will either `clone`, copy, or move `x` as appropriate. > > > Next steps: > > * Modify codegen so that we guarantee that `x.use` will do a copy if `X: Copy` is true after monomorphization. Right now the desugaring to `clone` occurs before monomorphization and hence it will call the `clone` method even for those instances where `X` is a `Copy` type. > * Convert `x.use` to a move rather than a clone if this is a last-use. > * Make `x` equivalent to `x.use` but with an (allow-by-default) lint to signal that something special is happened. > > > Notable decisions made and discussions: > > * Opted to name the trait that controls whether `x.use` does a clone or a move `UseCloned` rather than `Use`. This is because the trait does not control whether or not you can use something but rather controls what happens when you do. > * Question was raised on Zulip as to whether `x.use` should auto-deref. After thinking it over, reached the conclusion that it should not, because `x` and `x.use` should eventually behave the same modulo lints, but that (as ever) a `&T -> T` coercion would be useful for ergonomic reasons. > **Expose experimental LLVM features for GPU offloading** 1 detailed update available. Comment by @ZuseZ4 posted on 2025-03-25: > I just noticed that I missed my February update, so I'll keep this update a bit more high-level, to not make it too long. > > **Key developments:** > > 1. All key autodiff PRs got merged. So after building `rust-lang/rust` with the autodiff feature enabled, users can now use it, without the need for any custom fork. > 2. std::autodiff received the first PRs from new contributors, which have not been previously involved in rustc development! My plan is to grow a team to maintain this feature, so that's a great start. The PRs are here, here and here. Over time I hope to hand over increasingly larger issues. > 3. I received an offer to join the Rust compiler team, so now I can also officially review and approve PRs! For now I'll focus on reviewing PRs in the fields I'm most comfortable with, so autodiff, batching, and soon GPU offload. > 4. I implemented a standalone batching feature. It was a bit larger (~2k LoC) and needed some (back then unmerged) autodiff PRs, since they both use the same underlying Enzyme infrastructure. I therefore did not push for merging it. > 5. I recently implemented batching as part of the autodiff macro, for people who want to use both together. I subsequently split out a first set of code improvements and refactorings, which already got merged. The remaining autodiff feature PR is only 600 loc, so I'm currently cleaning it up for review. > 6. I spend time preparing an MCP to enable autodiff in CI (and therefore nightly). I also spend a lot of time discussing a potential MLIR backend for rustc. Please reach out if you want to be involved! > > > **Help wanted: ** We want to support autodiff in lib builds, instead of only binaries. oli-obk and I recently figured out the underlying bug, and I started with a PR in https://github.com/rust-lang/rust/pull/137570. The problem is that autodiff assumes fat-lto builds, but lib builds compile some of the library code using thin-lto, even if users specify `lto=fat` in their Cargo.toml. We'd want to move every thing to fat-lto if we enable Autodiff as a temporary solution, and later move towards embed-bc as a longer-term solution. If you have some time to help please reach out! Some of us have already looked into it a little but got side-tracked, so it's better to talk first about which code to re-use, rather than starting from scratch. > > I also booked my RustWeek ticket, so I'm happy to talk about all types of Scientific Computing, HPC, ML, or cursed Rust(c) and LLVM internals! Please feel free to dm me if you're also going and want to meet. **Extend pubgrub to match cargo 's dependency resolution** 1 detailed update available. Comment by @Eh2406 posted on 2025-03-14: > Progress continues to be stalled by high priority tasks for $DAY_JOB. It continues to be unclear when the demands of work will allow me to return focus to this project. **Externally Implementable Items** No detailed updates available. **Finish the libtest json output experiment** 1 detailed update available. Comment by @epage posted on 2025-03-17: > * Key developments: > * Between tasks on #92, I've started to refresh myself on the libtest-next code base > * Blockers: > * Help wanted: > **Implement Open API Namespace Support** No detailed updates available. **Implement restrictions, prepare for stabilization** No detailed updates available. **Improve state machine codegen** We've started work on implementing `#loop_match]` on this branch. For the time being integer and enum patterns are supported. The [benchmarks, are extremely encouraging, showing large improvements over the status quo, and significant improvements versus `-Cllvm-args=-enable-dfa-jump-thread`. Our next steps can be found in the todo file, and focus mostly on improving the code quality and robustness. 3 detailed updates available. Comment by @folkertdev posted on 2025-03-18: > @traviscross how would we make progress on that? So far we've mostly been talking to @joshtriplett, under the assumption that a `#[loop_match]` attribute on loops combined with a `#[const_continue]` attribute on "jumps to the next iteration" will be acceptable as a language experiment. > > Our current implementation handles the following > > > #![feature(loop_match)] enum State { A, B, } fn main() { let mut state = State::A; #[loop_match] 'outer: loop { state = 'blk: { match state { State::A => { #[const_continue] break 'blk State::B } State::B => break 'outer, } } } } > > Crucially, this does not add syntax, only the attributes and internal logic in MIR lowering for statically performing the pattern match to pick the right branch to jump to. > > The main challenge is then to implement this in the compiler itself, which we've been working on (I'll post our tl;dr update shortly) Comment by @folkertdev posted on 2025-03-18: > Some benchmarks (as of march 18th) > > A benchmark of https://github.com/bjorn3/comrak/blob/loop_match_attr/autolink_email.rs, basically a big state machine that is a perfect fit for loop match > > > Benchmark 1: ./autolink_email Time (mean Β± Οƒ): 1.126 s Β± 0.012 s [User: 1.126 s, System: 0.000 s] Range (min … max): 1.105 s … 1.141 s 10 runs Benchmark 2: ./autolink_email_llvm_dfa Time (mean Β± Οƒ): 583.9 ms Β± 6.9 ms [User: 581.8 ms, System: 2.0 ms] Range (min … max): 575.4 ms … 591.3 ms 10 runs Benchmark 3: ./autolink_email_loop_match Time (mean Β± Οƒ): 411.4 ms Β± 8.8 ms [User: 410.1 ms, System: 1.3 ms] Range (min … max): 403.2 ms … 430.4 ms 10 runs Summary ./autolink_email_loop_match ran 1.42 Β± 0.03 times faster than ./autolink_email_llvm_dfa 2.74 Β± 0.07 times faster than ./autolink_email > > `#[loop_match]` beats the status quo, but also beats the llvm flag by a large margin. > > * * * > > A benchmark of zlib decompression with chunks of 16 bytes (this makes the impact of `loop_match` more visible) > > > Benchmark 1 (65 runs): target/release/examples/uncompress-baseline rs-chunked 4 measurement mean Β± Οƒ min … max outliers delta wall_time 77.7ms Β± 3.04ms 74.6ms … 88.9ms 9 (14%) 0% peak_rss 24.1MB Β± 64.6KB 24.0MB … 24.2MB 0 ( 0%) 0% cpu_cycles 303M Β± 11.8M 293M … 348M 9 (14%) 0% instructions 833M Β± 266 833M … 833M 0 ( 0%) 0% cache_references 3.62M Β± 310K 3.19M … 4.93M 1 ( 2%) 0% cache_misses 209K Β± 34.2K 143K … 325K 1 ( 2%) 0% branch_misses 4.09M Β± 10.0K 4.08M … 4.13M 5 ( 8%) 0% Benchmark 2 (68 runs): target/release/examples/uncompress-llvm-dfa rs-chunked 4 measurement mean Β± Οƒ min … max outliers delta wall_time 74.0ms Β± 3.24ms 70.6ms … 85.0ms 4 ( 6%) πŸš€- 4.8% Β± 1.4% peak_rss 24.1MB Β± 27.1KB 24.0MB … 24.1MB 3 ( 4%) - 0.1% Β± 0.1% cpu_cycles 287M Β± 12.7M 277M … 330M 4 ( 6%) πŸš€- 5.4% Β± 1.4% instructions 797M Β± 235 797M … 797M 0 ( 0%) πŸš€- 4.3% Β± 0.0% cache_references 3.56M Β± 439K 3.08M … 5.93M 2 ( 3%) - 1.8% Β± 3.6% cache_misses 144K Β± 32.5K 83.7K … 249K 2 ( 3%) πŸš€- 31.2% Β± 5.4% branch_misses 4.09M Β± 9.62K 4.07M … 4.12M 1 ( 1%) - 0.1% Β± 0.1% Benchmark 3 (70 runs): target/release/examples/uncompress-loop-match rs-chunked 4 measurement mean Β± Οƒ min … max outliers delta wall_time 71.6ms Β± 2.43ms 69.3ms … 78.8ms 6 ( 9%) πŸš€- 7.8% Β± 1.2% peak_rss 24.1MB Β± 72.8KB 23.9MB … 24.2MB 20 (29%) - 0.0% Β± 0.1% cpu_cycles 278M Β± 9.59M 270M … 305M 7 (10%) πŸš€- 8.5% Β± 1.2% instructions 779M Β± 277 779M … 779M 0 ( 0%) πŸš€- 6.6% Β± 0.0% cache_references 3.49M Β± 270K 3.15M … 4.17M 4 ( 6%) πŸš€- 3.8% Β± 2.7% cache_misses 142K Β± 25.6K 86.0K … 197K 0 ( 0%) πŸš€- 32.0% Β± 4.8% branch_misses 4.09M Β± 7.83K 4.08M … 4.12M 1 ( 1%) + 0.0% Β± 0.1% Benchmark 4 (69 runs): target/release/examples/uncompress-llvm-dfa-loop-match rs-chunked 4 measurement mean Β± Οƒ min … max outliers delta wall_time 72.8ms Β± 2.57ms 69.7ms … 80.0ms 7 (10%) πŸš€- 6.3% Β± 1.2% peak_rss 24.1MB Β± 35.1KB 23.9MB … 24.1MB 2 ( 3%) - 0.1% Β± 0.1% cpu_cycles 281M Β± 10.1M 269M … 312M 5 ( 7%) πŸš€- 7.5% Β± 1.2% instructions 778M Β± 243 778M … 778M 0 ( 0%) πŸš€- 6.7% Β± 0.0% cache_references 3.45M Β± 277K 2.95M … 4.14M 0 ( 0%) πŸš€- 4.7% Β± 2.7% cache_misses 176K Β± 43.4K 106K … 301K 0 ( 0%) πŸš€- 15.8% Β± 6.3% branch_misses 4.16M Β± 96.0K 4.08M … 4.37M 0 ( 0%) πŸ’©+ 1.7% Β± 0.6% > > The important points: `loop-match` is faster than `llfm-dfa`, and when combined performance is worse than when using `loop-match` on its own. Comment by @traviscross posted on 2025-03-18: > Thanks for that update. Have reached out separately. **Instrument the Rust standard library with safety contracts** 1 detailed update available. Comment by @celinval posted on 2025-03-17: > We have been able to merge the initial support for contracts in the Rust compiler under the `contracts` unstable feature. @tautschnig has created the first PR to incorporate contracts in the standard library and uncovered a few limitations that we've been working on. **Making compiletest more maintainable: reworking directive handling** 1 detailed update available. Comment by @jieyouxu posted on 2025-03-15: > Update (2025-03-15): > > * Doing a survey pass on compiletest to make sure I have the full picture. > **Metrics Initiative** 1 detailed update available. Comment by @yaahc posted on 2025-03-03: > After further review I've decided to limit scope initially and not get ahead of myself so I can make sure the schemas I'm working with can support the kind of queries and charts we're going to eventually want in the final version of the unstable feature usage metric. I'm hoping that by limiting scope I can have most of the items currently outlined in this project goal done ahead of schedule so I can move onto building the proper foundations based on the proof of concept and start to design more permanent components. As such I've opted for the following: > > * minimal change to the current JSON format I need, which is including the timestamp > * Gain clarity on exactly what questions I should be answering with the unstable feature usage metrics, the desired graphs and tables, and how this influences what information I need to gather and how to construct the appropriate queries within graphana > * gathering a sample dataset from docs.rs rather than viewing it as the long term integration, since there are definitely some sampleset bias issues in that dataset from initial conversations with docs.rs > * Figure out proper hash/id to use in the metrics file names to avoid collisions with different conditional compilation variants of the same crate with different feature enabled. > > > For the second item above I need to have more detailed conversations with both @rust-lang/libs-api and @rust-lang/lang **Model coherence in a-mir-formality** 1 detailed update available. Comment by @nikomatsakis posted on 2025-03-17: > Update: > > @tiif has been working on integrating const-generic effects into a-mir-formality and making good progress. > > I have begun exploring integration of the MiniRust definition of MIR. This doesn't directly work towards the goal of modeling coherence but it will be needed for const generic work to be effective. > > I am considering some simplification and cleanup work as well. **Next-generation trait solver** 1 detailed update available. Comment by @lcnr posted on 2025-03-17: > The two cycle handling PRs mentioned in the previous update have been merged, allowing `nalgebra` to compile with the new solver enabled. I have now started to work on opaque types in borrowck again. This is a quite involved issue and will likely take a few more weeks until it's fully implemented. **Nightly support for ergonomic SIMD multiversioning** 1 detailed update available. Comment by @veluca93 posted on 2025-03-17: > Key developments: Started investigating how the proposed SIMD multiversioning options might fit in the context of the efforts for formalizing a Rust effect system **Null and enum-discriminant runtime checks in debug builds** No detailed updates available. **Optimizing Clippy & linting** 1 detailed update available. Comment by @blyxyas posted on 2025-03-17: > Monthly update! > > * https://github.com/rust-lang/rust-clippy/issues/13821 has been merged. This has successfully optimized the MSRV extraction from the source code. > > > On the old MSRV extraction,`Symbol::intern` use was sky high being about 3.5 times higher than the rest of the compilation combined. Now, it's at normal levels. Note that `Symbol::intern` is a very expensive and locking function, so this is very notable. Thanks to @Alexendoo for this incredible work! > > As a general note on the month, I'd say that we've experimented a lot. > > * Starting efforts on parallelizing the lint system. > * https://github.com/rust-lang/rust-clippy/issues/14423 Started taking a deeper look into our dependence on `libLLVM.so` and heavy relocation problems. > * I took a look into heap allocation optimization, seems that we are fine. For the moment, rust-clippy#14423 is the priority. > **Prepare const traits for stabilization** 1 detailed update available. Comment by @oli-obk posted on 2025-03-20: > I opened an RFC (https://github.com/rust-lang/rfcs/pull/3762) and we had a lang team meeting about it. Some design exploration and bikeshedding later we have settled on using (const)instead of ~const along with some more annotations for explicitness and some fewer annotations in other places. The RFC has been updated accordingly. There is still ongoing discussions about reintroducing the "fewer annotations" for redundancy and easier processing by humans. **Prototype a new set of Cargo "plumbing" commands** No detailed updates available. **Publish first rust-lang-owned release of "FLS"** 2 detailed updates available. Comment by @JoelMarcey posted on 2025-03-14: > Key Developments: Working on a public announcement of Ferrous' contribution of the FLS. Goal is to have that released soon. Also working out the technical details of the contribution, particularly around how to initially integrate the FLS into the Project itself. > > Blockers: None yet. Comment by @JoelMarcey posted on 2025-04-01: > Key Developments: Public announcement of the FLS donation to the Rust Project. > > Blockers: None **Publish first version of StableMIR on crates.io** 2 detailed updates available. Comment by @celinval posted on 2025-03-20: > We have proposed a project idea to Google Summer of Code to implement the refactoring and infrastructure improvements needed for this project. I'm working on breaking down the work into smaller tasks so they can be implemented incrementally. Comment by @celinval posted on 2025-03-20: > I am also happy to share that @makai410 is joining us in this effort! πŸ₯³ **Research: How to achieve safety when linking separately compiled code** No detailed updates available. **Run the 2025H1 project goal program** 2 detailed updates available. Comment by @nikomatsakis posted on 2025-03-03: > Update: February goal update has been posted. We made significant revisions to the way that goal updates are prepared. If you are a goal owner, it's worth reading the directions for how to report your status, especially the part about help wanted and summary comments. Comment by @nikomatsakis posted on 2025-03-17: > Update: We sent out the first round of pings for the March update. The plan is to create the document on **March 25th** , so @rust-lang/goal-owners please get your updates in by then. Note that you can create a TL;DR comment if you want to add 2-3 bullet points that will be embedded directly into the final blog post. > > In terms of goal planning: > > * @nandsh is planning to do a detailed retrospective on the goals program in conjunction with her research at CMU. Please reach out to her on Zulip (**Nandini**) if you are interested in participating. > * We are planning to overhaul the ping process as described in this hackmd. In short, pings will come on the 2nd/3rd Monday of the month. No pings will be sent if you've posted a comment that month. The blog post will be prepared on the 3rd Friday. > * We've been discussing how to structure 2025H2 goals and are thinking of making a few changes. We'll break out three categories of goals (Flagship / Core / Stretch), with "Core" goals being those deemed most important. We'll also have a 'pre-read' before the RFC opens with team leads to look for cross-team collaborative opportunities. At least that's the _current_ plan. > **Rust Vision Document** * We drafted a Rust Vision Doc Action Plan. * We expect to publish our announcement blog post by end of Month including a survey requesting volunteers to speak with us. We are also creating plans for interviews with company contacts, global community groups, and Rust maintainers. 1 detailed update available. Comment by @nikomatsakis posted on 2025-03-17: > Update: > > I've asked @jackh726 to co-lead the team with me. Together we pulled together a Rust Vision Doc action plan. > > The plan begins by posting a blog post (draft available here) announcing the effort. We are coordinating with the Foundation to create a survey which will be linked from the blog post. The survey questions ask about user's experience but also look for volunteers we can speak with. > > We are pulling together the team that will perform the interviewing. We've been in touch with UX reseearchers who will brief us on some of the basics of UX research. We're finalizing team membership now plus the set of focus areas, we expect to cover at least users/companies, Rust project maintainers, and Rust global communities. See the Rust Vision Doc action plan for more details. **rustc-perf improvements** 1 detailed update available. Comment by @davidtwco posted on 2025-03-03: > A small update, @Jamesbarford aligned with @kobzol on a high-level architecture and will begin fleshing out the details and making some small patches to rustc-perf to gain familiarity with the codebase. **Scalable Polonius support on nightly** 1 detailed update available. Comment by @lqd posted on 2025-03-24: > Here are the key developments for this update. > > Amanda has continued on the placeholder removal task. In particular on the remaining issues with rewritten type tests. The in-progress work caused incorrect errors to be emitted under the rewrite scheme, and a new strategy to handle these was discussed. This has been implemented in the PR, and seems to work as hoped. So the PR should now be in a state that is ready for more in-depth review pass, and should hopefully land soon. > > Tage has started his master's thesis with a focus on the earliest parts of the borrow checking process, in order to experiment with graded borrow-checking, incrementalism, avoiding work that's not needed for loans that are not invalidated, and so on. A lot of great progress has been made on these parts already, and more are being discussed even in the later areas (live and active loans). > > I have focused on taking care of the remaining diagnostics and test failures of the location-sensitive analysis. For diagnostics in particular, the PRs mentioned in the previous updates have landed, and I've fixed a handful of NLL spans, all the remaining differences under the compare-mode, and blessed differences that were improvements. For the test failures, handling liveness differently in traversal fixed most of the remaining failures, while a couple are due to the friction with mid-points avoidance scheme. For these, we have a few different paths forward, but with different trade-offs and we'll be discussing and evaluation these in the very near future. Another two are still left to analyze in-depth to see what's going on. > > Our near future focus will be to continue down the path to correctness while also expanding test coverage that feels lacking in certain very niche areas, and that we want to improve. At the same time, we'll also work on a figuring out a better architecture to streamline the entire end-to-end process, to allow early outs, avoid work that is not needed, etc. **Secure quorum-based cryptographic verification and mirroring for crates.io** No detailed updates available. **Stabilize cargo-script** 1 detailed update available. Comment by @lqd posted on 2025-03-26: > This project goal was actually carried over from 2024h2, in https://github.com/rust-lang/rust-project-goals/pull/294 **SVE and SME on AArch64** 2 detailed updates available. Comment by @davidtwco posted on 2025-03-03: > A small update, we've opened a draft PR for the initial implementation of this - rust-lang/rust#137944. Otherwise, just continued to address feedback on the RFCs. Comment by @davidtwco posted on 2025-03-18: > * We've been resolving review feedback on the implementation of the Sized Hierarchy RFC on rust-lang/rust#137944. We're also working on reducing the performance regression in the PR, by avoiding unnecessary elaboration of sizedness supertraits and extending the existing `Sized` case in `type_op_prove_predicate` query's fast path. > * There's not been any changes to the RFC, there's minor feedback that has yet to be responded to, but it's otherwise just waiting on t-lang. > * We've been experimenting with rebasing rust-lang/rust#118917 on top of rust-lang/rust#137944 to confirm that const sizedness allows us to remove the type system exceptions that the SVE implementation previously relied on. We're happy to confirm that it does. > **Unsafe Fields** No detailed updates available. **Use annotate-snippets for rustc diagnostic output** 1 detailed update available. Comment by @Muscraft posted on 2025-03-31: > While my time was limited these past few months, lots of progress was made! I was able to align `annotate-snippets` internals with `rustc`'s `HumanEmitter` and get the new API implemented. These changes have not been merged yet, but they can be found here. As part of this work, I got `rustc` using `annotate-snippets` as its only renderer. During all of this, I started working on making `rustc` use `annotate-snippets` as its only renderer, which turned out to be a huge benefit. I was able to get a feel for the new API while addressing rendering divergences. As of the time of writing, all but ~30 tests of the roughly 18,000 UI tests are passing. > > > test result: FAILED. 18432 passed; 29 failed; 193 ignored; 0 measured; 0 filtered out; finished in 102.32s > > Most of the failing tests are caused by a few things: > > * `annotate-snippets` right aligns numbers, whereas `rustc` left aligns > * `annotate-snippets` doesn't handle multiple suggestions for the same span very well > * Problems with handling `FailureNote` > * `annotate-snippets` doesn't currently support colored labels and titles, i.e., the magenta highlight `rustc` uses > * `rustc` wants to pass titles similar to `error: internal compiler error[E0080]`, but `annotate-snippets` doesn't support that well > * differences in how `rustc` and `annotate-snippets` handle term width during tests > * When testing, `rustc` uses `DEFAULT_COLUMN_WIDTH` and does not subtract the code offset, while `annotate-snippets` does > * Slight differences in how "newline"/end of line highlighting is handled > * JSON output rendering contains color escapes >
08.04.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
C ABI Changes for `wasm32-unknown-unknown` The `extern "C"` ABI for the `wasm32-unknown-unknown` target has been using a non-standard definition since the inception of the target in that it does not implement the official C ABI of WebAssembly and it additionally leaks internal compiler implementation details of both the Rust compiler and LLVM. This will change in a future version of the Rust compiler and the official C ABI will be used instead. This post details some history behind this change and the rationale for why it's being announced here, but you can skip straight to "Am I affected?" as well. ## History of `wasm32-unknown-unknown`'s C ABI When the `wasm32-unknown-unknown` target was originally added in 2017, not much care was given to the exact definition of the `extern "C"` ABI at the time. In 2018 an ABI definition was added just for wasm and the target is still using this definition to this day. This definitions has become more and more problematic over time and while some issues have been fixed, the root cause still remains. Notably this ABI definition does not match the tool-conventions definition of the C API, which is the current standard for how WebAssembly toolchains should talk to one another. Originally this non-standard definition was used for all WebAssembly based targets except Emscripten, but this changed in 2021 where the WASI targets for Rust use a corrected ABI definition. Still, however, the non-standard definition remained in use for `wasm32-unknown-unknown`. The time has now come to correct this historical mistake and the Rust compiler will soon be using a correct ABI definition for the `wasm32-unknown-unknown` target. This means, however, that generated WebAssembly binaries will be different than before. ## What is a WebAssembly C ABI? The definition of an ABI answers questions along the lines of: * What registers are arguments passed in? * What registers are results passed in? * How is a 128-bit integers passed as an argument? * How is a `union` passed as a return value? * When are parameters passed through memory instead of registers? * What is the size and alignment of a type in memory? For WebAssembly these answers are a little different than native platforms. For example, WebAssembly does not have physical registers and functions must all be annotated with a type. What WebAssembly does have is types such as `i32`, `i64`, `f32`, and `f64`. This means that for WebAssembly an ABI needs to define how to represent values in these types. This is where the tool-conventions document comes in. That document provides a definition for how to represent primitives in C in the WebAssembly format, and additionally how function signatures in C are mapped to function signatures in WebAssembly. For example a Rust `u32` is represented by a WebAssembly `i32` and is passed directly as a parameter as a function argument. If the Rust structure `#[repr(C)] struct Pair(f32, f64)` is returned from a function then a return pointer is used which must have alignment 8 and size of 16 bytes. In essence, the WebAssembly C ABI is acting as a bridge between C's type system and the WebAssembly type system. This includes details such as in-memory layouts and translations of a C function signature to a WebAssembly function signature. ## How is `wasm32-unknown-unknown` non-standard? Despite the ABI definition today being non-standard, many aspects of it are still the same as what tool-conventions specifies. For example, size/alignment of types is the same as it is in C. The main difference is how function signatures are calculated. An example (where you can follow along on godbolt) is: #[repr(C)] pub struct Pair { x: u32, y: u32, } #[unsafe(no_mangle)] pub extern "C" fn pair_add(pair: Pair) -> u32 { pair.x + pair.y } This will generate the following WebAssembly function: (func $pair_add (param i32 i32) (result i32) local.get 1 local.get 0 i32.add ) Notably you can see here that the struct `Pair` was "splatted" into its two components so the actual `$pair_add` function takes two arguments, the `x` and `y` fields. The tool-conventions, however specifically says that "other struct[s] or union[s]" are passed indirectly, notably through memory. We can see this by compiling this C code: struct Pair { unsigned x; unsigned y; }; unsigned pair_add(struct Pair pair) { return pair.x + pair.y; } which yields the generated function: (func (param i32) (result i32) local.get 0 i32.load offset=4 local.get 0 i32.load i32.add ) Here we can see, sure enough, that `pair` is passed in linear memory and this function only has a single argument, not two. This argument is a pointer into linear memory which stores the `x` and `y` fields. The Diplomat project has compiled a much more comprehensive overview than this and it's recommended to check that out if you're curious for an even deeper dive. ## Why hasn't this been fixed long ago already? For `wasm32-unknown-unknown` it was well-known at the time in 2021 when WASI's ABI was updated that the ABI was non-standard. Why then has the ABI not been fixed like with WASI? The main reason originally for this was the wasm-bindgen project. In `wasm-bindgen` the goal is to make it easy to integrate Rust into a web browser with WebAssembly. JavaScript is used to interact with host APIs and the Rust module itself. Naturally, this communication touches on a lot of ABI details! The problem was that `wasm-bindgen` relied on the above example, specifically having `Pair` "splatted" across arguments instead of passed indirectly. The generated JS wouldn't work correctly if the argument was passed in-memory. At the time this was discovered it was found to be significantly difficult to fix `wasm-bindgen` to not rely on this splatting behavior. At the time it also wasn't thought to be a widespread issue nor was it costly for the compiler to have a non-standard ABI. Over the years though the pressure has mounted. The Rust compiler is carrying an ever-growing list of hacks to work around the non-standard C ABI on `wasm32-unknown-unknown`. Additionally more projects have started to rely on this "splatting" behavior and the risk has gotten greater that there are more unknown projects relying on the non-standard behavior. In late 2023 the wasm-bindgen project fixed bindings generation to be unaffected by the transition to the standard definition of `extern "C"`. In the following months a future-incompat lint was added to rustc to specifically migrate users of old `wasm-bindgen` versions to a "fixed" version. This was in anticipation of changing the ABI of `wasm32-unknown-unknown` once enough time had passed. Since early 2025 users of old `wasm-bindgen` versions will now receive a hard error asking them to upgrade. Despite all this heroic effort done by contributors, however, it has now come to light that there are more projects than `wasm-bindgen` relying on this non-standard ABI definition. Consequently this blog post is intended to serve as a notice to other users on `wasm32-unknown-unknown` that the ABI break is upcoming and projects may need to be changed. ## Am I affected? If you don't use the `wasm32-unknown-unknown` target, you are not affected by this change. If you don't use `extern "C"` on the `wasm32-unknown-unknown` target, you are also not affected. If you fall into this bucket, however, you may be affected! To determine the impact to your project there are a few tools at your disposal: * A new future-incompat warning has been added to the Rust compiler which will issue a warning if it detects a signature that will change when the ABI is changed. * In 2023 a `-Zwasm-c-abi=(legacy|spec)` flag was added to the Rust compiler. This defaults to `-Zwasm-c-abi=legacy`, the non-standard definition. Code can use `-Zwasm-c-abi=spec` to use the standard definition of the C ABI for a crate to test out if changes work. The best way to test your crate is to compile with `nightly-2025-03-27` or later, ensure there are no warnings, and then test your project still works with `-Zwasm-c-abi=spec`. If all that passes then you're good to go and the upcoming change to the C ABI will not affect your project. ## I'm affected, now what? So you're using `wasm32-unknown-unknown`, you're using `extern "C"`, and the nightly compiler is giving you warnings. Additionally your project is broken when compiled with` -Zwasm-c-abi=spec`. What now? At this time this will unfortunately be a somewhat rough transition period for you. There are a few options at your disposal but they all have their downsides: 1. Pin your Rust compiler version to the current stable, don't update until the ABI has changed. This means that you won't get any compiler warnings (as old compilers don't warn) and additionally you won't get broken when the ABI changes (as you're not changing compilers). Eventually when you update to a stable compiler with `-Zwasm-c-abi=spec` as the default you'll have to port your JS or bindings to work with the new ABI. 2. Update to Rust nightly as your compiler and pass `-Zwasm-c-abi=spec`. This is front-loading the work required in (1) for your target. You can get your project compatible with `-Zwasm-c-abi=spec` today. The downside of this approach is that your project will only work with a nightly compiler and `-Zwasm-c-abi=spec` and you won't be able to use stable until the default is switched. 3. Update your project to not rely on the non-standard behavior of `-Zwasm-c-abi=legacy`. This involves, for example, not passing structs-by-value in parameters. You can pass `&Pair` above, for example, instead of `Pair`. This is similar to (2) above where the work is done immediately to update a project but has the benefit of continuing to work on stable Rust. The downside of this, however, is that you may not be able to easily change or update your C ABI in some situations. 4. Update to Rust nightly as your compiler and pass `-Zwasm-c-abi=legacy`. This will silence compiler warnings for now but be aware that the ABI will still change in the future and the `-Zwasm-c-abi=legacy` option will be removed entirely. When the `-Zwasm-c-abi=legacy` option is removed the only option will be the standard C ABI, what `-Zwasm-c-abi=spec` today enables. If you have uncertainties, questions, or difficulties, feel free to reach out on the tracking issue for the future-incompat warning or on Zulip. ## Timeline of ABI changes At this time there is not an exact timeline of how the default ABI is going to change. It's expected to take on the order of 3-6 months, however, and will look something roughly like this: * 2025 March: (soon) - a future-incompat warning will be added to the compiler to warn projects if they're affected by this ABI change. * 2025-05-15: this future-incompat warning will reach the stable Rust channel as 1.87.0. * 2025 Summer: (ish) - the `-Zwasm-c-abi` flag will be removed from the compiler and the `legacy` option will be entirely removed. Exactly when `-Zwasm-c-abi` is removed will depend on feedback from the community and whether the future-incompat warning triggers much. It's hoped that soon after the Rust 1.87.0 is stable, though, that the old legacy ABI behavior can be removed.
04.04.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.86.0 The Rust team is happy to announce a new version of Rust, 1.86.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.86.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.86.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.86.0 stable ### Trait upcasting This release includes a long awaited feature β€” the ability to upcast trait objects. If a trait has a supertrait you can coerce a reference to said trait object to a reference to a trait object of the supertrait: trait Trait: Supertrait {} trait Supertrait {} fn upcast(x: &dyn Trait) -> &dyn Supertrait { x } The same would work with any other kind of (smart-)pointer, like `Arc<dyn Trait> -> Arc<dyn Supertrait>` or `*const dyn Trait -> *const dyn Supertrait`. Previously this would have required a workaround in the form of an `upcast` method in the `Trait` itself, for example `fn as_supertrait(&self) -> &dyn Supertrait`, and this would work only for one kind of reference/pointer. Such workarounds are not necessary anymore. Note that this means that raw pointers to trait objects carry a non-trivial invariant: "leaking" a raw pointer to a trait object with an invalid vtable into safe code may lead to undefined behavior. It is not decided yet whether creating such a raw pointer temporarily in well-controlled circumstances causes immediate undefined behavior, so code should refrain from creating such pointers under any conditions (and Miri enforces that). Trait upcasting may be especially useful with the `Any` trait, as it allows upcasting your trait object to `dyn Any` to call `Any`'s downcast methods, without adding any trait methods or using external crates. use std::any::Any; trait MyAny: Any {} impl dyn MyAny { fn downcast_ref<T>(&self) -> Option<&T> { (self as &dyn Any).downcast_ref() } } You can learn more about trait upcasting in the Rust reference. ### `HashMap`s and slices now support indexing multiple elements mutably The borrow checker prevents simultaneous usage of references obtained from repeated calls to `get_mut` methods. To safely support this pattern the standard library now provides a `get_disjoint_mut` helper on slices and `HashMap` to retrieve mutable references to multiple elements simultaneously. See the following example taken from the API docs of `slice::get_disjoint_mut`: let v = &mut [1, 2, 3]; if let Ok([a, b]) = v.get_disjoint_mut([0, 2]) { *a = 413; *b = 612; } assert_eq!(v, &[413, 2, 612]); if let Ok([a, b]) = v.get_disjoint_mut([0..1, 1..3]) { a[0] = 8; b[0] = 88; b[1] = 888; } assert_eq!(v, &[8, 88, 888]); if let Ok([a, b]) = v.get_disjoint_mut([1..=2, 0..=0]) { a[0] = 11; a[1] = 111; b[0] = 1; } assert_eq!(v, &[1, 11, 111]); ### Allow safe functions to be marked with the `#[target_feature]` attribute. Previously only `unsafe` functions could be marked with the `#[target_feature]` attribute as it is unsound to call such functions without the target feature being enabled. This release stabilizes the `target_feature_11` feature, allowing _safe_ functions to be marked with the `#[target_feature]` attribute. Safe functions marked with the target feature attribute can only be safely called from other functions marked with the target feature attribute. However, they cannot be passed to functions accepting generics bounded by the `Fn*` traits and only support being coerced to function pointers inside of functions marked with the `target_feature` attribute. Inside of functions not marked with the target feature attribute they can be called inside of an `unsafe` block, however it is the caller's responsibility to ensure that the target feature is available. #[target_feature(enable = "avx2")] fn requires_avx2() { // ... snip } #[target_feature(enable = "avx2")] fn safe_callsite() { // Calling `requires_avx2` here is safe as `safe_callsite` // requires the `avx2` feature itself. requires_avx2(); } fn unsafe_callsite() { // Calling `requires_avx2` here is unsafe, as we must // ensure that the `avx2` feature is available first. if is_x86_feature_detected!("avx2") { unsafe { requires_avx2() }; } } You can check the `target_features_11` RFC for more information. ### Debug assertions that pointers are non-null when required for soundness The compiler will now insert debug assertions that a pointer is not null upon non-zero-sized reads and writes, and also when the pointer is reborrowed into a reference. For example, the following code will now produce a non-unwinding panic when debug assertions are enabled: let _x = *std::ptr::null::<u8>(); let _x = &*std::ptr::null::<u8>(); Trivial examples like this have produced a warning since Rust 1.53.0, the new runtime check will detect these scenarios regardless of complexity. These assertions only take place when debug assertions are enabled which means that they **must not** be relied upon for soundness. This also means that dependencies which have been compiled with debug assertions disabled (e.g. the standard library) will not trigger the assertions even when called by code with debug assertions enabled. ### Make `missing_abi` lint warn by default Omitting the ABI in extern blocks and functions (e.g. `extern {}` and `extern fn`) will now result in a warning (via the `missing_abi` lint). Omitting the ABI after the `extern` keyword has always implicitly resulted in the `"C"` ABI. It is now recommended to explicitly specify the `"C"` ABI (e.g. `extern "C" {}` and `extern "C" fn`). You can check the Explicit Extern ABIs RFC for more information. ### Target deprecation warning for 1.87.0 The tier-2 target `i586-pc-windows-msvc` will be removed in the next version of Rust, 1.87.0. Its difference to the much more popular `i686-pc-windows-msvc` is that it does not require SSE2 instruction support, but Windows 10, the minimum required OS version of all `windows` targets (except the `win7` targets), requires SSE2 instructions itself. All users currently targeting `i586-pc-windows-msvc` should migrate to `i686-pc-windows-msvc` before the `1.87.0` release. You can check the Major Change Proposal for more information. ### Stabilized APIs * `{float}::next_down` * `{float}::next_up` * `<[_]>::get_disjoint_mut` * `<[_]>::get_disjoint_unchecked_mut` * `slice::GetDisjointMutError` * `HashMap::get_disjoint_mut` * `HashMap::get_disjoint_unchecked_mut` * `NonZero::count_ones` * `Vec::pop_if` * `sync::Once::wait` * `sync::Once::wait_force` * `sync::OnceLock::wait` These APIs are now stable in const contexts: * `hint::black_box` * `io::Cursor::get_mut` * `io::Cursor::set_position` * `str::is_char_boundary` * `str::split_at` * `str::split_at_checked` * `str::split_at_mut` * `str::split_at_mut_checked` ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.86.0 Many people came together to create Rust 1.86.0. We couldn't have done it without all of you. Thanks!
03.04.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Adopting the FLS # Adopting the FLS Some years ago, Ferrous Systems and AdaCore worked together to assemble a description of Rust called the FLS1. Ferrous Systems has since been faithfully maintaining and updating this document for new versions of Rust, and they've successfully used it to qualify toolchains based on Rust for use in safety-critical industries. Seeing this success, others have also begun to rely on the FLS for their own qualification efforts when building with Rust. The members of the Rust Project are passionate about shipping high quality tools that enable people to build reliable software at scale. Such software is exactly the kind needed by those in safety-critical industries, and consequently we've become increasingly interested in better understanding and serving the needs of these customers of our language and of our tools. It's in that light that we're pleased to announce that we'll be adopting the FLS into the Rust Project as part of our ongoing specification efforts. This adoption is being made possible by Ferrous Systems. We're grateful to them for the work they've done in making the FLS fit for qualification purposes, in promoting its use and the use of Rust generally in safety-critical industries, and now, for working with us to take the next step and to bring it into the Project. With this adoption, we look forward to better integrating the FLS with the processes of the Project and to providing ongoing and increased assurances to all those who use Rust in safety-critical industries and, in particular, to those who use the FLS as part of their qualification efforts. This adoption would not have been possible without the efforts of the Rust Foundation, and in particular of Joel Marcey, the Director of Technology at the Foundation, who has worked tirelessly to facilitate this on our behalf. We're grateful to him and to the Foundation for this support. The Foundation has published its own post about this adoption. ## I'm relying on the FLS today; what should I expect? We'll be bringing the FLS within the Project, so expect some URLs to change. We plan to release updates to the FLS in much the same way as they have been happening up until now. We're sensitive to the fact that big changes to this document can result in costs for those using it for qualification purposes, and we don't have any immediate plans for big changes here. ## What's this mean for the Rust Reference? The Reference is still the Reference. Adopting the FLS does not change the status of the Reference, and we plan to continue to improve and expand the Reference as we've been doing. We'll of course be looking for ways that the Reference can support the FLS, and that the FLS can support the Reference, and in the long term, we're hopeful we can find ways to bring these two documents closer together. 1. The FLS stood for the "Ferrocene Language Specification". The minimal fork of Rust that Ferrous Systems qualifies and ships to their customers is called "Ferrocene", hence the name. We'll be dropping the expansion and just calling it the FLS within the Project. ↩
26.03.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.85.1 The Rust team has published a new point release of Rust, 1.85.1. Rust is a programming language that is empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via rustup, getting Rust 1.85.1 is as easy as: rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website. ## What's in 1.85.1 ### Fixed combined doctest compilation Due to a bug in the implementation, combined doctests did not work as intended in the stable 2024 Edition. Internal errors with feature stability caused rustdoc to automatically use its "unmerged" fallback method instead, like in previous editions. Those errors are now fixed in 1.85.1, realizing the performance improvement of combined doctest compilation as intended! See the backport issue for more details, including the risk analysis of making this behavioral change in a point release. ### Other fixes 1.85.1 also resolves a few regressions introduced in 1.85.0: * Relax some `target_feature` checks when generating docs. * Fix errors in `std::fs::rename` on Windows 1607. * Downgrade bootstrap `cc` to fix custom targets. * Skip submodule updates when building Rust from a source tarball. ### Contributors to 1.85.1 Many people came together to create Rust 1.85.1. We couldn't have done it without all of you. Thanks!
18.03.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing rustup 1.28.1 The rustup team is happy to announce the release of rustup version 1.28.1. Rustup is the recommended tool to install Rust, a programming language that is empowering everyone to build reliable and efficient software. ## Challenges with rustup 1.28.0 rustup 1.28.0 was a significant release with many changes, and there was a quick response from many folks that this release broke their processes. While we considered yanking the release, we worried that this would cause problems for people who had already updated to adopt some of the changes. Instead, we are rolling forward with 1.28.1 today and potentially further bugfix releases to address the feedback that comes in. We value all constructive feedback -- please keep it coming in the issue tracker. In particular, the change with regard to implicit toolchain installation is being discussed in this issue. ## What's new in rustup 1.28.1 This release contains the following fixes: * Automatic install is enabled by default but can be opted out by setting `RUSTUP_AUTO_INSTALL` environment variable to `0`. pr#4214 pr#4227 * `rustup show active-toolchain` will only print a single line, as it did in 1.27. pr#4221 * Fixed a bug in the reqwest backend that would erroneously timeout downloads after 30s. pr#4218 * Use relative symlinks for proxies. pr#4226 ## How to update If you have a previous version of rustup installed, getting rustup 1.28.1 is as easy as stopping any programs which may be using Rustup (e.g. closing your IDE) and running: $ rustup self update Rustup will also automatically update itself at the end of a normal toolchain update: $ rustup update If you don't have it already, you can get rustup from the appropriate page on our website. Rustup's documentation is also available in the rustup book. ## Caveats Rustup releases can come with problems not caused by rustup itself but just due to having a new release. As such, we recommend paying attention to the following potential issues in particular: * Anti-malware scanners might be blocking rustup or stopping it from creating or copying files (especially when installing `rust-docs`, since it contains many small files). * In your CI environment, rustup might fail when trying to perform a self-update. This is a known issue, and in the case where this issue does occur, we recommend applying the following workaround at the beginning of your workflow: $ rustup set auto-self-update disable Also, starting from 1.28.0, rustup will no longer attempt to self-update in CI environments, so this workaround should not be necessary in the future. These issues should be automatically resolved in a few weeks when the anti-malware scanners are updated to be aware of the new rustup release, and the hosted version is updated across all CI runners. ## Thanks Thanks to the rustup and t-release team members who came together to quickly address these issues.
04.03.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
February Project Goals Update This is the first Project Goals update for the new 2025h1 period. For the first 6 months of 2025, the Rust project will work towards a slate of 39 project goals, with 3 of them designed as Flagship Goals. This post provides selected updates on our progress towards these goals (or, in some cases, lack thereof). The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** **Why this goal?** This work continues our drive to improve support for async programming in Rust. In 2024H2 we stabilized async closures; explored the generator design space; and began work on the `dynosaur` crate, an experimental proc-macro to provide dynamic dispatch for async functions in traits. In 2025H1 our plan is to deliver (1) improved support for async-fn-in-traits, completely subsuming the functionality of the `async-trait` crate; (2) progress towards sync and async generators, simplifying the creation of iterators and async data streams; (3) and improve the ergonomics of `Pin`, making lower-level async coding more approachable. These items together start to unblock the creation of the next generation of async libraries in the wider ecosystem, as progress there has been blocked on a stable solution for async traits and streams. **What has happened?** The biggest news is that Rust 1.85 is stable and includes two major features that impact Async Rust. The first is async closures, which has been on many people's wish lists for a long time and was expertly moved forward by @compiler-errors over the last year. The second feature included in 1.85 is the new lifetime capture rules as part of Rust 2024 edition. This should substantially improve the experience of using async Rust anytime a user writes `-> impl Future`, as it removes the need for `+ '_` or similar bounds in most cases. It will also lead to an easier to understand language, since those bounds only worked by exploiting the more subtle rules of `impl Trait` in a way that runs contrary to their actual semantic role in the language. In the 2024 Edition, the subtle rule is gone and we capture all input lifetimes by default, with the ability to use `+ use<>` syntax to opt out. See this blog post for more. **Generators.** The lang team also held a design meeting to review the design for generators, with the outcome of the last one being that we will implement a `std::iter::iter!` macro (exact path TBD) in the compiler, as a lang team experiment that allows the use of the `yield` syntax. We decided to go in this direction because we want to reserve `gen` for self-borrowing and perhaps lending generators, and aren't yet decided on which subset of features to expose under that syntax. This decision interacts with ongoing compiler development that isn't ready yet to enable experimentation with lending. Our hope is that in the meantime, by shipping `iter!` we will give people the chance to start using generators in their own code and better understand which limitations people hit in practice. As you may have noticed, I'm not talking about async generators here. Those are the ultimate goal for the async initiative, but we felt the first step should be clarifying the state of synchronous generators so we can build on that when talking about async ones. **Dynosaur.** dynosaur v0.1.3 was released, with another release in the works. We think we are approaching a 1.0 release real soon now (tm). At this point you should be able to try it on your crate to enable dyn dispatch for traits with `async fn` and other `-> impl Trait` methods. If you need to use it together with `#trait_variant]`, you may need to wait until the next release when [#55 is fixed. 1 detailed update available. Comment by @tmandry posted on 2025-02-26: > ## Rust 1.85 > > The first update is the release of Rust 1.85, which had at least two major features that impact Async Rust. The first is async closures, which has been on many people's wish lists for a long time and was expertly moved forward by @compiler-errors over the last year. > > The second is the new lifetime capture rules as part of Rust 2024 edition. This should substantially improve the experience of using async Rust anytime a user writes `-> impl Future`, as it removes the need for `+ '_` or similar bounds in most cases. It will also lead to an easier to understand language, since those bounds only worked by exploiting the more subtle rules of `impl Trait` in a way that runs contrary to their actual semantic role in the language. In the 2024 Edition, the subtle rule is gone and we capture all input lifetimes by default, with the ability to use `+ use<>` syntax to opt out. See this blog post for more. > > ## Generators > > The lang team held two design meetings on generators, with the outcome of the last one being that we will implement a `std::iter::iter!` macro (exact path TBD) in the compiler, as a lang team experiment that allows the use of the `yield` syntax. We decided to go in this direction because we want to reserve `gen` for self-borrowing and perhaps lending generators, and aren't yet decided on which subset of features to expose under that syntax. This decision interacts with ongoing compiler development that isn't ready yet to enable experimentation with lending. > > Our hope is that in the meantime, by shipping `iter!` we will give people the chance to start using generators in their own code and better understand which limitations people hit in practice. > > As you may have noticed, I'm not talking about async generators here. Those are the ultimate goal for the async initiative, but we felt the first step should be clarifying the state of synchronous generators so we can build on that when talking about async ones. > > ## dynosaur > > dynosaur v0.1.3 was released, with another release in the works. We think we are approaching a 1.0 release real soon now (tm). At this point you should be able to try it on your crate to enable dyn dispatch for traits with `async fn` and other `-> impl Trait` methods. If you need to use it together with `#trait_variant]`, you may need to wait until the next release when [#55 is fixed. > > ## Other > > The async project goal was accepted for 2025H1! **Organize Rust All-Hands 2025** **Why this goal?** May 15, 2025 marks the 10-year anniversary of Rust's 1.0 release; it also marks 10 years since the creation of the Rust subteams. At the time there were 6 Rust teams with 24 people in total. There are now 57 teams with 166 people. In-person All Hands meetings are an effective way to help these maintainers get to know one another with high-bandwidth discussions. This year, the Rust project will be coming together for RustWeek 2025, a joint event organized with RustNL. Participating project teams will use the time to share knowledge, make plans, or just get to know one another better. One particular goal for the All Hands is reviewing a draft of the Rust Vision Doc, a document that aims to take stock of where Rust is and lay out high-level goals for the next few years. **What has happened?** Planning is proceeding well. In addition to Rust maintainers, we are inviting all project goal owners to attend the All Hands (note that the accompanying RustWeek conference is open to the public, it's just the All Hands portion that is invitation only). There are currently over 100 project members signed up to attend. For those invited to the All Hands: * Travel funds may be available if you are unable to finance travel through your employer. Get in touch for details. * Please participate in the brainstorm for how best to use the All Hands time in the all-hands-2025 Zulip stream. * If you do plan to attend, please purchase your travel + hotels in a timely fashion as the discount rates will expire. 1 detailed update available. Comment by @m-ou-se posted on 2025-02-28: > What happened so far: > > * Allocated a budget for the event. > * Funds have been transferred from the Rust Foundation to RustNL. > * Booked the venue, including lunch and snacks. > * Remaining budget from last year's travel grant programme added to this year's, to help cover the travel costs. > * Announcement published: https://blog.rust-lang.org/inside-rust/2024/09/02/all-hands.html > * After sending many reminders to teams and individuals, about 110 project members signed up. (And a few cancelled.) > * Formal invitations sent out to all those who registered. > * Information on the all-hands: https://rustweek.org/all-hands/ > * Hotel reservations available: https://rustweek.org/hotels-all-hands/ > * Created a public and a private zulip channel. > * About 65 people confirmed they booked their hotel. > * Opened up discussion on what to discuss at the all-hands. > * Invited guests: project goal (task) owners who aren't a project member (12 people in total). 4 of those signed up so far. > * Acquired 150 secret gifts for the pre-all-hands day. > > > Next up: > > * Remind folks to get a ticket for the RustWeek conference (tuesday+wednesday) if they want to join that as well. > * Invite more guests, after deciding on who else to invite. (To be discussed today in the council meeting.) > * Figure out if we can fund the travel+hotel costs for guests too. (To be discussed today in the council meeting.) > * Organise all the ideas for topics at the all-hands, so we can turn them into a consistent schedule later. > * Draft an allocation of the rooms depending on the teams and topics. > * Open the call for proposals for talks for the Project Track (on wednesday) as part of the RustWeek conference. > **Stabilize tooling needed by Rust for Linux** **Why this goal?** This goal continues our work from 2024H2 in supporting the experimental support for Rust development in the Linux kernel. Whereas in 2024H2 we were focused on stabilizing required language features, our focus in 2025H1 is stabilizing compiler flags and tooling options. We will (1) implement RFC #3716 which lays out a design for ABI-modifying flags; (2) take the first step towards stabilizing `build-std` by creating a stable way to rebuild core with specific compiler options; (3) extending rustdoc, clippy, and the compiler with features that extract metadata for integration into other build systems (in this case, the kernel's build system). **What has happened?** We established the precise set of 2025H1 deliverables and we have been tracking them and have begun making progress towards them. Rustdoc has been updated to support extracting doc tests so that the Kernel can execute them in a special environment (this was previously done with a big hack) and RFL is in the process of trying to use that new support. The first PR towards the implementation of RFC #3716 has landed and the ARM team has begun reading early drafts of the design doc for `-Zbuild-core` with the cargo team. We are also working to finalize the stabilization of the language features that were developed in 2024H2, as two late-breaking complications arose. The first (an interaction between casting of raw pointers and arbitrary self types) is expected to be resolved by limiting the casts of raw pointers, which previously accepted some surprising code. We identified that only a very small set of crates relied on this bug/misfeature; we expect nonetheless to issue a forwards compatibility warning. We are also resolving an issue where `derive(CoercePointee)` was found to reveal the existence of some unstable impls in the stdlib. 3 detailed updates availabled. Comment by @nikomatsakis posted on 2025-01-15: > In our meeting today we reviewed the plans for the 2025H1 project goal... > > **" Almost done" stuff from before** > > * re-stabilize CoercePointee -- Alice is looking at this, it's a good opportunity to try out the new template that is being discussed > * stabilize arbitrary self types v2 -- @adetaylor left a comment 3 weeks ago indicating that everything was more-or-less landed. RFL is already using it, providing evidence that it works reasonably well. Next steps are then sorting out documentation and moving to stabilize. > * asm-goto -- ready for stabilization, not been merged yet, still doing some work on the Rust reference (PRs https://github.com/rust-lang/rust/pull/133870, https://github.com/rust-lang/reference/pull/1693) > > > **ABI-modifying flags** > > The rust-lang/rfcs#3716 is now in Final Comment Period (FCP). There is a preliminary implementation in #133138 that @petrochenkov is going to be reviewing. Some more work will be needed to test, cleanup, etc after that lands. > > **Other flags fromRFL#2** > > We went through a series of flags from that RFL uses and looking into what might be blocking each of them. The process to stabilize one of these is basically to prepare the stabilization PR (minimal, but we need to rename the flag from `-Z` to `-C`) with a stabilization report and proper docs and then cc @davidtwco or @wesleywiser to prepare stabilization. In most cases we need to document how the flags can be misused, most commonly by linking against std or other crates not built with the same flags. If there are major correctness concerns as a result we likely want to consider the flag as "ABI-modifying". > > * ability to extract dependency info, currently using `-Zbinary_dep_depinfo=y` -- basically ready to stabilize * tmandry: Do you want toolchain runtimes (libstd, compiler-rt) in your dep info? In my experience this features does 90% of what I want it to do, but removing the inclusion of runtimes is the only question I have before stabilizing. > * -Zcrate-attr, used to configure no-std without requiring it in the source file -- no real concerns > * `-Zunpretty=expanded` -- have to clearly document that the output is not stable, much like we did for emitting MIR. This is already "de facto" stable because in practice `cargo expand` uses `RUSTC_BOOTSTRAP=1` and everybody uses it. > * `-Zno-jump-tables` -- this should be considered an ABI-modifying flag because we believe it is needed for CFI and therefore there is a risk if incompatible modules are linked. > * `-Zdwarf-version`, `-Zdebuginfo-compression` -- this should be ready to stabilize, so long as we document that you should expect a mix of debuginfo etc when mixing things compiled with different versions (notably libstd, which uses DWARF4). Debuggers are already prepared for this scenario. zstd compression is supported as of Rust 1.82.0. > > > **stable rustdoc features allowing the RFL project to extract and customize rustdoc tests (`--extract-doctests`)** > > @imperio authored https://github.com/rust-lang/rust/pull/134531, which is now up for review. Once PR lands, RFL will validate the design, and it can proceed to stabilization. > > **clippy configuration (possibly`.clippy.toml` and `CLIPPY_CONF_DIR`)** > > We discussed with clippy team, seems like this is not a big deal, mostly a doc change, one concern was whether clippy should accept options it doesn't recognize (because they may come from some future version of clippy). Not a big deal as of now, RFL only uses (msrv, check-private-items=true, disallowed-macros). > > **rebuild libcore** > > ARM team is working on this as part of this project goal, expect updates. πŸŽ‰ Comment by @nikomatsakis posted on 2025-01-30: > Updates: > > ## 2024H2 cleanup > > * Arbitrary self types v2: Stabilization PR is open (rust-lang/rust#135881). > * Stabilize CoercePointee: RFL is using it now; we are making progress towards completing the stabilization. > > > ## 2025H1 > > * ABI-modifying flags RFC (rust-lang/rfcs#3716) has completed FCP and needs to be merged. Implementation PR #133138 authored by @azhogin remains under review. > * Other compiler flags, we made a prioritized list. One easy next step would be to rename all `-Z` flags in this list to something stabilizable (e.g., `-C`) that requires `-Zunstable-features`. > * [ ] `-Zdwarf-version` -- wesley wiser > * [ ] `-Zdebuginfo-compression`, unblocked > * [ ] `-Zcrate-attr`, used to configure no-std without requiring it in the source file, no real concerns > * [ ] `-Zunpretty=expanded`, unblocked, maybe needs a PR that says "don't rely on this", Linux only uses it for debugging macros (i.e. not in the normal build, so it is less critical). Needs a stable name, e.g., `--emit macro-expanded`, and we should make sure output cannot be piped to rustc. `rustfmt` told us (Rust for Linux) that they will try their best to keep `rustfmt` able to format the output of the expansion. > * [ ] `-Zno-jump-tables`, considered an ABI-modifying flag > * [ ] `-Zbinary_dep_depinfo=y` -- basically ready to stabilize (@tmandry asked "Do you want toolchain runtimes (libstd, compiler-rt) in your dep info? In my experience this features does 90% of what I want it to do, but removing the inclusion of runtimes is the only question I have before stabilizing", but we don't understand this point yet, as they were not present in the meeting). > * stable rustdoc: PR rust-lang/rust#134531 is under review, should land soon, then next step will be for RFL folks to try it out. > * Clippy configuration: no progress, discussed some new options and posted in thread, very minimal work required here. > * rebuild libcore: @davidtwco wasn't present so no update, but we know progress is being made > > > ### Publicizing this work > > We discussed briefly how to better get the word out about this collaboration. Some points: > > * @Darksonn will be speaking at Rust Nation > * We could author a Rust-lang blog post, perhaps once the language items are done done done? > * LWN article might be an option > > > ### general-regs-only > > We discussed the possibility of a flag to avoid use of floating point registers, no firm conclusion yet reached. Comment by @nikomatsakis posted on 2025-02-20: > Updates from our 2025-02-12 meeting: > > Given the recent controversy about Rust usage in the Kernel, the RFL group wrote up a policy document explainer to explain the policy, and there was a write-up on LWN. > > Regarding arbitary self types and coerce pointee, we are waiting on rust-lang/rust#136764 and rust-lang/rust#136776. The former is on lang team FCP. The latter has received approval from lang team and is awaiting further impl work by @BoxyUwU. > > @ojeda is looking into how to manage dependency information and configure no-std externally. > > @GuillaumeGomez's impl of rustdoc features has landed and we are waiting on RFL to experiment with it. > > @davidtwco's team at ARM has authored a document regarding a blessed way to build-std and are collecting feedback. > > @wesleywiser is preparing a PR to add `-Zdwarf-version` to help advance compiler flags. > > There is an annoying issue related to `cfg(no_global_oom_handling)`, which is no longer used by RFL but which remains in an older branch of the kernel (6.12, LTS). > > As a set of "leaf crates" that evolve together in a mono-repo-like fashion, RFL would like to have a solution for disabling the orphan rule. ## Goals looking for help **Implement Open API Namespace Support** _Help wanted:_ this project goal needs a compiler developer to move forward. If you'd like to help, please post in this goal's dedicated zulip topic. 1 detailed update available. Comment by @epage posted on 2025-02-20: > Help wanted: this project goal needs a compiler developer to move forward. **Prototype a new set of Cargo "plumbing" commands** _Help wanted:_ this project goal needs someone to work on the implementation. If you'd like to help, please post in this goal's dedicated zulip topic. 2 detailed updates availabled. Comment by @epage posted on 2025-02-20: > Help wanted: this project goal needs someone to work on the implementation Comment by @ashiskumarnaik posted on 2025-02-23: > Hi @epage I am very interested to collaborate in this implementation work. Let's talk on Zulip, Check DM. **Publish first version of StableMIR on crates.io** _Help wanted:_ looking for people that want to help do a bit of refactoring. Please reach out through the project-stable-mir zulip channel or repository. 1 detailed update available. Comment by @celinval posted on 2025-02-25: > No progress yet. > > **Help Wanted:** Looking for people that want to help do a bit of refactoring. Please reach out through the project-stable-mir zulip channel or repository. **Stabilize public/private dependencies** _Help wanted:_ this project goal needs a compiler developer to move forward. If you'd like to help, please post in this goal's dedicated zulip topic. 1 detailed update available. Comment by @epage posted on 2025-02-20: > Help wanted: this project goal needs a compiler developer to move forward. ## Other goal updates **" Stabilizable" prototype for expanded const generics** 1 detailed update available. Comment by @BoxyUwU posted on 2025-02-27: > camelid has a PR up which is ~fully finished + reviewed which enables resolving and lowering all paths under `min_generic_const_args`. It's taken a while to get this bit finished as we had to take care not to make parts of the compiler unmaintainable by duplicating all the logic for type and const path lowering. **build-std** 1 detailed update available. Comment by @davidtwco posted on 2025-02-19: > An initial update on what we've been up to and some background: > > * This goal is submitted on behalf of the Rust team at Arm, but primarily worked on by @AdamGemmell. Anyone interested can always contact me for updates and I'll keep this issue up-to-date. > * Our team has been trying to make progress on build-std by completing the issues in rust-lang/wg-cargo-std-aware but found this wasn't especially effective as there wasn't a clearly defined scope or desired outcome for most issues and the relevant teams were lacking in the necessary context to evaluate any proposals. > * We've since had discussions with the Cargo team and agreed to draft a document describing the use cases, motivations and prior art for build-std such that the Cargo team can feel confident in reviewing any further proposals. > * @AdamGemmell shared an initial draft of this in #t-cargo on Zulip and **it is undergoing further revisions following feedback**. > * Following reaching a shared understanding of the context of the feature, @AdamGemmell will then draft a complete proposal for build-std that could feasibly be stabilised. It will describe the use cases which are and are not considered in-scope for build-std, and which will feature in an initial implementation. > * @davidtwco is ensuring that whatever mechanism that is eventually proposed to enable build-std to work on stable toolchains will also be suitable for the Rust for Linux project to use when building core themselves. > **Continue resolving `cargo-semver-checks` blockers for merging into cargo** 1 detailed update available. Comment by @obi1kenobi posted on 2025-02-19: > Thanks, Niko! Copying in the new tasks from the 2025h1 period: > > * [ ] Prototype cross-crate linting using workarounds (@obi1kenobi) > * [ ] Allow linting generic types, lifetimes, bounds (@obi1kenobi) > * [ ] Handle "special cases" like `'static` and `?Sized` (@obi1kenobi) > * [ ] Handle `#[doc(hidden)]` in sealed trait analysis (@obi1kenobi) > * x] Discussion and moral support ([cargo, [rustdoc] > **Declarative ( `macro_rules!`) macro improvements** No detailed updates available. **Evaluate approaches for seamless interop between C++ and Rust** 1 detailed update available. Comment by @tmandry posted on 2025-02-26: > We had a lang team design meeting about C++ interop today. The outcome was very positive, with enthusiasm for supporting an ambitious vision of C++ interop: One where a large majority of real-world C++ code can have automated bindings to Rust and vice-versa. > > At the same time, the team expressed a desire to do so in a way that remains in line with Rust's values. In particular, we would not make Rust a superset of Rust+C++, but instead would define extension points that can be used to express language interop boundaries that go beyond what Rust itself allows. As an example, we could allow template instantiation via a Rust "plugin" without adding templates to Rust itself. Similarly, we could allow calling overloaded C++ methods without adding function overloading to Rust itself. Other interop needs are more natural to enable with features in the Rust language, like custom reference types. > > In either case, anything we do to support interop will need to be considered on its merits. Interop is a reason to support a feature, but it is never a "blank check" to add anything we might consider useful. > > The discussion so far has been at a high level. Next steps will be: > > * Discuss what significant-but-realistic milestones we might pursue as part of upcoming project goals, and what it would take to make them happen. Whether this happens as part of another lang team meeting or a more dedicated kickoff meeting for interested parties, I'll be sure to keep the lang team in the loop and will continue posting updates here. > * Dive into more specific proposals for use cases we would like to enable in meetings with the language, library, and compiler teams. > > > Notes: https://hackmd.io/2Ar_7CNoRkeXk1AARyOL7A?view **Experiment with ergonomic ref-counting** 1 detailed update available. Comment by @spastorino posted on 2025-02-26: > There's a PR up https://github.com/rust-lang/rust/pull/134797 which implements the proposed RFC without the optimizations. The PR is not yet merged and we need to continue now working on addressing comments to the PR until is merged and then start implementing optimizations. **Expose experimental LLVM features for GPU offloading** 1 detailed update available. Comment by @ZuseZ4 posted on 2025-01-03: > Happy New Year everyone! After a few more rounds of feedback, the next autodiff PR recently got merged: https://github.com/rust-lang/rust/pull/130060 With that, I only have one last PR open to have a fully working autodiff MVP upstream. A few features had to be removed during upstreaming to simplify the reviewing process, but they should be easier to bring back as single PRs. > > Beginning next week, I will also work on an MVP for the `batching` feature of LLVM/Enzyme, which enables some AoS and SoA vectorization. It mostly re-uses the existing autodiff infrastructure, so I expect the PRs for it to be much smaller. > > On the GPU side, there has been a recent push by another developer to add a new AMD GPU target to the Rust compiler. This is something that I would have needed for the llvm offload project anyway, so I'm very happy to see movement here: https://github.com/rust-lang/compiler-team/issues/823 **Extend pubgrub to match cargo 's dependency resolution** 1 detailed update available. Comment by @Eh2406 posted on 2025-02-26: > The major update so far is the release of PubGrub 0.3. This makes available the critical improvements made to allow the functionality and performance demanded by Cargo and UV. The other production users can now take advantage of the past few years of improvements. Big thanks to @konstin for making the release happen. > > Other progress is been stymied by being sick with Covid for a week in January and the resulting brain fog, followed by several high-priority projects for $DAY_JOB. It is unclear when the demands of work will allow me to return focus to this project. **Externally Implementable Items** 1 detailed update available. Comment by @m-ou-se posted on 2025-02-28: > Now that https://github.com/rust-lang/rust/pull/135726 is merged, @jdonszelmann and I will be working on implementing EII. > > We have the design for the implementation worked out on our whiteboard. We don't expect any significant blockers at this point. We'll know more once we start writing the code next week. **Finish the libtest json output experiment** 1 detailed update available. Comment by @epage posted on 2025-02-20: > This is on pause until the implementation for #92 is finished. The rustc side of #92 is under review and then some additional r-a and cargo work before implementation is done and its waiting on testing and stabilization. **Implement restrictions, prepare for stabilization** 1 detailed update available. Comment by @jhpratt posted on 2025-02-26: > First status update: > > No progress. I will be reviewing the existing PR this weekend to see the feasibility of rebasing it versus reapplying patches by hand. My suspicion is that the latter will be preferable. **Improve state machine codegen** 1 detailed update available. Comment by @traviscross posted on 2025-02-26: > This is, I believe, mostly waiting on us on the lang team to have a look, probably in a design meeting, to feel out what's in the realm of possibility for us to accept. **Instrument the Rust standard library with safety contracts** 1 detailed update available. Comment by @celinval posted on 2025-01-03: > **Key developments:** We have written and verified around 220 safety contracts in the verify-rust-std fork. 3 out of 14 challenges have been solved. We have successfully integrated Kani in the repository CI, and we are working on the integration of 2 other verification tools: VeriFast and Goto-transcoder (ESBMC) **Making compiletest more maintainable: reworking directive handling** 2 detailed updates availabled. Comment by @jieyouxu posted on 2025-02-19: > Update (2025-02-19): > > * To make it easier to follow bootstrap's test flow going into running compiletest-managed test suites, I've added more tracing to bootstrap in https://github.com/rust-lang/rust/pull/137080. > * There are some prerequisite cleanups/improvements that I'm working on first to make it easier to read bootstrap + compiletest's codebase for reference: https://github.com/rust-lang/rust/pull/137224, https://github.com/rust-lang/rust/pull/136474, https://github.com/rust-lang/rust/pull/136542 > * I'm thinking for the prototype I'm going to experiment with a branch off of rust-lang/rust instead of completely separately, so I can experiment under the context of bootstrap and tests that we actually have, instead of trying to experiment with it in a complete vacuum (esp. with respect to staging and dependency licenses). > * Onur is working on stabilize stage management for rustc tools #137215 which I will wait on to match `ToolStd` behavior as used by compiletest. > Comment by @jieyouxu posted on 2025-02-27: > Update (2025-02-27): > > * Cleanups still waiting to be merged (some PRs are blocked on changes from others making this slow). > **Metrics Initiative** 2 detailed updates availabled. Comment by @yaahc posted on 2025-02-25: > I'm very excited to see that this got accepted as a project goal πŸ₯° πŸŽ‰ > > Let me go ahead and start by giving an initial status update of where I'm at right now. > > * We've already landed the initial implementation for configuring the directory where metrics should be stored which also acts as the enable flag for a default set of metrics, right now that includes ICE reports and unstable feature usage metrics > * Implemented basic unstable feature usage metrics, which currently dumps a json file per crate that is compiled showing which metrics are enabled. (example below) > * Implemented `rust-lang/rust/src/tools/features-status-dump` which dumps the status information for all unstable, stable, and removed features as a json file > * setup an extremely minimal initial Proof of Concept implementation locally on my laptop using InfluxDB 3.0 Alpha and Graphana (image below) > * I have a small program I wrote that converts the json files into influxdb's line protocol for both the usage info and the status info (snippets shown below) > * The timestamps are made up, since they all need to be distinct or else influxdb will treat them all as updates to the same row, I'd like to preserve this information from when the metrics were originally dumped, either in the json or by changing rustc to dump via influxdb's line format directly, or some equivalent protocol. (note this is probably only necessary for the usage metrics, but for the status metrics I'd have to change the line format schema from the example below to avoid the same problem, this has to do with how influxdb treats tags vs fields) > * I gathered a minimal dataset by compiling rustc with `RUSTFLAGS_NOT_BOOTSTRAP="-Zmetrics-dir=$HOME/tmp/metrics" ./x build --stage 2` and `./x run src/tools/features-status-dump/`, save the output to the filesystem, and convert the output to the line protocol with the aforementioned program > * Write the two resulting files to influxdb > * I then setup the table two different ways, once by directly querying the database using influxdb's cli (query shown below), then again by trying to setup an equivalent query in graphana (there's definitely some kinks to work out here, I'm not an expert on graphana by any means.) > > > from `unstable_feature_usage_metrics-rustc_hir-3bc1eef297abaa83.json` > > > {"lib_features":[{"symbol":"variant_count"}],"lang_features":[{"symbol":"associated_type_defaults","since":null},{"symbol":"closure_track_caller","since":null},{"symbol":"let_chains","since":null},{"symbol":"never_type","since":null},{"symbol":"rustc_attrs","since":null}]} > > Snippet of unstable feature usage metrics post conversion to line protocol > > > featureUsage,crateID="bc8fb5c22ba7eba3" feature="let_chains" 1739997597429030911 featureUsage,crateID="439ccecea0122a52" feature="assert_matches" 1739997597429867374 featureUsage,crateID="439ccecea0122a52" feature="extract_if" 1739997597429870052 featureUsage,crateID="439ccecea0122a52" feature="iter_intersperse" 1739997597429870855 featureUsage,crateID="439ccecea0122a52" feature="box_patterns" 1739997597429871639 > > Snippet of feature status metrics post conversion to line protocol > > > featureStatus,kind=lang status="unstable",since="1.5.0",has_gate_test=false,file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/unstable.rs",line=228,name="omit_gdb_pretty_printer_section" 1739478396884006508 featureStatus,kind=lang status="accepted",since="1.83.0",has_gate_test=false,tracking_issue="123742",file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/accepted.rs",line=197,name="expr_fragment_specifier_2024" 1739478396884040564 featureStatus,kind=lang status="accepted",since="1.0.0",has_gate_test=false,file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/accepted.rs",line=72,name="associated_types" 1739478396884042777 featureStatus,kind=lang status="unstable",since="1.79.0",has_gate_test=false,tracking_issue="123646",file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/unstable.rs",line=232,name="pattern_types" 1739478396884043914 featureStatus,kind=lang status="accepted",since="1.27.0",has_gate_test=false,tracking_issue="48848",file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/accepted.rs",line=223,name="generic_param_attrs" 1739478396884045054 featureStatus,kind=lang status="removed",since="1.81.0",has_gate_test=false,tracking_issue="83788",file="/home/jlusby/git/rust-lang/rust/compiler/rustc_feature/src/removed.rs",line=245,name="wasm_abi" 1739478396884046179 > > Run with `influxdb3 query --database=unstable-feature-metrics --file query.sql` > > > SELECT COUNT(*) TotalCount, "featureStatus".name FROM "featureStatus" INNER JOIN "featureUsage" ON "featureUsage".feature = "featureStatus".name GROUP BY "featureStatus".name ORDER BY TotalCount DESC Comment by @yaahc posted on 2025-02-25: > My next step is to revisit the output format, currently a direct json serialization of the data as it is represented internally within the compiler. This is already proven to be inadequate by personal experience, given the need for additional ad-hoc conversion into another format with faked timestamp data that wasn't present in the original dump, and by conversation with @badboy (Jan-Erik), where he recommended we explicitly avoid ad-hoc definitions of telemetry schemas which can lead to difficult to manage chaos. > > I'm currently evaluating what options are available to me, such as a custom system built around influxdb's line format, or opentelemetry's metrics API. > > Either way I want to use firefox's telemetry system as inspiration / a basis for requirements when evaluating the output format options > > Relevant notes from my conversation w/ Jan-Erik > > * firefox telemetry starts w/ the question, what is it we want to answer by collecting this data? has to be explicitly noted by whoever added new telemetry, there's a whole process around adding new telemetry > * defining metric > * description > * owner > * term limit (expires automatically, needs manual extension) > * data stewards > * do data review > * checks that telemetry makes sense > * check that everything adheres to standards > * can have downside of increasing overhead to add metrics > * helps w/ tooling, we can show all this info as documentation > * schema is generated from definitions > **Model coherence in a-mir-formality** 1 detailed update available. Comment by @nikomatsakis posted on 2025-02-26: > I have established some regular "office hour" time slots where I am available on jitsi. We landed a few minor PRs and improvements to the parser and oli-obk and tif have been working on modeling of effects for the const generics work. I'm planning to start digging more into the modeling of coherence now that the basic merging is done. **Next-generation trait solver** 1 detailed update available. Comment by @lcnr posted on 2025-02-27: > We've stabilized `-Znext-solver=coherence` in version 1.84 and started to track the remaining issues in a project board. > > Fixing the opaque types issue breaking `wg-grammar` is difficult and requires a more in-depth change for which there is now an accepted Types MCP. This likely also unblocks the TAIT stabilization using the old solver. > > While waiting on the MCP I've started to look into the errors when compiling `nalgebra`. @lqd minimized the failures. They have been caused by insufficiencies in our cycle handling. With https://github.com/rust-lang/rust/pull/136824 and https://github.com/rust-lang/rust/pull/137314 cycles should now be fully supported. > > We also fully triaged all UI tests with the new solver enabled with @compiler-errors, @BoxyUwU, and myself fixing multiple less involved issues. **Nightly support for ergonomic SIMD multiversioning** 1 detailed update available. Comment by @veluca93 posted on 2025-02-25: > Key developments: Further discussions on implementation details of the three major proposed ways forward. Requested a design meeting in https://github.com/rust-lang/lang-team/issues/309. **Null and enum-discriminant runtime checks in debug builds** 1 detailed update available. Comment by @1c3t3a posted on 2025-02-19: > Status update: The null-checks landed in rust#134424. Next up are the enum discriminant checks. **Optimizing Clippy & linting** 1 detailed update available. Comment by @blyxyas posted on 2025-02-26: > As a monthly update (previously posted on Zulip): We have some big progress! > > * rust-clippy#13821 has been open and is currently being reviewed. It moves the MSRV logic out of lint-individualistic attribute extraction and into Clippy-wide MSRV (with a very good optimization, taking into account that only a small percentage of crates use. > > * A Clippy-exclusive benchmarker has arrived, powered by the existing lintcheck infrastructure and perf. So it's compatible with flamegraph and other such tools. rust-clippy#14194 We can later expand this into CI or a dedicated bot. > > * As you probably know, rust#125116 has been merged, just as a reminder of how that big goal was slayed like a dragon :dragon:. > > > > We now know what functions to optimize (or, at least have a basic knowledge of where Clippy spends its time). As some future functionality, I'd love to have a functionality to build cargo and rust with debug symbols and hook it up to Clippy, but that may be harder. It's not perfect, but it's a good start! **Prepare const traits for stabilization** No detailed updates available. **Promoting Parallel Front End** No detailed updates available. **Publish first rust-lang-owned release of "FLS"** 1 detailed update available. Comment by @JoelMarcey posted on 2025-02-24: > Last week at the Safety Critical Rust Consortium meeting in London, Ferrous systems publicly announced to consortium members that they have committed to contributing the FLS to the Rust Project. We are finalizing the details of that process, but we can start FLS integration testing in parallel, in anticipation. **Research: How to achieve safety when linking separately compiled code** 2 detailed updates availabled. Comment by @m-ou-se posted on 2025-02-28: > We started the collaboration with the Delft University of Technology. We assembled a small research team with a professor and a MSc student who will be working on this as part of his MSc thesis. We meet weekly in person. > > The project kicked off two weeks ago and is now in the literature research phase. Comment by @m-ou-se posted on 2025-02-28: > And related to this, someone else is working on an implementation of my `#[export]` rfc: https://github.com/rust-lang/rust/pull/134767 This will hopefully provide meaningful input for the research project. **Run the 2025H1 project goal program** 1 detailed update available. Comment by @nikomatsakis posted on 2025-02-19: > Update: We are running behind schedule, but we are up and running nonetheless! Bear with us. The goals RFC finished FCP on Feb 18. The new project goals team has been approved and we've updated the tracking issues for the new milestone. > > Project goal owners are encouraged to update the issue body to reflect the actual tasks as they go with github checkboxes or other notation as described here. We're going to start pinging for our first status update soon! **Rust Vision Document** 1 detailed update available. Comment by @nikomatsakis posted on 2025-02-19: > Update so far: I put out a call for volunteers on Zulip (hackmd) and a number of folks responded. We had an initial meeting on Jan 30 (notes here). We have created a Zulip stream for this project goal (`vision-doc-2025`) and I also did some experimenting in the https://github.com/nikomatsakis/farsight repository for what the table of contents might look like. > > Next milestone is to layout a plan. We are somewhat behind schedule but not impossibly so! **rustc-perf improvements** 1 detailed update available. Comment by @davidtwco posted on 2025-02-19: > An initial update on what we've been up to and some background: > > * This goal is submitted on behalf of the Rust team at Arm, but primarily worked on by @Jamesbarford. Anyone interested can always contact me for updates and I'll keep this issue up-to-date. > * We've scheduled a regular call with @Kobzol to discuss the constraints and requirements of any changes to rust-perf (see the t-infra calendar) and have drafted a document describing a proposed high-level architecture for the service following our changes. > * This has been shared in the #project-goals/2025h1/rustc-perf-improvements Zulip channel to collect feedback. > * Once we've reached an agreement on the high-level architecture, we'll prepare a more detailed plan with details like proposed changes to the database schema, before proceeding with the implementation. > **Scalable Polonius support on nightly** 1 detailed update available. Comment by @lqd posted on 2025-01-31: > Key developments from this month: > > * @amandasystems has continued working on the Sisyphean https://github.com/rust-lang/rust/pull/130227 and has made progress on rewriting type tests, diagnostics issues, fixing bugs, kept up with changes on master, and more. > * big thanks to @jackh726 and @matthewjasper on reviews: with their help, all the PRs from the previous update have landed on nightly. > * I've opened a couple of PRs on the analysis itself (https://github.com/rust-lang/rust/pull/135290, https://github.com/rust-lang/rust/pull/136299) as well as a few cleanups. With these, there are only around 4 failing tests that still need investigation, and 8-10 diagnostics differences to iron out. This is my current focus, but we'll also need to expand test coverage. > * I've also opened a handful of PRs gradually expanding the polonius MIR dump with visualizations. I'll next add the interactive "tool" I've been using to help debug the test failures. > * on organization and collaboration: > * we've met with one of Amanda's students for a possible Master's thesis on the more engineer-y side of polonius (perf <3) > * and have also discussed, with @ralfjung's team, the related topic of modeling the borrowck in `a-mir-formality` > **Secure quorum-based cryptographic verification and mirroring for crates.io** No detailed updates available. **SVE and SME on AArch64** 1 detailed update available. Comment by @davidtwco posted on 2025-02-19: > An initial update on what we've been up to and some background: > > * This goal is submitted on behalf of the Rust team at Arm, but primarily worked on by myself (@davidtwco) and @JamieCunliffe. Anyone interested can always contact me for updates and I'll keep this issue up-to-date. > * @JamieCunliffe been working on supporting Arm's scalable vector extension (SVE) for a couple years - primarily in rust-lang/rfcs#3268 and its implementation rust-lang/rust#118917. > * Through this work, we've discovered other changes to the language necessary to be able to support these types without special cases in the type system, which we're also working on (see below). > * Jamie is still resolving feedback on this RFC and its implementation, and keeping it rebased. We hope that it can be landed experimentally now that there's a feasible path to remove the special cases in the type system (see below). > * **The next steps for this RFC and implementation are..** > * ..to continue to respond to feedback on the RFC and implementation. > * I've (@davidtwco) been working on rust-lang/rfcs#3729 which improves Rust's support for exotically sized types, and would allow scalable vectors to be represented in the type system without special cases. > * We've had two design meetings with the language team about the RFC and had a broadly positive reception. > * There is a non-strict dependency on const traits (rust-lang/rfcs#3762) which has created uncertainty as to whether this RFC could be accepted without the specifics of const traits being nailed down. > * I've been working on implementing the RFC: an initial implementation of the non-const traits has been completed and adding the const traits is in-progress. > * The language team have indicated interest in seeing this land experimentally, but this will depend on whether the implementors of const traits are okay with this, as it would add to the work they need to do to make any syntactic changes requested by the language team in rust-lang/rfcs#3762. > * **I'm continuing to respond to feedback on the RFC, but as this has largely trailed off, the next steps for this RFC are**.. > * ..for the language team to decide to accept, reject, or request further changes to the RFC. > * ..for progress on the implementation to continue. > **Unsafe Fields** 1 detailed update available. Comment by @jswrenn posted on 2025-02-26: > **Key developments:** In a Feb 19 Lang Team Design Meeting, we reached consensus that the MVP for unsafe fields should be limited to additive invariants. **Use annotate-snippets for rustc diagnostic output** No detailed updates available.
03.03.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rustup 1.28.0 The rustup team is happy to announce the release of rustup version 1.28.0. Rustup is the recommended tool to install Rust, a programming language that is empowering everyone to build reliable and efficient software. ## What's new in rustup 1.28.0 This new release of rustup has been a long time in the making and comes with substantial changes. Before digging into the details, it is worth mentioning that Chris Denton has joined the team. Chris has a lot of experience contributing to Windows-related parts of the Rust Project -- expertise we were previously lacking -- so we're happy to have him on board to help address Windows-specific issues. The following improvements might require changes to how you use rustup: * rustup will no longer automatically install the active toolchain if it is not installed. * To ensure its installation, run `rustup toolchain install` with no arguments. * The following command installs the active toolchain both before and after this change: rustup show active-toolchain || rustup toolchain install # Or, on older versions of PowerShell: rustup show active-toolchain; if ($LASTEXITCODE -ne 0) { rustup toolchain install } * Installing a host-incompatible toolchain via `rustup toolchain install` or `rustup default` will now be rejected unless you explicitly add the `--force-non-host` flag. Rustup now officially supports the following host platforms: * `aarch64-pc-windows-msvc` * `loongarch64-unknown-linux-musl` This release also comes with various quality-of-life improvements, to name a few: * `rustup show`'s output format has been cleaned up, making it easier to find out about your toolchains' status. * `rustup doc` now accepts a flag and a topic at the same time, enabling quick navigation to specific parts of more books. * rustup's `remove` subcommands now support more aliases such as `rm` and `del`. * Basic support for nushell has been added. We have additionally made the following internal changes: * The default download backend has been changed from reqwest with native-tls to reqwest with rustls. * `RUSTUP_USE_CURL` and `RUSTUP_USE_RUSTLS` can still be used to change the download backend if the new backend causes issues. If issues do happen, please let us know. * The default backend now uses rustls-platform-verifier to verify server certificates, taking advantage of the platform's certificate store on platforms that support it. * When creating proxy links, rustup will now try symlinks first and fall back to hardlinks, as opposed to trying hardlinks first. * A new `RUSTUP_LOG` environment variable can be used to control tracing-based logging in rustup binaries. See the dev guide for more details. Finally, there are some notable changes to our official website as well: * The overall design of the website has been updated to better align with the Rust Project's branding. * It is now possible to download the prebuilt `rustup-init.sh` installer for the `aarch64-pc-windows-msvc` host platform via https://win.rustup.rs/aarch64. Further details are available in the changelog! ## How to update If you have a previous version of rustup installed, getting rustup 1.28.0 is as easy as stopping any programs which may be using Rustup (e.g. closing your IDE) and running: $ rustup self update Rustup will also automatically update itself at the end of a normal toolchain update: $ rustup update If you don't have it already, you can get rustup from the appropriate page on our website. Rustup's documentation is also available in the rustup book. ## Caveats Rustup releases can come with problems not caused by rustup itself but just due to having a new release. As such, we recommend paying attention to the following potential issues in particular: * Anti-malware scanners might be blocking rustup or stopping it from creating or copying files (especially when installing `rust-docs`, since it contains many small files). * In your CI environment, rustup might fail when trying to perform a self-update. This is a known issue, and in the case where this issue does occur, we recommend applying the following workaround at the beginning of your workflow: $ rustup set auto-self-update disable Also, starting from 1.28.0, rustup will no longer attempt to self-update in CI environments, so this workaround should not be necessary in the future. These issues should be automatically resolved in a few weeks when the anti-malware scanners are updated to be aware of the new rustup release, and the hosted version is updated across all CI runners. ## Thanks Thanks again to all the contributors who made rustup 1.28.0 possible!
02.03.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.85.0 and Rust 2024 The Rust team is happy to announce a new version of Rust, 1.85.0. This stabilizes the 2024 edition as well. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.85.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.85.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.85.0 stable ### Rust 2024 We are excited to announce that the Rust 2024 Edition is now stable! Editions are a mechanism for opt-in changes that may otherwise pose a backwards compatibility risk. See the edition guide for details on how this is achieved, and detailed instructions on how to migrate. This is the largest edition we have released. The edition guide contains detailed information about each change, but as a summary, here are all the changes: * Language * RPIT lifetime capture rules β€” Changes the default capturing of parameters by `impl Trait` types when `use<..>` is not present. * `if let` temporary scope β€” Changes the scope of temporaries for `if let` expressions. * Tail expression temporary scope β€” Changes the scope of temporaries for the tail expression in a block. * Match ergonomics reservations β€” Disallow some pattern combinations to avoid confusion and allow for future improvements. * Unsafe `extern` blocks β€” `extern` blocks now require the `unsafe` keyword. * Unsafe attributes β€” The `export_name`, `link_section`, and `no_mangle` attributes must now be marked as `unsafe`. * `unsafe_op_in_unsafe_fn` warning β€” The `unsafe_op_in_unsafe_fn` lint now warns by default, requiring explicit `unsafe {}` blocks in `unsafe` functions. * Disallow references to `static mut` β€” References to `static mut` items now generate a deny-by-default error. * Never type fallback change β€” Changes to how the never type `!` coerces, and changes the `never_type_fallback_flowing_into_unsafe` lint level to "deny". * Macro fragment specifiers β€” The `expr` macro fragment specifier in `macro_rules!` macros now also matches `const` and `_` expressions. * Missing macro fragment specifiers β€” The `missing_fragment_specifier` lint is now a hard error, rejecting macro meta variables without a fragment specifier kind. * `gen` keyword β€” Reserves the `gen` keyword in anticipation of adding generator blocks in the future. * Reserved syntax β€” Reserves `#"foo"#` style strings and `##` tokens in anticipation of changing how guarded string literals may be parsed in the future. * Standard library * Changes to the prelude β€” Adds `Future` and `IntoFuture` to the prelude. * Add `IntoIterator` for `Box<[T]>` β€” Changes how iterators work with boxed slices. * Newly unsafe functions β€” `std::env::set_var`, `std::env::remove_var`, and `std::os::unix::process::CommandExt::before_exec` are now unsafe functions. * Cargo * Cargo: Rust-version aware resolver β€” Changes the default dependency resolver behavior to consider the `rust-version` field. * Cargo: Table and key name consistency β€” Removes some outdated `Cargo.toml` keys. * Cargo: Reject unused inherited default-features β€” Changes how `default-features = false` works with inherited workspace dependencies. * Rustdoc * Rustdoc combined tests β€” Doctests are now combined into a single executable, significantly improving performance. * Rustdoc nested `include!` change β€” Changes to the relative path behavior of nested `include!` files. * Rustfmt * Rustfmt: Style edition β€” Introduces the concept of "style editions", which allow you to independently control the formatting edition from the Rust edition. * Rustfmt: Formatting fixes β€” A large number of fixes to formatting various situations. * Rustfmt: Raw identifier sorting β€” Changes to how `r#foo` identifiers are sorted. * Rustfmt: Version sorting β€” Changes to how identifiers that contain integers are sorted. #### Migrating to 2024 The guide includes migration instructions for all new features, and in general transitioning an existing project to a new edition. In many cases `cargo fix` can automate the necessary changes. You may even find that no changes in your code are needed at all for 2024! Note that automatic fixes via `cargo fix` are very conservative to avoid ever changing the semantics of your code. In many cases you may wish to keep your code the same and use the new semantics of Rust 2024; for instance, continuing to use the `expr` macro matcher, and ignoring the conversions of conditionals because you want the new 2024 drop order semantics. The result of `cargo fix` should not be considered a recommendation, just a conservative conversion that preserves behavior. _Many_ people came together to create this edition. We'd like to thank them all for their hard work! ### `async` closures Rust now supports asynchronous closures like `async || {}` which return futures when called. This works like an `async fn` which can also capture values from the local environment, just like the difference between regular closures and functions. This also comes with 3 analogous traits in the standard library prelude: `AsyncFn`, `AsyncFnMut`, and `AsyncFnOnce`. In some cases, you could already approximate this with a regular closure and an asynchronous block, like `|| async {}`. However, the future returned by such an inner block is not able to borrow from the closure captures, but this does work with `async` closures: let mut vec: Vec<String> = vec![]; let closure = async || { vec.push(ready(String::from("")).await); }; It also has not been possible to properly express higher-ranked function signatures with the `Fn` traits returning a `Future`, but you can write this with the `AsyncFn` traits: use core::future::Future; async fn f<Fut>(_: impl for<'a> Fn(&'a u8) -> Fut) where Fut: Future<Output = ()>, { todo!() } async fn f2(_: impl for<'a> AsyncFn(&'a u8)) { todo!() } async fn main() { async fn g(_: &u8) { todo!() } f(g).await; //~^ ERROR mismatched types //~| ERROR one type is more general than the other f2(g).await; // ok! } So `async` closures provide first-class solutions to both of these problems! See RFC 3668 and the stabilization report for more details. ### Hiding trait implementations from diagnostics The new `#[diagnostic::do_not_recommend]` attribute is a hint to the compiler to not show the annotated trait implementation as part of a diagnostic message. For library authors, this is a way to keep the compiler from making suggestions that may be unhelpful or misleading. For example: pub trait Foo {} pub trait Bar {} impl<T: Foo> Bar for T {} struct MyType; fn main() { let _object: &dyn Bar = &MyType; } error[E0277]: the trait bound `MyType: Bar` is not satisfied --> src/main.rs:9:29 | 9 | let _object: &dyn Bar = &MyType; | ^^^^ the trait `Foo` is not implemented for `MyType` | note: required for `MyType` to implement `Bar` --> src/main.rs:4:14 | 4 | impl<T: Foo> Bar for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here = note: required for the cast from `&MyType` to `&dyn Bar` For some APIs, it might make good sense for you to implement `Foo`, and get `Bar` indirectly by that blanket implementation. For others, it might be expected that most users should implement `Bar` directly, so that `Foo` suggestion is a red herring. In that case, adding the diagnostic hint will change the error message like so: #[diagnostic::do_not_recommend] impl<T: Foo> Bar for T {} error[E0277]: the trait bound `MyType: Bar` is not satisfied --> src/main.rs:10:29 | 10 | let _object: &dyn Bar = &MyType; | ^^^^ the trait `Bar` is not implemented for `MyType` | = note: required for the cast from `&MyType` to `&dyn Bar` See RFC 2397 for the original motivation, and the current reference for more details. ### `FromIterator` and `Extend` for tuples Earlier versions of Rust implemented convenience traits for iterators of `(T, U)` tuple pairs to behave like `Iterator::unzip`, with `Extend` in 1.56 and `FromIterator` in 1.79. These have now been _extended_ to more tuple lengths, from singleton `(T,)` through to 12 items long, `(T1, T2, .., T11, T12)`. For example, you can now use `collect()` to fanout into multiple collections at once: use std::collections::{LinkedList, VecDeque}; fn main() { let (squares, cubes, tesseracts): (Vec<_>, VecDeque<_>, LinkedList<_>) = (0i32..10).map(|i| (i * i, i.pow(3), i.pow(4))).collect(); println!("{squares:?}"); println!("{cubes:?}"); println!("{tesseracts:?}"); } [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] [0, 1, 8, 27, 64, 125, 216, 343, 512, 729] [0, 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561] ### Updates to `std::env::home_dir()` `std::env::home_dir()` has been deprecated for years, because it can give surprising results in some Windows configurations if the `HOME` environment variable is set (which is not the normal configuration on Windows). We had previously avoided changing its behavior, out of concern for compatibility with code depending on this non-standard configuration. Given how long this function has been deprecated, we're now updating its behavior as a bug fix, and a subsequent release will remove the deprecation for this function. ### Stabilized APIs * `BuildHasherDefault::new` * `ptr::fn_addr_eq` * `io::ErrorKind::QuotaExceeded` * `io::ErrorKind::CrossesDevices` * `{float}::midpoint` * Unsigned `{integer}::midpoint` * `NonZeroU*::midpoint` * impl `std::iter::Extend` for tuples with arity 1 through 12 * `FromIterator<(A, ...)>` for tuples with arity 1 through 12 * `std::task::Waker::noop` These APIs are now stable in const contexts * `mem::size_of_val` * `mem::align_of_val` * `Layout::for_value` * `Layout::align_to` * `Layout::pad_to_align` * `Layout::extend` * `Layout::array` * `std::mem::swap` * `std::ptr::swap` * `NonNull::new` * `HashMap::with_hasher` * `HashSet::with_hasher` * `BuildHasherDefault::new` * `<float>::recip` * `<float>::to_degrees` * `<float>::to_radians` * `<float>::max` * `<float>::min` * `<float>::clamp` * `<float>::abs` * `<float>::signum` * `<float>::copysign` * `MaybeUninit::write` ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.85.0 Many people came together to create Rust 1.85.0. We couldn't have done it without all of you. Thanks!
20.02.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
2024 State of Rust Survey Results Hello, Rustaceans! The Rust Survey Team is excited to share the results of our 2024 survey on the Rust Programming language, conducted between December 5, 2024 and December 23, 2024. As in previous years, the 2024 State of Rust Survey was focused on gathering insights and feedback from Rust users, and all those who are interested in the future of Rust more generally. This ninth edition of the survey surfaced new insights and learning opportunities straight from the global Rust language community, which we will summarize below. In addition to this blog post, **we have also prepared areport** containing charts with aggregated results of all questions in the survey. **Our sincerest thanks to every community member who took the time to express their opinions and experiences with Rust over the past year. Your participation will help us make Rust better for everyone.** There's a lot of data to go through, so strap in and enjoy! ## Participation **Survey** | **Started** | **Completed** | **Completion rate** | **Views** ---|---|---|---|--- 2023 | 11 950 | 9 710 | 82.2% | 16 028 2024 | 9 450 | 7 310 | 77.4% | 13 564 As shown above, in 2024, we have received fewer survey views than in the previous year. This was likely caused simply by the fact that the survey ran only for two weeks, while in the previous year it ran for almost a month. However, the completion rate has also dropped, which seems to suggest that the survey might be a bit too long. We will take this into consideration for the next edition of the survey. ## Community The State of Rust survey not only gives us excellent insight into how many Rust users around the world are using and experiencing the language but also gives us insight into the makeup of our global community. This information gives us a sense of where the language is being used and where access gaps might exist for us to address over time. We hope that this data and our related analysis help further important discussions about how we can continue to prioritize global access and inclusivity in the Rust community. Same as every year, we asked our respondents in which country they live in. The top 10 countries represented were, in order: United States (22%), Germany (14%), United Kingdom (6%), France (6%), China (5%), Canada (3%), Netherlands (3%), Russia (3%), Australia (2%), and Sweden (2%). We are happy to see that Rust is enjoyed by users from all around the world! You can try to find your country in the chart below: PNG]Β [[SVG] We also asked whether respondents consider themselves members of a marginalized community. Out of those who answered, 74.5% selected no, 15.5% selected yes, and 10% preferred not to say. We have asked the group that selected β€œyes” which specific groups they identified as being a member of. The majority of those who consider themselves a member of an underrepresented or marginalized group in technology identify as lesbian, gay, bisexual, or otherwise non-heterosexual. The second most selected option was neurodivergent at 46% followed by trans at 35%. PNG]Β [[SVG] Each year, we must acknowledge the diversity, equity, and inclusivity (DEI) related gaps in the Rust community and open source as a whole. We believe that excellent work is underway at the Rust Foundation to advance global access to Rust community gatherings and distribute grants to a diverse pool of maintainers each cycle, which you can learn more about here. Even so, global inclusion and access is just one element of DEI, and the survey working group will continue to advocate for progress in this domain. ## Rust usage The number of respondents that self-identify as a Rust user was quite similar to last year, around 92%. This high number is not surprising, since we primarily target existing Rust developers with this survey. PNG]Β [[SVG] Similarly as last year, around 31% of those who did not identify as Rust users cited the perception of difficulty as the primary reason for not using Rust. The most common reason for not using Rust was that the respondents simply haven’t had the chance to try it yet. PNG]Β [SVG]Β [[Wordcloud of open answers] Of the former Rust users who participated in the 2024 survey, 36% cited factors outside their control as a reason why they no longer use Rust, which is a 10pp decrease from last year. This year, we also asked respondents if they would consider using Rust again if an opportunity comes up, which turns out to be true for a large fraction of the respondents (63%). That is good to hear! PNG]Β [SVG]Β [[Wordcloud of open answers] > Closed answers marked with N/A were not present in the previous version(s) of the survey. Those not using Rust anymore told us that it is because they don't really need it (or the goals of their company changed) or because it was not the right tool for the job. A few reported being overwhelmed by the language or its ecosystem in general or that switching to or introducing Rust would have been too expensive in terms of human effort. Of those who used Rust in 2024, 53% did so on a daily (or nearly daily) basis β€” an increase of 4pp from the previous year. We can observe an upward trend in the frequency of Rust usage over the past few years, which suggests that Rust is being increasingly used at work. This is also confirmed by other answers mentioned in the Rust at Work section later below. PNG]Β [[SVG] Rust expertise is also continually increasing amongst our respondents! 20% of respondents can write (only) simple programs in Rust (a decrease of 3pp from 2023), while 53% consider themselves productive using Rust β€” up from 47% in 2023. While the survey is just one tool to measure the changes in Rust expertise overall, these numbers are heartening as they represent knowledge growth for many Rustaceans returning to the survey year over year. PNG]Β [[SVG] Unsurprisingly, the most popular version of Rust is _latest stable_ , either the most recent one or whichever comes with the users' Linux distribution. Almost a third of users also use the latest nightly release, due to various reasons (see below). However, it seems that the beta toolchain is not used much, which is a bit unfortunate. We would like to encourage Rust users to use the beta toolchain more (e.g. in CI environments) to help test soon-to-be stabilized versions of Rust. PNG]Β [SVG]Β [[Wordcloud of open answers] People that use the nightly toolchain mostly do it to gain access to specific unstable language features. Several users have also mentioned that rustfmt works better for them on nightly or that they use the nightly compiler because of faster compilation times. PNG]Β [SVG]Β [[Wordcloud of open answers] ## Learning Rust To use Rust, programmers first have to learn it, so we are always interested in finding out how do they approach that. Based on the survey results, it seems that most users learn from Rust documentation and also from The Rust Programming Language book, which has been a favourite learning resource of new Rustaceans for a long time. Many people also seem to learn by reading the source code of Rust crates. The fact that both the documentation and source code of tens of thousands of Rust crates is available on docs.rs and GitHub makes this easier. PNG]Β [SVG]Β [[Wordcloud of open answers] In terms of answers belonging to the "Other" category, they can be clustered into three categories: people using LLM (large language model) assistants (Copilot, ChatGPT, Claude, etc.), reading the official Rust forums (Discord, URLO) or being mentored while contributing to Rust projects. We would like to extend a big thank you to those making our spaces friendly and welcoming for newcomers, as it is important work and it pays off. Interestingly, a non-trivial number of people "learned by doing" and used rustc error messages and clippy as a guide, which is a good indicator of the quality of Rust diagnostics. In terms of formal education, it seems that Rust has not yet penetrated university curriculums, as this is typically a very slowly moving area. Only a very small number of respondents (around 3%) have taken a university Rust course or used university learning materials. PNG]Β [[SVG] ## Programming environment In terms of operating systems used by Rustaceans, Linux was the most popular choice, and it seems that it is getting increasingly popular year after year. It is followed by macOS and Windows, which have a very similar share of usage. PNG]Β [SVG]Β [[Wordcloud of open answers] > As you can see in the wordcloud, there are also a few users that prefer Arch, btw. Rust programmers target a diverse set of platforms with their Rust programs. We saw a slight uptick in users targeting embedded and mobile platforms, but otherwise the distribution of platforms stayed mostly the same as last year. Since the WebAssembly target is quite diverse, we have split it into two separate categories this time. Based on the results it is clear that when using WebAssembly, it is mostly in the context of browsers (23%) rather than other use-cases (7%). PNG]Β [SVG]Β [[Wordcloud of open answers] We cannot of course forget the favourite topic of many programmers: which IDE (developer environment) they use. Although Visual Studio Code still remains the most popular option, its share has dropped by 5pp this year. On the other hand, the Zed editor seems to have gained considerable traction recently. The small percentage of those who selected "Other" are using a wide range of different tools: from CursorAI to classics like Kate or Notepad++. Special mention to the 3 people using "ed", that's quite an achievement. PNG]Β [SVG]Β [[Wordcloud of open answers] > You can also take a look at the linked wordcloud that summarizes open answers to this question (the "Other" category), to see what other editors are also popular. ## Rust at Work We were excited to see that more and more people use Rust at work for the majority of their coding, 38% vs 34% from last year. There is a clear upward trend in this metric over the past few years. PNG]Β [[SVG] The usage of Rust within companies also seems to be rising, as 45% of respondents answered that their organisation makes non-trivial use of Rust, which is a 7pp increase from 2023. PNG]Β [[SVG] Once again, the top reason employers of our survey respondents invested in Rust was the ability to build relatively correct and bug-free software. The second most popular reason was Rust’s performance characteristics. 21% of respondents that use Rust at work do so because they already know it, and it's thus their default choice, an uptick of 5pp from 2023. This seems to suggest that Rust is becoming one of the baseline languages of choice for more and more companies. PNG]Β [[SVG] Similarly to the previous year, a large percentage of respondents (82%) report that Rust helped their company achieve its goals. In general, it seems that programmers and companies are quite happy with their usage of Rust, which is great! PNG]Β [[SVG] In terms of technology domains, the situation is quite similar to the previous year. Rust seems to be especially popular for creating server backends, web and networking services and cloud technologies. It also seems to be gaining more traction for embedded use-cases. PNG]Β [SVG]Β [[Wordcloud of open answers] > You can scroll the chart to the right to see more domains. Note that the Automotive domain was not offered as a closed answer in the 2023 survey (it was merely entered through open answers), which might explain the large jump. It is exciting to see the continued growth of professional Rust usage and the confidence so many users feel in its performance, control, security and safety, enjoyability, and more! ## Challenges As always, one of the main goals of the State of Rust survey is to shed light on challenges, concerns, and priorities on Rustaceans’ minds over the past year. We have asked our users about aspects of Rust that limit their productivity. Perhaps unsurprisingly, slow compilation was at the top of the list, as it seems to be a perennial concern of Rust users. As always, there are efforts underway to improve the speed of the compiler, such as enabling the parallel frontend or switching to a faster linker by default. We invite you to test these improvements and let us know if you encounter any issues. Other challenges included subpar support for debugging Rust and high disk usage of Rust compiler artifacts. On the other hand, most Rust users seem to be very happy with its runtime performance, the correctness and stability of the compiler and also Rust's documentation. PNG]Β [SVG]Β [[Wordcloud of open answers] In terms of specific unstable (or missing) features that Rust users want to be stabilized (or implemented), the most desired ones were async closures and if/let while chains. Well, we have good news! Async closures will be stabilized in the next version of Rust (1.85), and if/let while chains will hopefully follow soon after, once Edition 2024 is released (which will also happen in Rust 1.85). Other coveted features are generators (both sync and async) and more powerful generic const expressions. You can follow the Rust Project Goals to track the progress of these (and other) features. PNG]Β [SVG]Β [[Wordcloud of open answers] In the open answers to this question, people were really helpful and tried hard to describe the most notable issues limiting their productivity. We have seen mentions of struggles with async programming (an all-time favourite), debuggability of errors (which people generally love, but they are not perfect for everyone) or Rust tooling being slow or resource intensive (rust-analyzer and rustfmt). Some users also want a better IDE story and improved interoperability with other languages. This year, we have also included a new question about the speed of Rust's evolution. While most people seem to be content with the status quo, more than a quarter of people who responded to this question would like Rust to stabilize and/or add features more quickly, and only 7% of respondents would prefer Rust to slow down or completely stop adding new features. PNG]Β [[SVG] Interestingly, when we asked respondents about their main worries for the future of Rust, one of the top answers remained the worry that Rust will become too complex. This seems to be in contrast with the answers to the previous question. Perhaps Rust users still seem to consider the complexity of Rust to be manageable, but they worry that one day it might become too much. We are happy to see that the amount of respondents concerned about Rust Project governance and lacking support of the Rust Foundation has dropped by about 6pp from 2023. PNG]Β [SVG]Β [[Wordcloud of open answers] ## Looking ahead Each year, the results of the State of Rust survey help reveal the areas that need improvement in many areas across the Rust Project and ecosystem, as well as the aspects that are working well for our community. If you have any suggestions for the Rust Annual survey, please let us know! We are immensely grateful to those who participated in the 2024 State of Rust Survey and facilitated its creation. While there are always challenges associated with developing and maintaining a programming language, this year we were pleased to see a high level of survey participation and candid feedback that will truly help us make Rust work better for everyone. If you’d like to dig into more details, we recommend you to browse through the full survey report.
13.02.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
crates.io: development update Back in July 2024, we published a blog post about the ongoing development of crates.io. Since then, we have made a lot of progress and shipped a few new features. In this blog post, we want to give you an update on the latest changes that we have made to crates.io. ## Crate deletions In RFC #3660 we proposed a new feature that allows crate owners to delete their crates from crates.io under certain conditions. This can be useful if you have published a crate by mistake or if you want to remove a crate that is no longer maintained. After the RFC was accepted by all team members at the end of August, we began implementing the feature. We created a new API endpoint `DELETE /api/v1/crates/:name` that allows crate owners to delete their crates and then created the corresponding user interface. If you are the owner of a crate, you can now go to the crate page, open the "Settings" tab, and find the "Delete this crate" button at the bottom. Clicking this button will lead you to a confirmation page telling you about the potential impact of the deletion and requirements that need to be met in order to delete the crate: As you can see from the screenshot above, a crate can only be deleted if either: the crate has been published for less than 72 hours or the crate only has a single owner, and the crate has been downloaded less than 500 times for each month it has been published, and the crate is not depended upon by any other crate on crates.io. These requirements were put in place to prevent abuse of the deletion feature and to ensure that crates that are widely used by the community are not deleted accidentally. If you have any feedback on this feature, please let us know! ## OpenAPI description Around the holiday season we started experimenting with generating an OpenAPI description for the crates.io API. This was a long-standing request from the community, and we are happy to announce that we now have an experimental OpenAPI description available at https://crates.io/api/openapi.json! Please note that this is still considered work-in-progress and e.g. the stability guarantees for the endpoints are not written down and the response schemas are also not fully documented yet. You can view the OpenAPI description in e.g. a Swagger UI at https://petstore.swagger.io/ by putting `https://crates.io/api/openapi.json` in the top input field. We decided to not ship a viewer ourselves for now due to security concerns with running it on the same domain as crates.io itself. We may reconsider whether to offer it on a dedicated subdomain in the future if there is enough interest. The OpenAPI description is generated by the utoipa crate, which is a tool that can be integrated with the axum web framework to automatically generate OpenAPI descriptions for all of your endpoints. We would like to thank Juha Kukkonen for his great work on this tool! ## Support form and "Report Crate" button Since the crates.io team is small and mostly consists of volunteers, we do not have the capacity to manually monitor all publishes. Instead, we rely on you, the Rust community, to help us catch malicious crates and users. To make it easier for you to report suspicious crates, we added a "Report Crate" button to all the crate pages. If you come across a crate that you think is malicious or violates the code of conduct or our usage policy, you can now click the "Report Crate" button and fill out the form that appears. This will send an email to the crates.io team, who will then review the crate and take appropriate action if necessary. Thank you to crates.io team member @eth3lbert who worked on the majority of this. If you have any issues with the support form or the "Report Crate" button, please let us know. You can also always email us directly at help@crates.io if you prefer not to use the form. ## Publish notifications We have added a new feature that allows you to receive email notifications when a new version of your crate is published. This can be useful in detecting unauthorized publishes of your crate or simply to keep track of publishes from other members of your team. This feature was another long-standing feature request from our community, and we were happy to finally implement it. If you'd prefer not to receive publish notifications, then you can go to your account settings on crates.io and disable these notifications. ## Miscellaneous These were some of the more visible changes to crates.io over the past couple of months, but a lot has happened "under the hood" as well. * RFC #3691 was opened and accepted to implement "Trusted Publishing" support on crates.io, similar to other ecosystems that adopted it. This will allow you to specify on crates.io which repository/system is allowed to publish new releases of your crate, allowing you to publish crates from CI systems without having to deal with API tokens anymore. * Slightly related to the above: API tokens created on crates.io now expire after 90 days by default. It is still possible to disable the expiry or choose other expiry durations though. * The crates.io team was one of the first projects to use the diesel database access library, but since that only supported synchronous execution it was sometimes a little awkward to use in our codebase, which was increasingly moving into an async direction after our migration to axum a while ago. The maintainer of diesel, Georg Semmler, did a lot of work to make it possible to use diesel in an async way, resulting in the diesel-async library. Over the past couple of months we incrementally ported crates.io over to `diesel-async` queries, which now allows us to take advantage of the internal query pipelining in `diesel-async` that resulted in some of our API endpoints getting a 10-15% performance boost. Thank you, Georg, for your work on these crates! * Whenever you publish a new version or yank/unyank existing versions a couple of things need to be updated. Our internal database is immediately updated, and then we synchronize the sparse and git index in background worker jobs. Previously, yanking and unyanking a high number of versions would each queue up another synchronization background job. We have now implemented automatic deduplication of redundant background jobs, making our background worker a bit more efficient. * The final big, internal change that was just merged last week is related to the testing of our frontend code. In the past we used a tool called Mirage to implement a mock version of our API, which allowed us to run our frontend test suite without having to spin up a full backend server. Unfortunately, the maintenance situation around Mirage had lately forced us to look into alternatives, and we are happy to report that we have now fully migrated to the "Industry standard API mocking" package msw. If you want to know more, you can find the details in the "small" migration pull request. ## Feedback We hope you enjoyed this update on the development of crates.io. If you have any feedback or questions, please let us know on Zulip or GitHub. We are always happy to hear from you and are looking forward to your feedback!
05.02.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.84.1 The Rust team has published a new point release of Rust, 1.84.1. Rust is a programming language that is empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via rustup, getting Rust 1.84.1 is as easy as: rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website. ## What's in 1.84.1 1.84.1 resolves a few regressions introduced in 1.84.0: * Fix ICE 132920 in duplicate-crate diagnostics. * Fix errors for overlapping impls in incremental rebuilds. * Fix slow compilation related to the next-generation trait solver. * Fix debuginfo when LLVM's location discriminator value limit is exceeded. It also includes several fixes for those building Rust from source: * Only try to distribute `llvm-objcopy` if LLVM tools are enabled. * Add Profile Override for Non-Git Sources. * Resolve symlinks of LLVM tool binaries before copying them. * Make it possible to use ci-rustc on tarball sources. ### Contributors to 1.84.1 Many people came together to create Rust 1.84.1. We couldn't have done it without all of you. Thanks!
30.01.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
December Project Goals Update Over the last six months, the Rust project has been working towards a slate of 26 project goals, with 3 of them designated as Flagship Goals. This post provides a final update on our progress towards these goals (or, in some cases, lack thereof). We are currently finalizing plans for the next round of project goals, which will cover 2025H1. The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** Our big goal for this period was async closures, and we are excited to announce that work there is done! Stable support for async closures landed on nightly on Dec 12 and it will be included in Rust 1.85, which ships on Feb 20. Big kudos to compiler-errors for driving that. For our other goals, we made progress, but there remains work to be done: * **Return Type Notation (RTN)** is implemented and we had a call for experimentation but it has not yet reached stable. This will be done as part of our 2025H1 goal. * Async Functions in Traits (and Return Position Impl Trait in Trait) are currently not consided `dyn` compatible. We would eventually like to have first-class `dyn` support, but as an intermediate step we created a procedural macro crate `dynosaur`1 that can create wrappers that enable **dynamic dispatch**. We are planning a comprehensive blog post in 2025H1 that shows how to use this crate and lays out the overall plan for async functions in traits. * Work was done to prototype an **implementation for async drop** but we didn't account for reviewing bandwidth. nikomatsakis has done initial reads and is working with PR author to get this done in 2025H1. To be clear though the scope of this is an experiment with the goal of uncovering implementation hurdles. There remains significant language design work before this feature would be considered for stabilization (we don't even have an RFC, and there are lots of unknowns remaining). * We have had fruitful discussions about the trait for **async iteration** but do not have widespread consensus, that's on the docket for 2025H1. **Resolve the biggest blockers to Linux building on stable Rust** We largely completed our goal to stabilize the language features used by the Rust for Linux project. In some cases a small amount of work remains. Over the last six months, we... * stabilized the `offset_of!` macro to get the offset of fields; * _almost_ stabilized the `CoercePointee` trait -- but discovered that the current implementaton was revealing unstable details, which is currently being resolved; * `asm_goto` stabilization PR and reference updates are up, excluding the "output" feature. * completed the majority of the work for arbitrary self types, which is being used by RfL and just needs documentation before stabilisation We also began work on compiler flag stabilization with RFC 3716, which outlines a scheme for stabilizing flags that modify the target ABI. Big shout-outs to Ding Xiang Fei, Alice Ryhl, Adrian Taylor, and Gary Guo for doing the lion's share of the work here. **Rust 2024 Edition** The final release of Rust 2024 is confirmed for February 20, 2025 as part of Rust 1.85. Rust 1.85 is currently in beta. Feedback from the nightly beta and crater runs has been actively addressed, with adjustments to migrations and documentation to enhance user experience. Big shout-outs to TC and Eric Huss for their hard work driving this program forward. ## Final goal updates **" Stabilizable" prototype for expanded const generics** Over the last six months a number of internal refactorings have taken place that are necessary to support a `min_generic_const_args` prototype. One refactoring is that we have changed how we represent const arguments in the compiler to allow for adding a separate representation for the kinds of const arguments that `min_generic_const_args` will add. Another big refactoring is that we have changed the API surface for our representation of const arguments in the type system layer, there is no longer a way to evaluate a const argument without going through our general purpose type system logic. This was necessary to ensure that we correctly handle equality of the kinds of const arguments that `min_generic_const_args` will support. With all of these pre-requisite refactorings completed, a feature gate has been added to the compiler (`feature(min_generic_const_args)`) that uses the new internal representation of const arguments. We are now beginning to implement the actual language changes under this feature gate. Shout-out to camelid, boxy and compiler-errors. **Begin resolving `cargo-semver-checks` blockers for merging into cargo** Over the course of the last six months... * cargo semver-checks began to include generic parameters and bounds in its schema, allowing for more precise lints; * cargo manifest linting was implemented and merged, allowing for lints that look at the cargo manifest; * building on cargo manifest linting, the `feature_missing` lint was added, which identifies breakage caused by the removal of a package feature. In addition, we fleshed out a design sketch for the changes in rustdoc's JSON support that are needed to support cross-crate item linting. This in turn requires compiler extensions to supply that information to rustdoc. **Const traits** * Progress was made on adding const traits and implementation in the compiler, with improvements being carefully considered. `Add` was constified in rust#133237 and `Deref`/`DerefMut` in rust#133260. * Further progress was made on implementing stability for the const traits feature in rust#132823 and rust#133999, with additional PRs constifying more traits open at rust#133995 and rust#134628. **Ergonomic ref-counting** * Over the last six months, we created a lang-team experiment devoted to this issue and spastorino began work on an experimental implementation. joshtriplett authored RFC 3680, which has received substantial feedback. The current work is focused on identifying "cheaply cloneable" types and making it easy to create closures that clone them instead of moving them. **Explore sandboxed build scripts** * Alternatives to sandboxed build scripts are going to be investigated instead of continuing this project goal into 2025h1 - namely, declaratively configuring system dependencies with `system-deps`, using an approach similar to code-checker Cackle and its sandbox environment Bubblewrap, or fully-sandboxed build environments like Docker or Nix. **Extend pubgrub to match cargo 's dependency resolution** * Significant speedups have been achieved, reducing the slowest crate resolution time from over 120 seconds to 11 seconds, and decreasing the time to check all crates from 178 minutes to 71.42 minutes. * Performance improvements have been made to both the existing resolver and the new implementation, with the lock file verification time for all crates reduced from 44.90 minutes to 32.77 minutes (excluding some of the hardest cases). **Make Rustdoc Search easier to learn** * Our pull request adding example searches and adding a search button has been added to the agenda for the rustdoc team next meeting. **Next-generation trait solver** * The `-Znext-solver=coherence` stabilization is now stable in version 1.84, with a new update blogpost published. * Significant progress was made on bootstrap with `-Znext-solver=globally`. We're now able to compile rustc and cargo, enabling try-builds and perf runs. **Optimizing Clippy & linting** * An optimisation for the `#[clippy::msrv]` lint is open, benchmarked, and currently under review. * Help is needed on any issue marked with `performance-project`, especially on issue #13714. **Patterns of empty types** * Over the course of this goal, Nadrieril wrote and posted the never patterns RFC as an attempt to make progress without figuring out the whole picture, and the general feedback was "we want to see the whole picture". Next step will be to write up an RFC that includes a clear proposal for which empty patterns can and cannot be omitted. This is 100% bottlenecked on my own writing bandwidth (reach out if you want to help!). Work will continue but the goal won't be resubmitted for 2025h1. **Scalable Polonius support on nightly** * Amanda has made progress on removing placeholders, focusing on lazy constraints and early error reporting, as well as investigating issues with rewriting type tests; a few tests are still failing, and it seems error reporting and diagnostics will be hard to keep exactly as today. * @lqd has opened PRs to land the prototype of the location-sensitive analysis. It's working well enough that it's worthwhile to land; there is still a lot of work left to do, but it's a major milestone, which we hoped to achieve with this project goal. **Stabilize cargo-script** * A fix stopping cargo-script from overriding the release profile was posted and merged. * Help is wanted for writing frontmatter support in rustc, as rustfmt folks are requesting it to be represented in the AST. **Stabilize doc_cfg** * RFC is done, waiting for all rustdoc team members to take a look before implementation can start. **Stabilize parallel front end** * SparrowLii proposed a 2025H1 project goal to continue stabilizing the parallel front end, focusing on solving reproducible deadlock issues and improving parallel compilation performance. * The team discussed solutions to avoid potential deadlocks, finding that disabling work-stealing in rayon's subloops is effective, and will incorporate related modifications in a PR. **Use annotate-snippets for rustc diagnostic output** * Progress on `annotate-snippets` continued despite a busy schedule, with a focus on improving suggestions and addressing architectural challenges. * A new API was designed in collaboration with epage, aiming to align `annotate-snippets` more closely with `rustc` for easier contribution and integration. **Assemble project goal slate** * The project goal slate for 2025h1 has been posted as an RFC and is waiting on approval from project team leads. **Expose experimental LLVM features for automatic differentiation and GPU offloading** * Another pull request was merged with only one remaining until a working MVP is available on nightly. * Some features were removed to simplify upstreaming and will be added back as single PRs. * Will start work on `batching` feature of LLVM/Enzyme which allows Array of Struct and Struct of Array vectorisation. * There's been a push to add a AMD GPU target to the compiler which would have been needed for the LLVM offload project. **Survey tools suitability for Std safety verification** * We have written and verified around 220 safety contracts in the verify-rust-std fork. * 3 out of 14 challenges have been solved. * We have successfully integrated Kani in the repository CI, and we are working on the integration of 2 other verification tools: VeriFast and Goto-transcoder (ESBMC) **Testing infra + contributors for a-mir-formality** * There wasn't any progress on this goal, but building a community around a-mir-formality is still a goal and future plans are coming. ## Goals without updates The following goals have not received updates in the last month: **Associated type position impl trait** **Implement "merged doctests" to save doctest time** **Provided reasons for yanked crates** **User-wide build cache** 1. As everyone knows, the hardest part of computer-science is naming. I think we rocked this one. ↩
23.01.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Rust 2024 in beta channel # Rust 2024 in beta channel The next edition, Rust 2024, has entered the beta channel. It will live there until 2025-02-20, when Rust 1.85 and Rust 2024 will be released as stable. We're really happy with how Rust 2024 has turned out, and we're looking forward to putting it in your hands. You can get a head start in preparing your code for the new edition, and simultaneously help us with final testing of Rust 2024, by following these steps within a project: 1. Run `rustup update beta`. 2. Run `cargo update`. 3. Run `cargo +beta fix --edition`. 4. Set `edition = "2024"` and, if needed, `rust-version = "1.85"`, in `Cargo.toml`. 5. Run `cargo +beta check`, address any remaining warnings, and then run other tests. More details on how to migrate can be found here and within each of the chapters describing the changes in Rust 2024. For more on the changes themselves, see the Edition Guide. If you encounter any problems or see areas where we could make the experience better, tell us about it by filing an issue.
22.01.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.84.0 The Rust team is happy to announce a new version of Rust, 1.84.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.84.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.84.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.84.0 stable ### Cargo considers Rust versions for dependency version selection 1.84.0 stabilizes the minimum supported Rust version (MSRV) aware resolver, which prefers dependency versions compatible with the project's declared MSRV. With MSRV-aware version selection, the toil is reduced for maintainers to support older toolchains by not needing to manually select older versions for each dependency. You can opt-in to the MSRV-aware resolver via `.cargo/config.toml`: [resolver] incompatible-rust-versions = "fallback" Then when adding a dependency: $ cargo add clap Updating crates.io index warning: ignoring clap@4.5.23 (which requires rustc 1.74) to maintain demo's rust-version of 1.60 Adding clap v4.0.32 to dependencies Updating crates.io index Locking 33 packages to latest Rust 1.60 compatible versions Adding clap v4.0.32 (available: v4.5.23, requires Rust 1.74) When verifying the latest dependencies in CI, you can override this: $ CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=allow cargo update Updating crates.io index Locking 12 packages to latest compatible versions Updating clap v4.0.32 -> v4.5.23 You can also opt-in by setting `package.resolver = "3"` in the Cargo.toml manifest file though that will require raising your MSRV to 1.84. The new resolver will be enabled by default for projects using the 2024 edition (which will stabilize in 1.85). This gives library authors more flexibility when deciding their policy on adopting new Rust toolchain features. Previously, a library adopting features from a new Rust toolchain would force downstream users of that library who have an older Rust version to either upgrade their toolchain or manually select an old version of the library compatible with their toolchain (and avoid running `cargo update`). Now, those users will be able to automatically use older library versions compatible with their older toolchain. See the documentation for more considerations when deciding on an MSRV policy. ### Migration to the new trait solver begins The Rust compiler is in the process of moving to a new implementation for the trait solver. The next-generation trait solver is a reimplementation of a core component of Rust's type system. It is not only responsible for checking whether trait-bounds - e.g. `Vec<T>: Clone` - hold, but is also used by many other parts of the type system, such as normalization - figuring out the underlying type of `<Vec<T> as IntoIterator>::Item` - and equating types (checking whether `T` and `U` are the same). In 1.84, the new solver is used for checking coherence of trait impls. At a high level, coherence is responsible for ensuring that there is at most one implementation of a trait for a given type while considering not yet written or visible code from other crates. This stabilization fixes a few mostly theoretical correctness issues of the old implementation, resulting in potential "conflicting implementations of trait ..." errors that were not previously reported. We expect the affected patterns to be very rare based on evaluation of available code through Crater. The stabilization also improves our ability to prove that impls do _not_ overlap, allowing more code to be written in some cases. For more details, see a previous blog post and the stabilization report. ### Strict provenance APIs In Rust, pointers are not simply an "integer" or "address". For instance, a "use after free" is undefined behavior even if you "get lucky" and the freed memory gets reallocated before your read/write. As another example, writing through a pointer derived from an `&i32` reference is undefined behavior, even if writing to the same address via a different pointer is legal. The underlying pattern here is that _the way a pointer is computed matters_ , not just the address that results from this computation. For this reason, we say that pointers have **provenance** : to fully characterize pointer-related undefined behavior in Rust, we have to know not only the address the pointer points to, but also track which other pointer(s) it is "derived from". Most of the time, programmers do not need to worry much about provenance, and it is very clear how a pointer got derived. However, when casting pointers to integers and back, the provenance of the resulting pointer is underspecified. With this release, Rust is adding a set of APIs that can in many cases replace the use of integer-pointer-casts, and therefore avoid the ambiguities inherent to such casts. In particular, the pattern of using the lowest bits of an aligned pointer to store extra information can now be implemented without ever casting a pointer to an integer or back. This makes the code easier to reason about, easier to analyze for the compiler, and also benefits tools like Miri and architectures like CHERI that aim to detect and diagnose pointer misuse. For more details, see the standard library documentation on provenance. ### Stabilized APIs * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_unicast_link_local` * `core::ptr::with_exposed_provenance` * `core::ptr::with_exposed_provenance_mut` * `<ptr>::addr` * `<ptr>::expose_provenance` * `<ptr>::with_addr` * `<ptr>::map_addr` * `<int>::isqrt` * `<int>::checked_isqrt` * `<uint>::isqrt` * `NonZero::isqrt` * `core::ptr::without_provenance` * `core::ptr::without_provenance_mut` * `core::ptr::dangling` * `core::ptr::dangling_mut` * `Pin::as_deref_mut` These APIs are now stable in const contexts * `AtomicBool::from_ptr` * `AtomicPtr::from_ptr` * `AtomicU8::from_ptr` * `AtomicU16::from_ptr` * `AtomicU32::from_ptr` * `AtomicU64::from_ptr` * `AtomicUsize::from_ptr` * `AtomicI8::from_ptr` * `AtomicI16::from_ptr` * `AtomicI32::from_ptr` * `AtomicI64::from_ptr` * `AtomicIsize::from_ptr` * `<ptr>::is_null` * `<ptr>::as_ref` * `<ptr>::as_mut` * `Pin::new` * `Pin::new_unchecked` * `Pin::get_ref` * `Pin::into_ref` * `Pin::get_mut` * `Pin::get_unchecked_mut` * `Pin::static_ref` * `Pin::static_mut` ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.84.0 Many people came together to create Rust 1.84.0. We couldn't have done it without all of you. Thanks!
09.01.2025 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
November project goals update The Rust project is currently working towards a slate of 26 project goals, with 3 of them designed as Flagship Goals. This post provides selected updates on our progress towards these goals (or, in some cases, lack thereof). The full details for any particular goal are available in its associated tracking issue on the rust-project-goals repository. ## Flagship goals **Bring the Async Rust experience closer to parity with sync Rust** Async closure stabilization has been approved, though the stabilization has not yet landed! The lang team ultimately opted to stabilize the trait name `AsyncFn` rather than the keyword-based `async Fn` syntax that was originally proposed. This decision came after discussion on the Flavors RFC which made it clear we were not at a consensus about whether the `async Trait` keyword would be used more generally or not. Given that, the team felt that the `AsyncFn` synta was a fine "next step". If we do ultimately adopt some form of `async Trait` keyword syntax, then `AsyncFn` can become a trait alias. Regarding return-type notation, an extension of return-type notation to cover Self::foo(..): Send landed and we landed #132047 which fixes a known ICE. Stabilization PR is now unblocked. No major progress towards async drop reviews or team reorganization. **Resolve the biggest blockers to Linux building on stable Rust** This month saw steady progress on our checklist. dingxiangfei2009's PR renaming `derive(SmartPointer)` to `derive(CoercePointee)` was merged and he began the work to port the RFL codebase to use the new name. Alice Ryhl opened RFC #3716 proposing a way to manage compiler flags that alter the ABI and discussion (and some implementation work) has ensued. Finally, we landed PR #119364 making target blocks in asm-goto safe by default; this was based directly on experience from RFL which showed that safe would be more useful]. We are still working to finalize another extension to asm-goto that arose from RFL requirements, allowing `const` to support embedded pointers. Finally we prepared reference PR #1610 describing the change to permit [Pointers to Statics in Constants that was stabilized last month. **Rust 2024 Edition** Rust 2024 has now entered the nightly beta and is expected to stabilize as part of Rust 1.85 on 2025-02-20. It has a great many improvements that make the language more consistent and ergonomic, that further upon our relentless commitment to safety, and that will open the door to long-awaited features such as gen blocks, let chains, and the never type `!`. For more on the changes, see the nightly Edition Guide. The call for testing blog post contains more information and instructions on how you can try it yourself. ## Goals with updates **" Stabilizable" prototype for expanded const generics** * `min_generic_const_args` now exists as a feature gate, though without any functionality, only some gated refactorings, but shouldn't be long before it has actual functionality behind it. * The refactoring to remove all the `eval_x` methods on `ty::Const` has been completed, making it possible to correctly implement normalization for constants. **Assemble project goal slate** * Posted the October update. * Created more automated infrastructure to prepare the October update, making use of an LLM to summarize updates into one or two sentences for a concise table. **Begin resolving `cargo-semver-checks` blockers for merging into cargo** * Support for cargo manifest linting is now merged, making it possible to catch breakage caused by _manifest_ (`Cargo.toml`) changes, not just source code changes. An example of such breakage is the removal of a package feature: any crates that enabled the removed feature will no longer build. * Partial schema design and implementation of type information in lints, enabling the creation of breaking-change lints and improving diagnostic quality for a subset of type-related breaking changes. * Resolved multi-team questions that were blocking cross-crate checking, with the compiler team MCP merged and rustdoc improvements discussed and agreed upon. **Const traits** * The way const traits are desugared was completely restructured, making the design easier to understand and more robust against current unit tests. * Significant development and cleanup for the feature has been done, with several pull requests merged and two still open, bringing the feature closer to being able to dogfood on the standard library and closer to stabilization. **Ergonomic ref-counting** * @joshtriplett opened https://github.com/rust-lang/rfcs/pull/3680. The @rust-lang/lang team has not yet truly discussed or reached a decision on that RFC. * @spastorino began implementation work on a prototype. **Explore sandboxed build scripts** * The sandboxed build scripts exploration is complete. We are unlikely to continue this work in next year but the research may be useful in other areas, such as the possible addition of POSIX process support to WASI or a declarative system dependency configuration in Cargo. **Expose experimental LLVM features for automatic differentiation and GPU offloading** * The re-design of the autodiff middle/backend was implemented, reducing the remaining LoC to be upstreamed from 2.5k to 1.1k, split into two PRs (1 and 2), which received initial feedback and are expected to land in early December. * The preprint of the first paper utilizing `std::autodiff` is available on Arxiv, with code available at ChemAI-Lab/molpipx, showcasing significantly faster compilation times in Rust compared to JAX. **Extend pubgrub to match cargo 's dependency resolution** * The core data structures of PubGrub have been published as a separate `version-ranges` crate, enabling multiple projects to share this core abstraction and benefit from improvements without waiting for the rest of the project. * This is one of many steps required to publish a new `0.3.0` version of the PubGrub crate. **Make Rustdoc Search easier to learn** * Rustdoc will now show type signatures in the search results page, and the boxing transform behaves more like Hoogle's does. * Improvements to matching behavior have been made to fit user expectations. **Next-generation trait solver** * We stabilized `-Znext-solver=coherence` again in https://github.com/rust-lang/rust/pull/130654. It's looking like the stabilization will actually go through this time. * We're currently refactoring the way the current "typing mode" is tracked, working to fix trait-system-refactoring#106. An FCP was started to clean up the way we merge candidates when proving trait goals. **Optimizing Clippy & linting** * rust-lang/rust#125116 has been merged, marking half of the goal as formally completed. * Discussions on using `cargo cache` on CI are beginning to take form. * rust-lang/rust#125116 may be contested in results. The impact may not be as large as expected, even on Clippy. * We've been experimenting with Clippy using `rustc_driver` as a static library, instead of dynamic linking. This would be us both a way to check the performance impact of `rustc_driver` as a shared library, **and** a way to profile Clippy without filtering between `dl_*` calls. **Patterns of empty types** * The never patterns RFC was posted. * Feedback on the RFC suggests that the question of "which arms can be omitted" isn't as orthogonal as hoped, so the focus will switch to that. **Provided reasons for yanked crates** * The PR https://github.com/rust-lang/crates.io/pull/9423 has been merged. * Work is ongoing on the frontend feature. **Scalable Polonius support on nightly** * Amanda's EuroRust talk on polonius from last month is also now available on YouTube. * Implementation work continues, mostly on a branch. Major developments include a new debugger which has accelerated progress. There are about 70 test failures left to be analyzed. **Stabilize cargo-script** * rust-lang/cargo#14670 and rust-lang/cargo#14749 have been posted and merged. * rust-lang/cargo#14792 has been posted. **Stabilize parallel front end** * Still in the process of determining the cause of the deadlock through local testing and compiler code analysis. * **Help wanted:** Try to reproduce deadlocks described in the issue list. **Survey tools suitability for Std safety verification** * A new partnership between the Rust Foundation and AWS will help fund this effort. The verification challenges in the verify-rust-std fork now have financial rewards for those completing them. * **Help wanted:** Help needed to write more contracts, to integrate new tools, to review pull requests or to participate in the repository discussions. **Testing infra + contributors for a-mir-formality** * We decided to close this goal as we have not been making steady progress. We are evaluating what to propose the 2025h1 round of goals. ## Goals without updates The following goals have not received updates in the last month: **Associated type position impl trait** **Implement "merged doctests" to save doctest time** **Stabilize doc_cfg** **Use annotate-snippets for rustc diagnostic output** **User-wide build cache**
16.12.2024 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Launching the 2024 State of Rust Survey It’s time for the 2024 State of Rust Survey! Since 2016, the Rust Project has collected valuable information and feedback from the Rust programming language community through our annual State of Rust Survey. This tool allows us to more deeply understand how the Rust Project is performing, how we can better serve the global Rust community, and who our community is composed of. Like last year, the 2024 State of Rust Survey will likely take you between 10 and 25 minutes, and responses are anonymous. We will accept submissions until Monday, December 23rd, 2024. Trends and key insights will be shared on blog.rust-lang.org as soon as possible. We invite you to take this year’s survey whether you have just begun using Rust, you consider yourself an intermediate to advanced user, or you have not yet used Rust but intend to one day. Your responses will help us improve Rust over time by shedding light on gaps to fill in the community and development priorities, and more. **Once again, we are offering the State of Rust Survey in the following languages (if you speak multiple languages, please pick one). Language options are available on themain survey page:** * English * Simplified Chinese * French * German * Japanese * Russian * Spanish > Note: the non-English translations of the survey are provided in a best-effort manner. If you find any issues with the translations, we would be glad if you could send us a pull request to improve the quality of the translations! Please help us spread the word by sharing the survey link via your social media networks, at meetups, with colleagues, and in any other community that makes sense to you. This survey would not be possible without the time, resources, and attention of members of the Survey Working Group, the Rust Foundation, and other collaborators. We would also like to thank the following contributors who helped with translating the survey (in no particular order): * @albertlarsan68 * @GuillaumeGomez * @Urgau * @Jieyou Xu * @llogiq * @avrong * @YohDeadfall * @tanakakz * @ZuseZ4 * @igaray Thank you! If you have any questions, please see our frequently asked questions. We appreciate your participation! _Clickhere to read a summary of last year's survey findings._
05.12.2024 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Announcing Rust 1.83.0 The Rust team is happy to announce a new version of Rust, 1.83.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via `rustup`, you can get 1.83.0 with: $ rustup update stable If you don't have it already, you can get `rustup` from the appropriate page on our website, and check out the detailed release notes for 1.83.0. If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please report any bugs you might come across! ## What's in 1.83.0 stable ### New const capabilities This release includes several large extensions to what code running in const contexts can do. This refers to all code that the compiler has to evaluate at compile-time: the initial value of `const` and `static` items, array lengths, enum discriminant values, const generic arguments, and functions callable from such contexts (`const fn`). **References to statics.** So far, const contexts except for the initializer expression of a `static` item were forbidden from referencing `static` items. This limitation has now been lifted: static S: i32 = 25; const C: &i32 = &S; Note, however, that reading the value of a mutable or interior mutable static is still not permitted in const contexts. Furthermore, the final value of a constant may not reference any mutable or interior mutable statics: static mut S: i32 = 0; const C1: i32 = unsafe { S }; // error: constant accesses mutable global memory const C2: &i32 = unsafe { &S }; // error: encountered reference to mutable memory in `const` These limitations ensure that constants are still "constant": the value they evaluate to, and their meaning as a pattern (which can involve dereferencing references), will be the same throughout the entire program execution. That said, a constant is permitted to evaluate to a raw pointer that points to a mutable or interior mutable static: static mut S: i32 = 64; const C: *mut i32 = &raw mut S; **Mutable references and pointers.** It is now possible to use mutable references in const contexts: const fn inc(x: &mut i32) { *x += 1; } const C: i32 = { let mut c = 41; inc(&mut c); c }; Mutable raw pointers and interior mutability are also supported: use std::cell::UnsafeCell; const C: i32 = { let c = UnsafeCell::new(41); unsafe { *c.get() += 1 }; c.into_inner() }; However, mutable references and pointers can only be used _inside_ the computation of a constant, they cannot become a part of the final value of the constant: const C: &mut i32 = &mut 4; // error[E0764]: mutable references are not allowed in the final value of constants This release also ships with a whole bag of new functions that are now stable in const contexts (see the end of the "Stabilized APIs" section). These new capabilities and stabilized APIs unblock an entire new category of code to be executed inside const contexts, and we are excited to see how the Rust ecosystem will make use of this! ### Stabilized APIs * `BufRead::skip_until` * `ControlFlow::break_value` * `ControlFlow::continue_value` * `ControlFlow::map_break` * `ControlFlow::map_continue` * `DebugList::finish_non_exhaustive` * `DebugMap::finish_non_exhaustive` * `DebugSet::finish_non_exhaustive` * `DebugTuple::finish_non_exhaustive` * `ErrorKind::ArgumentListTooLong` * `ErrorKind::Deadlock` * `ErrorKind::DirectoryNotEmpty` * `ErrorKind::ExecutableFileBusy` * `ErrorKind::FileTooLarge` * `ErrorKind::HostUnreachable` * `ErrorKind::IsADirectory` * `ErrorKind::NetworkDown` * `ErrorKind::NetworkUnreachable` * `ErrorKind::NotADirectory` * `ErrorKind::NotSeekable` * `ErrorKind::ReadOnlyFilesystem` * `ErrorKind::ResourceBusy` * `ErrorKind::StaleNetworkFileHandle` * `ErrorKind::StorageFull` * `ErrorKind::TooManyLinks` * `Option::get_or_insert_default` * `Waker::data` * `Waker::new` * `Waker::vtable` * `char::MIN` * `hash_map::Entry::insert_entry` * `hash_map::VacantEntry::insert_entry` These APIs are now stable in const contexts: * `Cell::into_inner` * `Duration::as_secs_f32` * `Duration::as_secs_f64` * `Duration::div_duration_f32` * `Duration::div_duration_f64` * `MaybeUninit::as_mut_ptr` * `NonNull::as_mut` * `NonNull::copy_from` * `NonNull::copy_from_nonoverlapping` * `NonNull::copy_to` * `NonNull::copy_to_nonoverlapping` * `NonNull::slice_from_raw_parts` * `NonNull::write` * `NonNull::write_bytes` * `NonNull::write_unaligned` * `OnceCell::into_inner` * `Option::as_mut` * `Option::expect` * `Option::replace` * `Option::take` * `Option::unwrap` * `Option::unwrap_unchecked` * `Option::<&_>::copied` * `Option::<&mut _>::copied` * `Option::<Option<_>>::flatten` * `Option::<Result<_, _>>::transpose` * `RefCell::into_inner` * `Result::as_mut` * `Result::<&_, _>::copied` * `Result::<&mut _, _>::copied` * `Result::<Option<_>, _>::transpose` * `UnsafeCell::get_mut` * `UnsafeCell::into_inner` * `array::from_mut` * `char::encode_utf8` * `{float}::classify` * `{float}::is_finite` * `{float}::is_infinite` * `{float}::is_nan` * `{float}::is_normal` * `{float}::is_sign_negative` * `{float}::is_sign_positive` * `{float}::is_subnormal` * `{float}::from_bits` * `{float}::from_be_bytes` * `{float}::from_le_bytes` * `{float}::from_ne_bytes` * `{float}::to_bits` * `{float}::to_be_bytes` * `{float}::to_le_bytes` * `{float}::to_ne_bytes` * `mem::replace` * `ptr::replace` * `ptr::slice_from_raw_parts_mut` * `ptr::write` * `ptr::write_unaligned` * `<*const _>::copy_to` * `<*const _>::copy_to_nonoverlapping` * `<*mut _>::copy_from` * `<*mut _>::copy_from_nonoverlapping` * `<*mut _>::copy_to` * `<*mut _>::copy_to_nonoverlapping` * `<*mut _>::write` * `<*mut _>::write_bytes` * `<*mut _>::write_unaligned` * `slice::from_mut` * `slice::from_raw_parts_mut` * `<[_]>::first_mut` * `<[_]>::last_mut` * `<[_]>::first_chunk_mut` * `<[_]>::last_chunk_mut` * `<[_]>::split_at_mut` * `<[_]>::split_at_mut_checked` * `<[_]>::split_at_mut_unchecked` * `<[_]>::split_first_mut` * `<[_]>::split_last_mut` * `<[_]>::split_first_chunk_mut` * `<[_]>::split_last_chunk_mut` * `str::as_bytes_mut` * `str::as_mut_ptr` * `str::from_utf8_unchecked_mut` ### Other changes Check out everything that changed in Rust, Cargo, and Clippy. ## Contributors to 1.83.0 Many people came together to create Rust 1.83.0. We couldn't have done it without all of you. Thanks!
28.11.2024 00:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0