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
Foundation
Newsletters
Project/Tooling Updates
- Announcing zerocopy 0.8!
- Introduction to durable execution
- Pursuit of Performance on Building a JavaScript Compiler
- gitoxide September 2024
- Tauri 2.0 Stable Release
- A new version of modversions
- Smart pointers for the kernel
- Efficient Rust tracepoints
- Improving bindgen for the kernel
- termscp 0.15.0
Observations/Thoughts
- regalloc III
- On Ousterhout's Dichotomy
- Rust is rolling off the Volvo assembly line
- Three Kinds Of Unwrap
- 5 Awesome (and less known) Rust projects
- Nine Rules for Running Rust in the Browser: Practical lessons from porting range-set-blaze to WASM
- [video] A Legendary Web Framework is Reborn... In Rust
- [audio] Fixing build times with rubicon
Rust Walkthroughs
- Building Async I/O in Rust: How Futures, Wakers, and Thread Pools Work Together
- Index Trait, Pinned Elements and Immutable Push Vector
- [series] Serde for Trait Object 2: Serialization
- [video] Build with Naz : Create an async shell in Rust
Miscellaneous
Crate of the Week
This week's crate is float8, an 8-bit float implementation.
llogiq is still pleased with his choice, but increasingly unhappy about the lack of suggestions.
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.
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.
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.
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
437 pull requests were merged in the last week
- add
x86_64-unknown-trusty
as tier 3 target - initial support for
riscv32{e|em|emc}_unknown_none_elf
- increase Stack Size for AIX
- allow boolean literals as cfg predicates (RFC #3695)
- account for
impl Trait {
whenimpl Trait for Type {
was intended - add
naked_asm!
macro for use in#[naked]
functions - add a lint for pointer to integer transmutes in consts
- add caching to most type folders, rm region uniquification
- add missing module flags for
-Zfunction-return=thunk-extern
- add support for reborrowing pinned method receivers
- add unstable support for outputting file checksums for use in cargo
- avoid ICE in coverage builds with bad
#[coverage(..)]
attributes - check elaborated projections from dyn don't mention unconstrained late bound lifetimes
- compute array length from type for unconditional panic lint
- couple of changes to make it easier to compile rustc for wasm
- coverage: multiple small tweaks to counter creation
- disable jump threading
UnOp::Not
for non-bool - do not consider match/let/ref of place that evaluates to
!
to diverge, disallow coercions from them too - don't allow the
#[pointee]
attribute where it doesn't belong - don't give method suggestions when method probe fails due to bad implementation of
Deref
- improve const traits diagnostics for new desugaring
- instantiate binders in
supertrait_vtable_slot
- make
deprecated_cfg_attr_crate_type_name
a hard error - make
test_lots_of_insertions
test take less long in Miri - make opaque types regular HIR nodes
- only query
params_in_repr
if def kind is adt - panic when an interpreter error gets unintentionally discarded
- parser: better error messages for
@
instruct
patterns - replace -Z default-hidden-visibility with -Z default-visibility
- restrict
ignore-mode-*
directives - support
clobber_abi
and vector/access registers (clobber-only) in s390x inline assembly - interpret: always enable
write_immediate
sanity checks - miri: add vector clock to epoll ready lists
- miri: added rust-analyzer instructions for Helix
- miri: avoid
pthread_attr_t
in tests - miri: implement LLVM x86 gfni intrinsics
- miri: prefer refutable slice patterns over len check + index op
- miri: pthread mutex: better error in reentrant-locking-UB
rustc_infer
cleanups- stabilize 5
const_mut_refs
-dependent API - stabilize
BufRead::skip_until
- stabilize
const_float_classify
- stabilize
const_slice_from_raw_parts_mut
- stabilize
const_slice_split_at_mut
andconst_slice_first_last_chunk
- stabilize
expr_2021
fragment specifier in all editions - stabilize the
map
/value
methods onControlFlow
- liballoc: introduce String, Vec const-slicing
- make Cell unstably const
- enable f16 and f128 on windows-gnullvm targets
- transmuteFrom: gracefully handle unnormalized types and normalization errors
- small optimization for integers Display implementation
- add
[Option<T>; N]::transpose
- add precondition checks to
ptr::offset, ptr::add, ptr::sub
- avoid emptiness check in
PeekMut::pop
- don't use
Immediate::offset
to transmute pointers to integers - add multi-producer, multi-consumer channel (mpmc)
- impl
Default
forHashMap
/HashSet
iterators that don't already have it - std: make
thread::current
available in allthread_local!
destructors - std: replace
LazyBox
withOnceBox
- futures: fix use after free of task in FuturesUnordered when dropped future panics
- hashbrown: add
Tag(u8)
newtype in an attempt to stop using byte-pointers for everything - hashbrown: change the default hasher to foldhash
- cargo: fix
cargo:version_number
- has only one:
- cargo: fix: remove implicit feature removal
- cargo: improve error reporting when feature not found in
activated_features
- rustdoc: cleaner errors on disambiguator/namespace mismatches
- rustdoc: improve
<wbr>
-insertion forSCREAMING_CAMEL_CASE
- rustdoc: lists items that contain multiple paragraphs are more clear
- rustdoc: prevent ctors from resolving
- clippy:
infinite_loop
: continuing an outer loop leaves the inner loop - clippy:
rustc_tools_util
: rerun when git commit changes - clippy:
zombie_processes
: considerwait()
calls in nested bodies - clippy: compare trait references in
trait_duplication_in_bounds
correctly - clippy: fix
mut_mutex_lock
when reference not ultimately mutable - clippy: implement lint for
regex::Regex
compilation inside a loop - clippy: reduce default 'large array' threshold
- clippy: show interior mutability chain in
mutable_key_type
- clippy: simplify negative
Option::{is_some_and,is_none_or}
- clippy: style: do not defensively use
saturating_sub()
- rust-analyzer: fix: fix bootstrap error message being incorrect
- rust-analyzer: use external stack in borrowck DFS
Rust Compiler Performance Triage
One regression dominated this week (dealing with a correctness fix around type system caching that was deemed necessary), but it luckily did not produce large regressions in any benchmarks. Overall, performance still ended up relatively in the same place as the beginning of the week.
Triage done by @rylev. Revision range: c87004a1..e6c46db4
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.3% | [0.1%, 1.0%] | 63 |
Regressions ❌ (secondary) |
1.1% | [0.1%, 3.4%] | 81 |
Improvements ✅ (primary) |
-0.5% | [-3.0%, -0.1%] | 19 |
Improvements ✅ (secondary) |
-0.5% | [-1.5%, -0.1%] | 46 |
All ❌✅ (primary) | 0.1% | [-3.0%, 1.0%] | 82 |
2 Regressions, 3 Improvements, 7 Mixed; 3 of them in rollups 57 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
Rust
- [disposition: merge] Stabilize const
ptr::write*
andmem::replace
- [disposition: merge] Check ABI target compatibility for function pointers
- [disposition: merge] Proposal: stabilize
if_let_rescope
for Edition 2024 - [disposition: merge] Fixup Windows verbatim paths when used with the
include!
macro - [disposition: merge] Implemented
FromStr
forCString
andTryFrom<CString>
forString
- [disposition: merge] Tracking Issue for
debug_more_non_exhaustive
- [disposition: merge] Tracking Issue for
const_make_ascii
- [disposition: merge] Tracking Issue for
const_char_encode_utf8
Cargo
- [disposition: merge] feat: Stabilize MSRV-aware resolver config
- [disposition: merge] Official API for build scripts
Language Team
- [disposition: merge] Meeting proposal: rename "object safety" to "dyn compatibility"
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline Tracking Issues or PRs entered Final Comment Period this week.
New and Updated RFCs
- [new] RFC: Promote riscv64gc-unknown-linux-gnu to Tier-1 (without host tools)
- [new] [RFC] Add Option::todo and Result::todo
Upcoming Events
Rusty Events between 2024-10-09 - 2024-11-06 🦀
Virtual
- 2024-10-10 | Virtual | Women in Rust
- 2024-10-10 | Virtual (Barcelona, ES) | BcnRust + Codurance + Heavy Duty Builders
- 2024-10-10 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-10 | Virtual (Girona, ES) | Rust Girona
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-14 | Virtual | Women in Rust
- 2024-10-14 | Virtual | Rust for Lunch
- 2024-10-15 | Virtual (Washington, DC, US) | Rust DC
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17 | Virtual | Women in Rust
- 2024-10-17| Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-22 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-10-24 | Virtual | Women in Rust
- 2024-10-24 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-26 | Virtual (Gdansk, PL) | Stacja IT Trójmiasto
- 2024-10-29 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-10-31 | Virtual (Nürnberg, DE) | Rust Nurnberg DE
Africa
- 2024-11-02 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-10-09 | Subang Jaya / Kuala Lumpur, Selangor, MY | Rust Malaysia
- 2024-10-17 - 2024-10-18 | Beijing, CN | Global Open-Source Innovation Meetup (GOSIM)
- 2024-10-19 | Bangalore/Bengaluru, IN | Rust Bangalore
Europe
- 2024-10-09 | Reading, UK | Reading Rust Workshop
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-15 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-10-17 | Darmstadr, DE | Rust Rhein-Main
- 2024-10-15 | Cambridge, UK | Cambridge Rust Meetup
- 2024-10-15 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-10-15 | Munich, DE | Rust Munich
- 2024-10-16 | Manchester, UK | Rust Manchester
- 2024-10-17 | Barcelona, ES | BcnRust
- 2024-10-17 | Bern, CH | Rust Bern
- 2024-10-22 | Warsaw, PL | Rust Warsaw
- 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 | Paris, FR | Paris Rustaceans
North America
- 2024-10-15 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-10-19 | Cambridge, MA, US | Boston Rust Meetup
- 2024-10-23 | Austin, TX, US | Rust ATX
- 2024-10-27 | Cambridge, MA, US | Boston Rust Meetup
- 2024-11-04 | Brookline, MA, US | Boston Rust Meetup
Oceania
- 2024-10-29 | Canberra, ACT, AU | Canberra Rust User Group (CRUG)
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
I'm the wrong side of 45. I have zero interest in wasting any time that I might have left writing C from scratch. Writing Rust is pure joy. I can go from an idea to a working, tested, robust, published and packaged implementation in the time it would take me to even begin the first few lines of a C version. The tooling is beautiful, makes programming fun, and the end result usually outperforms the equivalent C. Once it builds I know it will run perfectly on all of the platforms I care about, and I don't have to go around manually testing on them to find all of the various platform and compiler quirks that will break it.
– Jonathan Perkins on the NetBSD mailing list
Thanks to blonk 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