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
Official
- Announcing Rust 1.77.2
- Security advisory for the standard library (CVE-2024-24576)
- Changes to Rust's WASI targets
Rust Nation UK
- Hannah Aubrey - A Web of Rust: The Future of the Internet Depends on Trust
- JD Nose - Rust Infrastructure: What it takes to keep Rust running
- Amanieu D'Antras - The path to a stable ABI for Rust
- Luca Palmieri - Pavex: re-imaging API development in Rust
- Lachezar Lechev - Typed for Safety
- Marco Concetto Rudilosso - Building a profiler for web assembly
- Jon Gjengset - Towards Impeccable Rust
- Nicholas Yang - Porting Turborepo From Go To Rust
- David Haig - What’s that behind your ear? An open source hearing aid in Rust.
- Frédéric Ameye - Renault want to sell cars with rust!
- Nikita Lapkov - Type-safe and fault-tolerant mesh services with Rust
- Andre Bogus - Easy Mode Rust
- Lars Bergstrom - Beyond Safety and Speed: How Rust Fuels Team Productivity
- Tim McNamara - Unwrapping unsafe
- Nicholas Matsakis - Rust 2024 and beyond
Project/Tooling Updates
- Shipping Jco 1.0, WASI 0.2
- This month in Pavex, #10
- "Containerize" individual functions in Rust with extrasafe
- rust-analyzer changelog #228
- Rerun 0.15.0 - Blueprints from Python · rerun-io/rerun
- Bevy 0.13.2, Curves, Gizmos, and Games
- What's new in SeaORM 1.0-rc.x
Observations/Thoughts
- Improve performance of you Rust functions by const currying
- Ownership in Rust
- Thoughts on the xz backdoor: an lzma-rs perspective
- hyper HTTP/2 Continuation Flood
- Leaky Abstractions and a Rusty Pin
- [audio] Launching RustRover: JetBrains' Investment in Rust
- [audio] Pavex with Luca Palmieri
- [video] Decrusting the tokio crate
- [video] Rust 1.77.0: 70 highlights in 30 minutes
- [video] Simulate the three body problem in #rustlang
- [video] Exploring Fiberplane's 3-Year Rust Journey - with Benno van den Berg
Rust Walkthroughs
- Working with OpenAPI using Rust
- Zed Decoded: Async Rust
- Writing a Unix-like OS in Rust
- Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
- Write Cleaner, More Maintainable Rust Code with PhantomData
- [video] Extreme Clippy for an existing Rust Crate
- [video] developerlife.com - Build a color gradient animation for a spinner component, for CLI, in Rust
- [video] developerlife.com - Build a spinner component, for CLI, in Rust
- [video] developerlife.com - Build an async readline, and spinner in Rust, for interactive CLI
Research
- "Against the Void": An Interview and Survey Study on How Rust Developers Use Unsafe Code
- Sound Borrow-Checking for Rust via Symbolic Semantics
Miscellaneous
- Rust indexed - Rust mdbooks search
- March 2024 Rust Jobs Report
- Rust Meetup and user groups (updated)
- Embedding the Servo Web Engine in Qt
- A memory model for Rust code in the kernel
- Building Stock Market Engine from scratch in Rust (II)
- Ratatui Received Funding: What's Next?
Crate of the Week
This week's crate is archspec-rs, a library to track system architecture aspects.
Thanks to Orhun Parmaksız for the 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
431 pull requests were merged in the last week
- CFI: change type transformation to use TypeFolder
- CFI: fix ICE in KCFI non-associated function pointers
- CFI: restore
typeid_for_instance
default behavior - CFI: support function pointers for trait methods
- CFI: support non-general coroutines
- MSVC targets should use COFF as their archive format
- actually use the inferred
ClosureKind
from signature inference in coroutine-closures - add
Ord::cmp
for primitives as aBinOp
in MIR - add a debug asserts call to
match_projection_projections
to ensure invariant - add aarch64-apple-visionos and aarch64-apple-visionos-sim tier 3 targets
- add consistency with phrases "meantime" and "mean time"
- assert
FnDef
kind - assert that args are actually compatible with their generics, rather than just their count
- avoid ICEing without the
pattern_types
feature gate - avoid expanding to unstable internal method
- avoid panicking unnecessarily on startup
- better reporting on generic argument mismatchs
- cleanup: rename
HAS_PROJECTIONS
toHAS_ALIASES
etc - do not ICE in
fn forced_ambiguity
if we get an error - do not ICE on field access check on expr with
ty::Error
- do not ICE when calling incorrectly defined
transmute
intrinsic - fix
ByMove
coroutine-closure shim (for 2021 precise closure capturing behavior) - fix capture analysis for by-move closure bodies
- fix diagnostic for qualifier in extern block
- hir: use
ItemLocalId::ZERO
in a couple more places - impl
get_mut_or_init
andget_mut_or_try_init
for OnceCell and OnceLock - implement T-types suggested logic for perfect non-local impl detection
- implement minimal, internal-only pattern types in the type system
- instantiate higher ranked goals outside of candidate selection
- link against libc++abi and libunwind as well when building LLVM wrappers on AIX
- make inductive cycles always ambiguous
- make sure to insert
Sized
bound first into clauses list - match ergonomics: implement "
&
pat everywhere" - match lowering: make false edges more precise
- more postfix match fixes
- move check for error in impl header outside of reporting
- only allow
compiler_builtins
to call LLVM intrinsics, not anylink_name
function - only inspect user-written predicates for privacy concerns
- pass list of defineable opaque types into canonical queries
- pattern analysis: fix union handling
- postfix match fixes
- privacy: stabilize lint
unnameable_types
- put checks that detect UB under their own flag below
debug_assertions
- revert removing miri jobserver workaround
- safe Transmute: Compute transmutability from
rustc_target::abi::Layout
- sanitizers: create the
rustc_sanitizers
crate - split hir ty lowerer's error reporting code in check functions to mod errors
- teach MIR inliner query cycle avoidance about
const_eval_select
- transforms match into an assignment statement
- use the more informative generic type inference failure error on method calls on raw pointers
- add missing
?Sized
bounds forHasInterner
impls - introduce
Lifetime::Error
- perf: cache type info for ParamEnv
- encode dep graph edges directly from the previous graph when promoting
- remove debuginfo from rustc-demangle too
- stabilize
const_caller_location
andconst_location_fields
- stabilize
proc_macro_byte_character
andproc_macro_c_str_literals
- stabilize const
Atomic*::into_inner
- de-LLVM the unchecked shifts
- rename
expose_addr
toexpose_provenance
- rename
ptr::from_exposed_addr
→ptr::with_exposed_provenance
- remove
rt::init
allocation for thread name - use
unchecked_sub
in str indexing - don't emit divide-by-zero panic paths in
StepBy::len
- add fn const
BuildHasherDefault::new
- add invariant to
VecDeque::pop_*
that len<
cap if pop successful - add
Context::ext
- provide
cabi_realloc
on wasm32-wasip2 by default - vendor
rustc_codegen_gcc
- cargo: Build script not rerun when target rustflags change
- cargo add: Stabilize MSRV-aware version req selection
- cargo toml: Decouple target discovery from Target creation
- cargo toml: Split out an explicit step to resolve
Cargo.toml
- cargo metadata: Show behavior with TOML-specific types
- cargo: don't depend on
?
affecting type inference in weird ways - cargo: fix github fast path redirect
- cargo: maintain sorting of dependency features
- cargo: switch to using gitoxide by default for listing files
- rustdoc-search: shard the search result descriptions
- rustdoc: default to light theme if JS is enabled but not working
- rustdoc: heavily simplify the synthesis of auto trait impls
- rustdoc: synthetic auto trait impls: accept unresolved region vars for now
- clippy:
manual_swap
auto fix - clippy:
manual_unwrap_or_default
: check forDefault
trait implementation in initial condition when linting and useIfLetOrMatch
- clippy: allow
cast
lints in macros - clippy: avoid an ICE in
ptr_as_ptr
when getting thedef_id
of a local - clippy: correct parentheses for
needless_borrow
suggestion - clippy: do not suggest
assigning_clones
inClone
impl - clippy: fix ice reporting in lintcheck
- clippy: fix incorrect suggestion for
!(a as type >= b)
- clippy: reword
arc_with_non_send_sync
note and help messages - clippy: type certainty: clear
DefId
when an expression's type changes to non-adt - rust-analyzer: apply cargo flags in test explorer
- rust-analyzer: fix off-by-one error converting to LSP UTF8 offsets with multi-byte char
- rust-analyzer: consider
exported_name="main"
functions in test modules as tests - rust-analyzer: fix
patch_cfg_if
not applying with stitched sysroot - rust-analyzer: set the right postfix snippets competion source range
Rust Compiler Performance Triage
A quiet week; all the outright regressions were already triaged (the one biggish one was #122077, which is justified as an important bug fix). There was a very nice set of improvements from PR #122070, which cleverly avoids a lot of unnecessary allocator calls when building an incremental dep graph by reusing the old edges from the previous graph.
Triage done by @pnkfelix. Revision range: 3d5528c2..86b603cd
3 Regressions, 3 Improvements, 7 Mixed; 1 of them in rollups 78 artifact comparisons made in total
See full report here
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: Drop temporaries in tail expressions before local variables
- [disposition: merge] RFC: Reserve unprefixed guarded string literals in Edition 2024
Tracking Issues & PRs
Rust
- [disposition: merge] Always display stability version even if it's the same as the containing item
- [disposition: merge] Tracking Issue for
cstr_count_bytes
- [disposition: merge] rustdoc-search: single result for items with multiple paths
- [disposition: merge] Tracking Issue for
#![feature(const_io_structs)]
- [disposition: merge] Tracking Issue for
alloc::collections::BinaryHeap::as_slice
- [disposition: merge] Tracking Issue for fs_try_exists
- [disposition: merge] stabilize
-Znext-solver=coherence
- [disposition: merge] Document overrides of clone_from() in core/std
- [disposition: merge] Stabilise inline_const
- [disposition: merge] Tracking Issue for RFC 3013: Checking conditional compilation at compile time
- [disposition: merge] sess: stabilize
-Zrelro-level
as-Crelro-level
- [disposition: merge] Implement
FromIterator
for(impl Default + Extend, impl Default + Extend)
- [disposition: close] Return the delimiter from slice::split_once
- [disposition: merge] Support type '/' to search
- [disposition: merge] Tracking Issue for
Seek::seek_relative
- [disposition: merge] Tracking Issue for generic
NonZero
New and Updated RFCs
- [new] Add an expression for direct access to an enum's discriminant
- [new] RFC: Drop temporaries in tail expressions before local variables
Upcoming Events
Rusty Events between 2024-04-10 - 2024-05-08 🦀
Virtual
- 2024-04-11 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-11 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-04-11 | Virtual (San Diego, CA, US) | San Diego Rust
- 2024-04-15 & 2024-04-16 | Virtual | Mainmatter
- 2024-04-16 | Virtual (Dublin, IE) | Rust Dublin
- 2024-04-16 | Virtual (Washington, DC, US) | Rust DC
- 2024-04-17 | Virtual | Rust for Lunch
- 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-25 | Virtual + In Person (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
Africa
- 2024-05-04 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-04-16 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-04-10 | Cambridge, UK | Cambridge Rust Meetup
- 2024-04-10 | Cologne/Köln, DE | Rust Cologne
- 2024-04-10 | Manchester, UK | Rust Manchester
- 2024-04-10 | Oslo, NO | Rust Oslo
- 2024-04-11 | Bordeaux, FR | Rust Bordeaux
- 2024-04-11 | Reading, UK | Reading Rust Workshop
- 2024-04-15 | Zagreb, HR | impl Zagreb for Rust
- 2024-04-16 | Bratislava, SK | Bratislava Rust Meetup Group
- 2024-04-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-04-16 | Munich, DE + Virtual | Rust Munich
- 2024-04-17 | Bergen, NO | Hubbel kodeklubb
- 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-25 | Aarhus, DK | Rust Aarhus
- 2024-04-23 | Berlin, DE | Rust Berlin
- 2024-04-25 | Berlin, DE | Rust Berlin
- 2024-04-27 | Basel, CH | Rust Basel
- 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
North America
- 2024-04-10 | Boulder, CO, US | Boulder Rust Meetup
- 2024-04-11 | Lehi, UT, US | Utah Rust
- 2024-04-11 | Seattle, WA, US | Seattle Rust User Group
- 2024-04-11 | Spokane, WA, US | Spohttps://www.meetup.com/minneapolis-rust-meetup/kane Rust
- 2024-04-15 | Minneapolis, MN, US | Minneapolish Rust Meetup
- 2024-04-15 | Somerville, MA, US | Boston Rust Meetup
- 2024-04-16 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-04-16 | Seattle, WA, US | Seattle Rust User Group
- 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
Oceania
- 2024-04-15 | Melbourne, VIC, AU | Rust Melbourne
- 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
As a former JavaScript plebeian who has only been semi-recently illuminated by the suspiciously pastel pink, white and blue radiance of Rust developers, NOT having to sit in my web console debugger for hours pushing some lovingly crafted
[object Object]
orundefined
is a blessing.
– Julien Robert rage-blogging against bevy
Thanks to scottmcm 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