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 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.
Updates from Rust Community
Rust Nation UK
- Tim McNamara - 4 levels of error handling
- Mithun Hunsur - Ambient: A Rust and WebAssembly Runtime for Cross-Platform Multiplayer Games
- Alice Ryhl - What it takes to keep Tokio running
- Chris Biscardi - Bevy: A case study in ergonomic Rust
- Pietro Albini - How Ferrocene qualified the Rust Compiler
- Ben Wishovich - Full Stack Rust - Building Rust Websites with Leptos
- Natalie Serebryakova - Rustic Persistence: Automating PVC Lifecycles with Rust in Kubernetes
- Daniel McKenna - Creating a Text-To-Speech System in Rust
- Konstantin Grechishchev - Java and Rust Integration
- Heiko Seeberger - EventSourced – async_fn_in_trait in anger
- Tim Janus - Let's get interdisciplinary: Rust Design Patterns for Chemical Plants
- Marco Ieni - How Rust makes open-source easier
Newsletters
Project/Tooling Updates
- futures-concurrency v7.6.0: Portable Concurrent Async Iteration
- Ratatui v0.26.2
- Rust on Espressif chips
- Introducing Dust DDS – A native Rust implementation of the Data Distribution Service (DDS) middleware
- Announcing the first audited Rust implementation of CGGMP21, the state-of-the-art ECDSA threshold protocol
- Nutype 0.4.2 - newtype with guarantees
- venndb 0.2.1 - any filters
- [ZH|EN] Announcing async-openai-wasm, and thoughts on wasmization and streams
Observations/Thoughts
- Climbing a (binary) Tree - Noise On The Net
- Why is there no realloc that takes the number of bytes to copy?
- Some useful types for database-using Rust web apps
- My logging recipe for server side Rust
Rust Walkthroughs
- Getting started with SurrealDB using Docker and a Rust client
- [video] developerlife.com - Rust testing deep dive with r3bl_terminal_async crate
Research
Miscellaneous
- Iced Tutorial 0.12
- [video] Infinite Pong in the Bevy Game Engine - Let's Code!
- [audio] Release-plz with Marco Ieni
Crate of the Week
This week's crate is venndb, an append-only memory DB whose tables can be build via a derive macro.
Thanks to Glen De Cauwsemaecker for the self-suggestion!
Please submit your suggestions and votes for next week!
Call 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:
- 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.
CFP - Speakers
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.
- RustConf 2024 | Closes 2024-04-25 | Montreal, Canada | Event date: 2024-09-10
- RustLab 2024 | Closes 2024-05-01 | Florence, Italy | Event date: 2024-11-09 - 2024-11-11
- EuroRust 2024| Closes 2024-06-03 | Vienna, Austria & online | Event date: 2024-10-10
- Scientific Computing in Rust 2024| Closes 2024-06-14 | online | Event date: 2024-07-17 - 2024-07-19
- Conf42 Rustlang 2024 | Closes 2024-07-22 | online | Event date: 2024-08-22
If you are an event organizer hoping to expand the reach of your event, please submit a link to the submission website through a PR to TWiR.
Updates from the Rust Project
430 pull requests were merged in the last week
- add support for Arm64EC inline assembly (as unstable)
statx
probe:ENOSYS
might come from a faulty FUSE driver- account for trait/impl difference when suggesting changing argument from ref to mut ref
- add
REDUNDANT_LIFETIMES
lint to detect lifetimes which are semantically redundant - add
unsafe
to two functions with safety invariants - add const generics support for pattern types
- add support to intrinsics fallback body
- async closure coroutine by move body MirPass refactoring
- avoid a panic in
set_output_capture
in the default panic handler - be more specific when flagging imports as redundant due to the extern prelude
- call
lower_const_param
instead of duplicating the code - call the panic hook for non-unwind panics in proc-macros
- detect borrow checker errors where
.clone()
would be an appropriate user action - disable Ctrl-C handling on WASM
- discard overflow obligations in
impl_may_apply
- do not add prolog for variadic naked functions
- do not allocate for ZST ThinBox (attempt 2 using
const_allocate
) - don't delay a bug if we suggest adding a semicolon to the RHS of an assign operator
- don't do coroutine-closure-specific upvar analysis if tainted by errors
- don't even parse an intrinsic unless the feature gate is enabled
- don't leak unnameable types in
-> _
recover - don't rely on upvars being assigned just because coroutine-closure kind is assigned
- fix UB in LLVM FFI when passing zero or >1 bundle
- fix invalid silencing of parsing error
- fix various bugs in
ty_kind_suggestion
- generic associated consts: Check regions earlier when comparing impl with trait item def
- improve diagnostic by suggesting to remove visibility qualifier
- just use
type_dependent_def_id
to figure out what the method is for an expr - linker flavors next steps: linker features
- linker: avoid some allocations in search directory iteration
- linker: remove laziness and caching from native search directory walks
- make
PlaceRef
andOperandValue::Ref
share a commonPlaceValue
type - make the computation of
coroutine_captures_by_ref_ty
more sophisticated - only assert for child/parent projection compatibility AFTER checking that theyre coming from the same place
- only collect mono items from reachable blocks
- openBSD fix long socket addresses
- panic on overflow in
BorrowedCursor::advance
- propagate temporary lifetime extension into if and match
- provide suggestion to dereference closure tail if appropriate
- refactor
panic_unwind/seh.rs
pointer use - remove
From
impls for unstable types that break inference - rework ptr-to-ref conversion suggestion for method calls
- set target-abi module flag for RISC-V targets
- skip
unused_parens
report forParen(Path(..))
in macro - stop making any assumption about the projections applied to the upvars in the
ByMoveBody
pass - stop using
HirId
for fn-like parents since closures are notOwnerNode
s - stop using
PolyTraitRef
for closure/coroutine predicates already instantiated w placeholders - store all args in the unsupported Command implementation
- suppress
let else
suggestion for uninitialized refutablelet
s - tweak value suggestions in
borrowck
andhir_analysis
- typeck: fix
?
suggestion span - use
fn
ptr signature instead of{closure@..}
in infer error - use
suggest_impl_trait
in return type suggestion on type error - miri:
MIRI_REPLACE_LIBRS_IF_NOT_TEST
: also apply to crates.io crates - miri: add some basic support for GetFullPathNameW
- miri: fix error display for './miri run --dep'
- miri: handle Miri sysroot entirely outside the Miri driver
- miri: make
split_simd_to_128bit_chunks
take only one operand - miri on Windows: run .CRT$XLB linker section on thread-end
- miri: windows: add basic support for FormatMessageW
- stabilize --json
unused-externs(-silent)
- stabilize
(const_)slice_ptr_len
and(const_)slice_ptr_is_empty_nonnull
- stabilize
cstr_count_bytes
- implement
FromIterator
for(impl Default + Extend, impl Default + Extend)
- re-enable
has_thread_local
for i686-msvc std::net
: TcpListener shrinks the backlog argument to 32 for Haiku- show
mode_t
as octal instd::fs
Debug impls - add
A: 'static
bound forArc/Rc::pin_in
f16
andf128
step 4: basic library support- add a
Debug
impl and some basic functions tof16
andf128
- specialize many implementations of
Read::read_buf_exact
- windows: set main thread name without re-encoding
- cargo: make sure to also wrap the initial
-vV
invocation - cargo resolve: Respect '--ignore-rust-version'
- cargo resolve: Fallback to 'rustc -V' for MSRV resolving
- cargo fix: dont apply same suggestion twice
- cargo package: Normalize paths in
Cargo.toml
- cargo test: don't compress test registry crates
- rustdoc: correctly handle inlining of doc hidden foreign items
- rustdoc: check redundant explicit links with correct itemid
- rustdoc: point at span in
include_str!
-ed md file - rustdoc: reduce per-page HTML overhead
- clippy:
module_name_repetition
Recognize common prepositions - clippy: fix: incorrect suggestions when
.then
and.then_some
is used - clippy: pin
remark-lint-maximum-line-length
version - clippy: turn
duplicated_attributes
into a late lint - clippy: use
check_attributes
in doc lints - rust-analyzer: add static and const highlighting token types
- rust-analyzer: better inline preview for postfix completion
- rust-analyzer: wrap/Unwrap
cfg_attr
- rust-analyzer: VFS should not confuse paths with source roots that have the same prefix
- rust-analyzer: fix
impl Trait<Self>
causing stack overflows - rust-analyzer: fix inlay hint resolution being broken
- rust-analyzer: fix: support auto-closing for triple backticks
- rust-analyzer: run cargo test per workspace in the test explorer
Rust Compiler Performance Triage
A quiet week, with slightly more improvements than regressions. There were a few noise spikes, but other than that nothing too interesting.
Triage done by @Kobzol. Revision range: 86b603cd..ccfcd950b
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.5% | [0.3%, 1.4%] | 9 |
Regressions ❌ (secondary) |
0.4% | [0.2%, 1.1%] | 20 |
Improvements ✅ (primary) |
-0.6% | [-2.5%, -0.2%] | 41 |
Improvements ✅ (secondary) |
-0.8% | [-1.4%, -0.2%] | 4 |
All ❌✅ (primary) | -0.4% | [-2.5%, 1.4%] | 50 |
1 Regressions, 3 Improvements, 6 Mixed; 5 of them in rollups 62 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:
- No RFCs were approved 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] Move the Crates.io Team under the Dev Tools team
- [disposition: merge] Arbitrary self types v2
- [disposition: merge] RFC: Syntax for embedding cargo-script manifests
- [disposition: merge] rust-lang org GitHub access policy
Tracking Issues & PRs
Rust
- [disposition: merge] Enforce closure args + return type are WF
- [disposition: merge] Tracking Issue for
io_error_downcast
- [disposition: merge] More DefineOpaqueTypes::Yes
- [disposition: merge] Tracking Issue for
std::path::absolute
- [disposition: merge] Tracking Issue for
utf8_chunks
- [disposition: merge] restrict promotion of
const fn
calls - [disposition: merge] Fix trait solver overflow with
non_local_definitions
lint - [disposition: merge] Use fulfillment in method probe, not evaluation
- [disposition: merge] rustdoc-search: single result for items with multiple paths
- [disposition: merge] Ignore
-C strip
on MSVC
New and Updated RFCs
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2024-04-17 - 2024-05-15 🦀
Virtual
- 2024-04-17 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-04-17 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-04-18 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2024-04-21 | Virtual (Israel) | Rust in Israel
- 2024-04-23 | Trondheim, NO | Rust Trondheim
- 2024-04-24 | Virtual + In Person (Prague, CZ) | Rust Czech Republic
- 2024-04-25 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-01 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-05-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-05-02 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-05-07 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 2024-05-09 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-09 | Virtual (Israel) | Rust in Israel
- 2024-05-09 | Virtual (Nuremberg/Nürnberg, DE) | Rust Nuremberg
- 2024-05-14| Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Africa
- 2024-05-04 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-04-20 | Kuala Lumpur, MY | GoLang Malaysia
- 2024-05-11 | Bangalore, IN | Rust Bangalore
Europe
- 2024-04-17 | Bergen, NO | Hubbel kodeklubb
- 2024-04-17 | Lyon, FR | Rust Lyon
- 2024-04-17 | Ostrava, CZ | TechMeetup Ostrava
- 2024-04-20 | Augsburg, DE | Augsburger Linux-Infotag 2024
- Augsburger Linux-Infotag 2024: Workshop Einstieg in Embedded Rust mit dem Raspberry Pico WH
- 2024-04-23 | Berlin, DE | Rust Berlin
- 2024-04-23 | Paris, FR | Rust Paris
- 2024-04-24 | Virtual + In Person (Prague, CZ) | Rust Czech Republic
- 2024-04-25 | Aarhus, DK | Rust Aarhus
- 2024-04-25 | Berlin, DE | Rust Berlin
- 2024-04-25 | København/Copenhagen, DK | Copenhagen Rust Community
- 2024-04-25 | Vienna, AT | Rust Vienna
- 2024-04-27 | Basel, CH | Rust Basel
- 2024-04-27 | Stockholm, SE | Stockholm Rust
- 2024-04-30 | Budapest, HU | Budapest Rust Meetup Group
- 2024-04-30 | Salzburg, AT | Rust Salzburg
- [Rust Salzburg meetup]: 6:30pm - CCC Salzburg, 1. OG, ArgeKultur, Ulrike-Gschwandtner-Straße 5, 5020 Salzburg
- 2024-05-01 | Utrecht, NL | NL-RSE Community
- 2024-05-06 | Delft, NL | GOSIM
- 2024-05-07 & 2024-05-08 | Delft, NL | RustNL
- 2024-05-09 | Gdańsk, PL | Rust Gdansk
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
North America
- 2024-04-18 | Chicago, IL, US | Deep Dish Rust
- 2024-04-18 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-04-24 | Austin, TX, US | Rust ATX
- 2024-04-25 | Nashville, TN, US | Music City Rust Developers
- 2024-04-26 | Boston, MA, US | Boston Rust Meetup
- 2024-05-04 | Cambridge, MA, US | Boston Rust Meetup
- 2024-05-12 | Brookline, MA, US | Boston Rust Meetup
Oceania
- 2024-04-17 | Sydney, NSW, AU | Rust Sydney
- 2024-04-30 | Auckland, NZ | Rust AKL
- 2024-04-30 | Canberra, ACT, AU | Canberra Rust User Group
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
There is absolutely no way I can imagine that
Option
is causing that error. That'd be like turning on the "Hide Taskbar" setting causing your GPU to catch fire.[...]
If it's not any of those, consider an exorcist because your machine might be haunted.
Thanks to Hayden Brown 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