Hello and welcome to another issue of This Week in Rust! Rust is a programming language empowering everyone to build reliable and efficient software. This is a weekly summary of its progress and community. Want something mentioned? Tag us at @ThisWeekInRust on X (formerly Twitter) or @ThisWeekinRust on mastodon.social, or send us a pull request. Want to get involved? We love contributions.
This Week in Rust is openly developed on GitHub and archives can be viewed at this-week-in-rust.org. If you find any errors in this week's issue, please submit a PR.
Want TWIR in your inbox? Subscribe here.
Updates from Rust Community
Official
Project/Tooling Updates
- Ratatui 0.29.0
- Life of a Zed Extension: Rust, WIT, Wasm
- Shuttle’s New Platform — Redefining Backend Development
- Hifitime version 4.0.0: A Leap Forward in Time Management
- Fjall 2.2 - now supports serializable snapshot isolation (multi-writer transactions)
- pg-extras-rs - PostgreSQL database performance insights
Observations/Thoughts
- Rust's design goals should be about code
- UnpinCell
- Blocking code is a leaky abstraction
- Life as a Rust Project Contributor
- Rustls Outperforms OpenSSL and BoringSSL
- Using libgdx texture atlases in Bevy
- [audio] Rust in Production - Zed with Conrad Irwin
- [audio] Async Allocators
- [audio] PubNub with Stephen Blum
Rust Walkthroughs
- Demystifying Alignment and Memory Layout in Rust
- Using Rust in Non-Rust Servers to Improve Performance
- Async Rust in Three Parts
- When should I use String vs &str?
- Using Web Workers in Rust Webapps
Miscellaneous
Crate of the Week
This week's crate is trait-gen, an attribute macro to generate the trait implementations for several types without needing custom declarative macros, code repetition, or blanket implementations.
Thanks to Luke Peterson for the suggestion!
Please submit your suggestions and votes for next week!
Calls for Testing
An important step for RFC implementation is for people to experiment with the implementation and give feedback, especially before stabilization. The following RFCs would benefit from user testing before moving forward:
RFCs
- No calls for testing were issued this week.
Rust
- No calls for testing were issued this week.
Rustup
- No calls for testing were issued this week.
Crates Ecosystem
If you are a feature implementer and would like your RFC to appear on the above list, add the new call-for-testing
label to your RFC along with a comment providing testing instructions and/or guidance on which aspect(s) of the feature
need testing.
Call for Participation; projects and speakers
CFP - Projects
Always wanted to contribute to open-source projects but did not know where to start? Every week we highlight some tasks from the Rust community for you to pick and get started!
Some of these tasks may also have mentors available, visit the task page for more information.
- Rama — add "Deny All" Dns Resolver
- Rama — expand support to hijack based on context data
- Rama — support vec/array impl for DnsResolver
- Rama — Support IP modes in connector and resolver
If you are a Rust project owner and are looking for contributors, please submit tasks here or through a PR to TWiR or by reaching out on X (formerly Twitter) or Mastodon!
CFP - Events
Are you a new or experienced speaker looking for a place to share something cool? This section highlights events that are being planned and are accepting submissions to join their event as a speaker.
No Calls for papers or presentations were submitted this week.
If you are an event organizer hoping to expand the reach of your event, please submit a link to the website through a PR to TWiR or by reaching out on X (formerly Twitter) or Mastodon!
Updates from the Rust Project
464 pull requests were merged in the last week
- make
rustc_abi
compile on stable again optimize
attribute applied to things other than methods/functions/c…rust_for_linux: -Zregparm=<N>
commandline flag for X86rustc_llvm
: Fix flattened CLI args- add
&pin (mut|const) T
type position sugar - add getentropy for RTEMS
- added more scenarios where comma to be removed in the function arg
- allow
#[deny]
inside#[forbid]
as a no-op - allow dropping dyn principal
- always specify
llvm_abiname
for RISC-V targets - autodiff Upstreaming - enzyme frontend
- change orphan hint from "only" to "any uncovered type inside..."
- check for filecheck directives in files marked
skip-filecheck
- compiler: adopt rust-analyzer impls for
LayoutCalculatorError
- compiler: error on layout of enums with invalid reprs
- compiler: use LLVM's Comdat support
- continue to get rid of
ty::Const::{try_}eval*
- coverage: make counter creation handle node/edge counters more uniformly
- default to the medium code model on OpenHarmony LoongArch target
- delay ambiguous intra-doc link resolution after
Cache
has been populated - do not run test where it cannot run
- don't check unsize goal in MIR validation when opaques remain
- don't report
on_unimplemented
message for negative traits - don't report bivariance error when nesting a
struct
with field errors into anotherstruct
- dont ICE when computing coverage of synthetic async closure body
- dont consider predicates that may hold as impossible in
is_impossible_associated_item
- enable XRay instrumentation for LoongArch Linux targets
- fix coherence error for very large tuples™
- fix range misleading field access
- handle gracefully true/false in
cfg(target(..))
compact - implement edition 2024 match ergonomics restrictions
- make
unsupported_calling_conventions
a hard error - make destructors on
extern "C"
frames to be executed - make some float methods unstable
const fn
- make sure that outer opaques capture inner opaques's lifetimes even with precise capturing syntax
- never emit
vptr
for empty/auto traits - register
src/tools/unicode-table-generator
as a runnable tool - remove invalid help diagnostics for const pointer
- return values larger than 2 registers using a return area pointer
- setting up indirect access to external data for loongarch64-linux-{musl,ohos}
- try to improve error messages involving aliases in the solver
- warn less about non-exhaustive in ffi
- miri:
epoll_ctl
: throw unsupported error on unsupported opcode - miri: android: added support for prctl handling thread names
- miri: improve support for
f16
andf128
- add fast-path when computing the default visibility
- use
ThinVec
for PredicateObligation storage - finish stabilization of
result_ffi_guarantees
- stabilize Strict Provenance and Exposed Provenance APIs
- stabilize
-Znext-solver=coherence
again - add
from_ref
andfrom_mut
constructors tocore::ptr::NonNull
- add
must_use
toCommandExt::exec
- avoid use imports in
thread_local_inner!
- mark the unstable
LazyCell::into_inner
const - optimize
Box::default
andArc::default
to construct more types in place - optimize str.replace
- partially stabilize
const_pin
- refactor some
core::fmt
macros - avoid superfluous UB checks in
IndexRange
- relax a memory order in
once_box
- speedup directory traversal on windows
- std: uefi: add basic Env variables
- uefi: implement getcwd and chdir
- cargo: registry: HttpRegistry
block_until_ready
returns early when work is still pending - cargo: resolver: avoid cloning when iterating using RcVecIter
- cargo: stabilize MSRV-aware resolver config
- rustdoc-json-types: introduce rustc-hash feature
- rustdoc-json-types: mark simple enums as copy
- rustdoc: switch from FxHash to sha256 for static file hashing
- rustfmt
for<'a> async
correctly - rustfmt:
compile_rustfmt
rewrite - rustfmt: apply 2024 version sort algorithm to mods
- rustfmt: defer changes for zero argument functions until
style_edition=2027
- clippy: add lint for unnecessary lifetime bounded
&str
return - clippy: allow to go through clippy lints page without javascript
- clippy: change the category of
manual_is_power_of_two
topedantic
- clippy: stop linting
manual_bits
in any macro invocation - rust-analyzer: add wrap/unwrap return type in Option
- rust-analyzer: clamp
Position::character
to line length - rust-analyzer: do not consider match/let/ref of place that evaluates to ! to diverge, disallow coercions from them too
- rust-analyzer: better completions for extern blocks
- rust-analyzer: goto definition on range operators
- rust-analyzer: initial support for
safe_kw
in extern blocks - rust-analyzer: support initializeStopped setting
- rust-analyzer: fix status bar message not being marked markdown
- rust-analyzer: classify
safe
as a contextual keyword - rust-analyzer: fix token downmapping failing for include! inputs
- rust-analyzer: private items are shown in completions for modules in fn body
Rust Compiler Performance Triage
Some tidy improvements from switching to next generation trait solver (solely for coherence checking) and from simplifying our dataflow analysis framework. There were some binary size regressions associated with PR 126557 (adding #[track_caller]
to allocating methods of Vec
and VecDeque
), which I have handed off to T-libs to choose whether to investigate further.
Triage done by @pnkfelix. Revision range: 5ceb623a..3e33bda0
0 Regressions, 3 Improvements, 6 Mixed; 3 of them in rollups 47 artifact comparisons made in total
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week:
Final Comment Period
Every week, the team announces the 'final comment period' for RFCs and key PRs which are reaching a decision. Express your opinions now.
RFCs
- [disposition: merge] RFC: Give users control over feature unification
- [disposition: merge] [RFC] Default field values
- [disposition: merge] Trait method impl restrictions
Tracking Issues & PRs
Rust
- [disposition: merge] Add lint against function pointer comparisons
- [disposition: merge] Implement
From<&mut {slice}>
1 forBox/Rc/Arc<{slice}>
- [disposition: merge] Tracking Issue for
const_arguments_as_str
- [disposition: not specified] Add LowerExp and UpperExp implementations to NonZero
- [disposition: merge] Stabilize
Ipv6Addr::is_unique_local
andIpv6Addr::is_unicast_link_local
- [disposition: merge] Make
std::os::darwin
public - [disposition: merge] Tracking Issue for
const_char_encode_utf16
- [disposition: merge] float types: move copysign, abs, signum to libcore
- [disposition: merge] Tracking Issue for
{u8,i8,...}::isqrt
- [disposition: merge] Add
--print host-triple
to print host target triple - [disposition: merge] Lint against
&T
to&mut T
and&T
to&UnsafeCell<T>
transmutes - [disposition: merge] Lint against getting pointers from immediately dropped temporaries
- [disposition: close] Consider deprecation of UB-happy
static mut
Cargo
Language Team
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Reference
- [disposition: unspecified] distinct 'static' items never overlap
Unsafe Code Guidelines
- No Unsafe Code Guideline Tracking Issues or PRs entered Final Comment Period this week.
New and Updated RFCs
- [new] Unsafe derives and attributes
- [new] Macro fragment fields
- [new] Relaxed DST field ordering
Upcoming Events
Rusty Events between 2024-10-23 - 2024-11-20 🦀
Virtual
- 2024-10-24 | Virtual | Women in Rust
- 2024-10-24 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-25 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-10-26 | Virtual (Gdansk, PL) | Stacja IT Trójmiasto
- 2024-10-29 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-10-31 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-31 | Virtual (Nürnberg, DE) | Rust Nurnberg DE
- 2024-11-01 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-02 | Virtual( Kampala, UG) | Rust Circle Kampala
- 2024-11-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-11-07 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-11-08 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-11-14 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-14 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-11-15 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-19 | Virtual (Los Angeles, CA, US) | DevTalk LA
- 2024-11-19 | Virtual (Washington, DC, US) | Rust DC
- 2024-11-20 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
Asia
- 2024-10-29 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-10-26 | Stockholm, SE | Stockholm Rust
- 2024-10-28 | Paris, FR | Rust Paris
- 2024-10-29 | Aarhus, DK | Rust Aarhus
- 2024-10-30 | Hamburg, DE | Rust Meetup Hamburg
- 2024-10-31 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-11-06 | Oxford, UK | Oxford Rust Meetup Group
- 2024-11-06 | Paris, FR | Paris Rustaceans
- 2024-11-14 | Stockholm, SE | Stockholm Rust
- 2024-11-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
North America
- 2024-10-23 | Austin, TX, US | Rust ATX
- 2024-10-26 | Newark, NJ, US | NJ Code & Coffee
- 2024-10-27 | Cambridge, MA, US | Boston Rust Meetup
- 2024-10-28 | Boulder, CO, US | Boulder Rust Meetup
- 2024-10-28 | Ferndale, MI, US | Detroit Rust
- 2024-10-28 | Minneapolis, MN US | Minneapolis Rust Meetup
- 2024-10-29 | Nashville, TN, US | Music City Rust Developers
- 2024-10-30 | Chicago, IL, US | Deep Dish Rust
- 2024-11-04 | Brookline, MA, US | Boston Rust Meetup
- 2024-11-07 | St. Louis, MO, US | STL Rust
- 2024-11-12 | Ann Arbor, MI, US | Detroit Rust
- 2024-11-15 | Mexico City, DF, MX | Rust MX
- 2024-11-15 | Somerville, MA, US | Boston Rust Meetup
Oceania
- 2024-10-28 | Melbourne, VIC, AU | Rust Melbourne
- 2024-10-29 | Canberra, ACT, AU | Canberra Rust User Group (CRUG)
- 2024-10-31 | Auckland, NZ | Rust AKL
If you are running a Rust event please add it to the calendar to get it mentioned here. Please remember to add a link to the event too. Email the Rust Community Team for access.
Jobs
Please see the latest Who's Hiring thread on r/rust
Quote of the Week
Your problem is that you’re trying to borrow from the dead.
Thanks to Maciej Dziardziel for the suggestion!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, andrewpollack, U007D, kolharsam, joelmarcey, mariannegoldin, bennyvasquez.
Email list hosting is sponsored by The Rust Foundation