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
Newsletters
Project/Tooling Updates
- Bevy Foundation
- Rust Flashcards - 557 cards to learn Rust from first principles
- Lib.rs website improvements
- Sudo-rs dependencies: when less is better
- rust-analyzer changelog #224
- biscotti, a new crate for HTTP cookies
- Boa release v0.18
- Announcing Relm4 0.7 and 0.8
- Meilisearch 1.7 — New OpenAI models & GPU support for Hugging Face embeddings
- Cargo wizard: automate Cargo project configuration
- GreptimeDB v0.7 is ready for cloud-native monitoring
- [video] Project Syn - Simon Gerber - Rust Zürisee March 2024
Observations/Thoughts
- Fast Development In Rust, Part One
- Mental model for unsafe (complete rewrite)
- 10 years in Open Source
- [audio] Season Finale - Rust in Production Podcast
- [video] SemVer in Rust: Breakage, Tooling, and Edge Cases
Rust Walkthroughs
- How to Use Rust Procedural Macros to Replace Panic with syn’s Fold
- Rust Iterators Beyond the Basics - part 1
- Rust Multi-crate project in a monorepo
- Using Stripe Payments with Rust
- Problems around modelling an asynchronous API for database transaction in Rust
- Embedded Rust Bluetooth on ESP: BLE Scanner
- [video] Implementing (parts of) git from scratch in Rust
- [video] The Billion Rows Challenge in Rust - an intro to Rust for data engineering
Miscellaneous
- Rust impact on engineering management
- From medical doctor to rust developer
- February 2024 Rust Jobs Report
Crate of the Week
This week's crate is biscotti, an opinionated library to deal with HTTP cookies on the server side.
We saw a lamentable lack of suggestions this week. Nevertheless, llogiq is pleased with his selection.
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:
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.
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Bambora
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Mollie
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Braintree
- GreptimeDB - Painless integrating with Grafana via Prometheus plugin
- GreptimeDB - Add strict mode to validate protocol strings
- Fluvio - fvm switch fails on some systems with running local cluster
- Fluvio - Add new command fluvio cluster resume
- quinn - Add CI for mobile platforms (iOS & Android)
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. They are ordered below by when the CFP closes.
- RustFest Zürich 2024 | Closes 2024-03-31 | Zürich, Switzerland | Event date: 2024-06-19 - 2024-06-24
- Oxidize 2024 | Closes 2024-03-24 | Berlin, Germany | Event date: 2024-05-28 - 2024-05-30
- RustConf 2024 | Closes 2024-04-25 | Montreal, Canada | Event date: 2024-09-10
- EuroRust 2024| Closes 2024-06-03 | Vienna, Austria & online | Event on 2024-10-10
- Scientific Computing in Rust 2024| Closes 2024-06-14 | online | Event date: 2024-07-17 - 2024-07-19
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
506 pull requests were merged in the last week
- add new Tier-3 target:
loongarch64-unknown-linux-musl
- add arm64ec-pc-windows-msvc target
- LLVM Bitcode Linker: A self contained linker for nvptx and other targets
- AST validation: Improve handling of inherent impls nested within functions and anon consts
const_eval_select
: make it safe but be careful with what we expose on stable for nowhir_analysis
: enums returnNone
infind_field
- add a
description
field to target definitions - add an option to have an external download/bootstrap cache
- add asm goto support to
asm!
- add metadata to targets
- add proper cfgs for
struct
HirIdValidator used only with debug-assert - add the new description field to
Target::to_json,
and add descriptions for some MSVC targets - allow codegen backends to opt-out of parallel codegen
- allow multiple
impl Into<{D,Subd}iagMessage>
parameters in a function - allow targets to override default codegen backend
- apply
EarlyBinder
only toTraitRef
inImplTraitHeader
- avoid invoking the
intrinsic
query for DefKinds other thanFn
orAssocFn
- avoid overlapping privacy suggestion for single nested imports
- change some attributes to
only_local
- check that return type is WF in typeck
- detect unused
struct
impls pub trait - diagnostics: do not suggest using
#[unix_sigpipe]
without a value - distinguish between library and lang UB in
assert_unsafe_precondition
- do not try to format removed files
- don't ICE if we collect no RPITITs unless there are no unification errors
- don't ICE in CTFE if raw/fn-ptr types differ
- don't pass a break scope to
Builder::break_for_else
- don't require specifying unrelated assoc types when trait alias is in
dyn
type - dynamically size sigaltstk in std
- errors: share
SilentEmitter
between rustc and rustfmt - fix crash in internal late lint checking
- fix legacy numeric constant diag items
- fix linting paths with qself in
unused_qualifications
- fix metadata for dyn-star in new solver
- fix misaligned loads when loading UEFI arg pointers
- fix redundant import errors for preload extern crate
- fix type resolution of associated const equality bounds (take 2)
- fix: localWaker memory leak and some stability attributes
- implement async closure signature deduction
- improve diagnostics for parenthesized type arguments
- interpret: do not call machine read hooks during validation
- limit the number of names and values in check-cfg diagnostics
- lint singleton gaps after exclusive ranges
- loongarch: add frecipe and relax target feature
- lower transmutes from int to pointer type as gep on null
- make TAITs and ATPITs capture late-bound lifetimes in scope
- make
DefiningAnchor::Bind
only store the opaque types that may be constrained, instead of the current infcx root item - make
std::os::unix::ucred
module private - make not finding core a fatal error
- make the lowering of
thir::ExprKind::If
easier to follow - match lowering: define a convenient
struct
- only compare ambiguity item that have hard error
- only set noalias on Box with the global allocator
- record mtime in bootstrap's LLVM linker script
- refactor pre-getopts command line argument handling
- refer to "slice" instead of "vector" in Ord and PartialOrd trait impl of slices
- remove
feed_local_def_id
- removing absolute path in proc-macro
- rework
untranslatable_diagnostic
lint - run a single huge
par_body_owners
instead of many small ones after each other - silence mismatched types errors for implied projections
- stabilize the
#[diagnostic]
namespace and#[diagnostic::on_unimplemented]
attribute - std support for wasm32 panic=unwind
- store backtrace for
must_produce_diag
- temporarily make allow-by-default the
non_local_definitions
lint - tweak the way we protect in-place function arguments in interpreters
- uplift some feeding out of
associated_type_for_impl_trait_in_impl
and into queries - use GEP inbounds for ZST and DST field offsets
- use ptradd for vtable indexing
- MIR printing: print the path of uneval'd const
- miri: do not apply aliasing restrictions to
Box
with custom allocator - miri: remove the ability to disable ABI checking
- perf: build
rustc
with 1CGU onx86_64-apple-darwin
andx86_64-pc-windows-msvc
- replace the default branch with an unreachable branch If it is the last variant
- optimize write with
as_const_str
for shorter code - fix quadratic behavior of repeated vectored writes
- net: don't use checked arithmetic when parsing numbers with known max digits
align_offset, align_to
: no longer allow implementations to spuriously fail to align- impl
From<TryReserveError>
forio::Error
- make
impl<Fd: AsFd>
impl take?Sized
- add
Read
impl for&Stdin
std::rand
: enable getrandom for dragonflybsd toostd::threads
: revisit stack address calculation on netbsd- win10: use
GetSystemTimePreciseAsFileTime
directly - windows: implement condvar, mutex and rwlock using futex
- add
slice::try_range
- implement
MaybeUninit::fill{,_with,_from}
RawVec::into_box
: avoid unnecessary intermediate referenceVec::try_with_capacity
- add
#[inline]
toBTreeMap::new
constructor - add
std::ffi::c_str
module - futures: add a helper for always ready futures
- cargo: cli: allow logging to chrome traces
- cargo: doc: collapse down generated statuses without --verbose
- cargo: log: trace parameters to align with profile
- cargo: lockfile: make diffing/printing more reusable
- cargo: consistently compare MSRVs
- rustfmt: fix failure with
=>
in comment after match=>
- clippy: new lints:
duplicated_attributes
,manual_unwrap_or_default
,nonminimal_bool
,zero_repeat_side_effects
andconst_is_empty
- clippy: fix duplicate diagnostics in
manual_retain
,mut_mut
,no_effect_replace
andsingle_match
- clippy: don't lint
redundant_field_names
across macro boundaries - clippy: fix
std_instead_of_core
false positive - clippy: fix
missing_docs_in_private_items
on some proc macros - clippy: have more lints respect
#[allow]
on exprs - rust-analyzer: add QuickFix for unresolved field
- rust-analyzer: add fix for
unused_variables
- rust-analyzer: add proc macro semantic token type
- rust-analyzer: add config and capability for test explorer
- rust-analyzer: don't escape
\
and$
in "Extract format expressions" assist - rust-analyzer: don't force draw a dependency edge to the
real_span_map
query - rust-analyzer: don't invalid body query results when generating desugared names
- rust-analyzer: fix method resolution snapshotting
receiver_ty
too early - rust-analyzer: function argument type inference with associated type impl trait
- rust-analyzer: keep attributes in assist
'generate_delegate_trait'
- rust-analyzer: panic when using float numbers without dots in chain calls
- rust-analyzer: preserve $ and \ in postfix format completions
- rust-analyzer: remove accidental dependency between
parse_macro_expansion
andparse
- rust-analyzer: skip match diagnostics for partially unknown types
- rust-analyzer: for toolchain binaries use the full path found in $PATH
- rust-analyzer: stop eagerly resolving inlay hint text edits for VSCode
Rust Compiler Performance Triage
A mixed week, with a vast number of improvements (in large part due to PR
122010, which undoes a prior regression; PR #120985, a host LLVM update).
But also three admittedly small-ish regressions which seemed unanticipated and were still large enough that I did not feel comfortable rubber-stamping them with a perf-regression-triaged marking.
Triage done by @pnkfelix. Revision range: 41d97c8a..e919669d
2 Regressions, 5 Improvements, 9 Mixed; 5 of them in rollups 54 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] Normalize trait ref before orphan check & consider ty params in alias types to be uncovered
- [disposition: merge] Split refining_impl_trait lint into _reachable, _internal variants
- [disposition: merge] debuginfo: Stabilize
-Z debug-macros
,-Z collapse-macro-debuginfo
and#[collapse_debuginfo]
- [disposition: merge] Stabilize associated type bounds (RFC 2289)
- [disposition: merge]
c_unwind
full stabilization request: change inextern "C"
behavior - [disposition: postpone] Consider linting against 00B7 aka interpunct aka middle dot
- [disposition: merge] Prevent opaque types being instantiated twice with different regions within the same function
- [disposition: merge] instantiate higher ranked goals outside of candidate selection
- [disposition: merge] Add
wasm_c_abi
future-incompat
lint - [disposition: merge] stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate
- [disposition: merge] feat:
implement {Div,Rem}Assign<NonZero<X>>
onX
Cargo
- [disposition: merge] cargo: prevent dashes in lib.name
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-03-13 - 2024-04-10 🦀
Virtual
- 2024-03-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2024-03-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-03-14 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-03-14 | Virtual (San Diego, CA, US) | San Diego Rust
- 2024-03-19 | Virtual | Formal Land
- 2024-03-19 | Virtual (Washinigton, DC, US) | Rust DC
- 2024-03-20 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-03-20 | Virtual (Vancouver, BC, CA)| Vancouver Rust
- 2024-03-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-26 | Virtual + In Person (Barcelona, ES) | BcnRust
- 2024-03-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-03-28 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-02 | Virtual (Buffalo, NY, US) | Buffalo Rust
- 2024-04-03 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-04-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-04-09 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-04-05 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-03-30 | New Delhi, IN | Rust Delhi
Europe
- 2024-03-13 | Paris, FR | Paris Rustaceans
- 2024-03-14 | Reading, UK | Reading Rust Workshop
- 2024-03-19 | Aarhus, DK | Rust Aarhus
- 2024-03-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-03-19 | Prague, CZ | Rust Prague
- 2024-03-20 | Girona, ES | Rust Girona
- 2024-03-20 | Lyon, FR | Rust Lyon
- 2024-03-21 | Augsburg, DE | Rust Meetup Augsburg
- 2024-03-21 | Lille, FR | Rust Lille
- 2024-03-21 | Vienna, AT | Rust Vienna
- 2024-03-23 | Stockholm, SE | Ferris' Fika Forum
- 2024-03-26 | Barcelona, ES + Virtual | BcnRust
- 2024-03-26 - 2024-03-28 | London, UK | Rust Nation UK
- 2024-03-28 | Berlin, DE | Rust Berlin
- 2024-04-10 | Cambridge, UK | Cambridge Rust Meetup
- 2024-04-10 | Oslo, NO | Rust Oslo
North America
- 2024-03-13 | Boston, MA, US | Boston Rust Meetup
- 2024-03-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-03-21 | Seattle, WA, US | Seattle Rust User Group
- 2024-03-22 | Somerville, MA, US | Boston Rust Meetup
- 2024-03-26 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-03-27 | Austin, TX, US | Rust ATX
- 2024-03-27 | Hawthorne, CA, US | Freeform
- 2024-03-31 | Boston, MA, US | Boston Rust Meetup
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
In 10 years we went from “Rust will never replace C and C++” to “New C/C++ should not be written anymore, and you should use Rust”. Good job.
Thanks to Dennis Luxen 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