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
Project/Tooling Updates
- Replacing PyO3's API without breaking everything downstream
- rust-analyzer changelog #223
- rust-gcc February 2024 Monthly report
- godot-rust February 2024 dev update
- Fluvio v0.11.5 Release Updates
- sshd-openpgp-auth version 0.3.0 and ssh-openpgp-auth version 0.2.2 as updates to the tooling providing OpenPGP based authentication for SSH host keys
Observations/Thoughts
- Borrow checking without lifetimes
- How to speed up the Rust compiler in March 2024
- Code review in the Rust compiler
- Rust
thread_local!
s are surprisingly expensive - Designing an Async Runtime for WASI 0.2
Rust Walkthroughs
- Storing borrowed data in trait objects
- Rust's early vs. late lifetime binding
- How moving from Pandas to Polars made me write better code without writing better code
- A Full Stack SaaS Template with Loco
- Async Rust in a Nutshell
- Real-time Streaming Analytics with Fluvio, DeepCausality, and Rust
- [video] Modern All Rust Stack - Dioxus, Axum, Warp, SurrealDB
- [video] Serverless Data Pipelines in Rust by Michele Vigilante
- [FR] [video] Rust Lyon Meetup #8 - Impl Snake for Micro:bit — Cyril MARPAUD
Miscellaneous
- Czech Rust community index
- Launching RustRover: JetBrains’ Investment in Rust
- [audio] RustShip: Rust in Art with Lisa Passing
Crate of the Week
This week's crate is srgn, a mix of tr, sed, rip-grep and tree-sitter.
Thanks to Alex Povel 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 RFCs issued a call for testing 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.
- Ockam - Output for both
ockam project ticket
andockam project enroll
is improved, with support for--output json
- Ockam - Syntax highlighting for fenced code blocks, in command help output, on Linux works
- Ockam - Command - refactor to use typed interfaces to implement commands for
kafka services
- ZeroCopy - Don't generate warning when deriving on deprecated type
- ZeroCopy - Test the output of zerocopy-derive
- ZeroCopy - [CI] Check semver compatibility with all target platforms, not just the host platform
- ZeroCopy - Inline many trait methods (in zerocopy and in derive-generated code)
- Fluvio - fvm switch fails on some systems with running local cluster
- Fluvio - Add new command fluvio cluster resume
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.
- Oxidize 2024 CFP closes 2024-03-24 | Berlin, Germany | Event date: 2024-05-28 - 2024-05-30
- RustConf 2024 | CFP closes 2024-04-25 | Montreal, Canada | 2024-09-10
- EuroRust 2024| CFP closes 2024-06-03 | Vienna, Austria & online | Event on 2024-10-10
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
488 pull requests were merged in the last week
ffi_unwind_calls
: treat RustIntrinsic like regular Rust callspattern_analysis
: rework how we hide empty private fields- rustc: fix wasm64 metadata object files
- add a proper
with_no_queries
to printing - add a way to add constructors for
rustc_type_ir
types - add initial support for DataFlowSanitizer
- add new
pattern_complexity
attribute to add possibility to limit and check recursion in pattern matching - add platform-specific function to get the error number for HermitOS
- add profiling support to AIX
- add proper cfg to keep only one AlignmentEnum definition for different
target_pointer_widths
- allow statics pointing to mutable statics
- always generate GEP i8 / ptradd for
struct
offsets - avoid collecting into vecs in some places
- avoid using unnecessary queries when printing the query stack in panics
- consider middle segments of paths in
unused_qualifications
- correctly generate item info of trait items
- delete line if suggestion would replace it with an empty line
- display short types for unimplemented trait
- don't grab variances in
TypeRelating
relation if we're invariant - don't panic when waiting on poisoned queries
- fix incorrect suggestion for uninitialized binding in pattern
- fix issues in suggesting importing extern crate paths
- fix link generation for foreign macro in jump to definition feature
- implement missing ABI structures in StableMIR
- improve renaming suggestion when item starts with underscore
- made
INVALID_DOC_ATTRIBUTES
lint deny by default - make
ZeroablePrimitive
trait unsafe - make the success arms of
if lhs || rhs
meet up in a separate block - match lowering: Lower bindings in a predictable order
- match lowering: Separate the
bool
case from other integers inTestKind
- match lowering: pre-simplify or-patterns too
- never say
"
Trait is implemented for {type error}"
- normalizes-to: handle negative impls
- opportunistically resolve regions when processing region outlives obligations
- pattern analysis: Don't panic when encountering unexpected constructor
- pattern analysis: abort on arity mismatch
- preserve same vtable pointer when cloning raw waker, to fix
Waker::will_wake
- process alias-relate obligations in CoerceUnsized loop
- properly deal with GATs when looking for method chains to point at
- safe Transmute: Revise safety analysis
- skip unnecessary comparison with half-open range patterns
- split
rustc_type_ir
to avoidrustc_ast
from depending on it - style library/core/src/error.rs
- suggest moving definition if non-found
macro_rules!
is defined later - suggest removing superfluous semicolon when statements used as expression
- the ordinary lowering of
thir::ExprKind::Let
is unreachable - use volatile access instead of
#[used]
foron_tls_callback
- miri: add -Zmiri-track-alloc-accesses to readme and fix its wording
- miri: log when we change the active thread, and fix logging for concurrency
- miri: print thread name in miri error backtraces; add option to track read/write accesses
- miri: tree Borrows diagnostic improvements
- miri: windows: support getting the thread name
- add ASCII fast-path for
char::is_grapheme_extended
- perf: improve
write_fmt
to handle simple strings - add
display
method toOsStr
- have
String
useSliceIndex
impls fromstr
- use the OS thread name by default if
THREAD_INFO
has not been initialized - add missing
get_name
forwasm::thread
- remove
Mutex::unlock
Function - implement unwind safety for Condvar on all platforms
- make
ReentrantLock
public - codegen_gcc: debuginfo: Add support for debuginfo, without scope support
- codegen_gcc: switch to the new
set_special_chars_allowed_in_func_names
API - cargo add: Fallback to
rustc -v
when no MSRV is set - cargo toml: Warn on unset Edition
- cargo msrv: Report all incompatible packages, not just a random one
- cargo rustc: Always pass --edition to rustc
- cargo toml: Don't warn on unset Edition if only 2015 is compatible
- cargo: add all unit's children recursively for
doc.extern-map
option - cargo: add "-Zpublic-dependency" for public-dependency feature
- cargo: silently ignore
cargo::rustc-check-cfg
to avoid MSRV annoyance when stabilizing-Zcheck-cfg
- cargo: stabilize global cache data tracking
- rustdoc: Prevent inclusion of whitespace character after
macro_rules
ident - rustfmt: ensure space around binary exprs
- clippy:
identity_op
: Fix duplicate diagnostics - clippy:
let_underscore_untyped
: fix false positive on async function - clippy:
map_entry
: Check insert expression for map use - clippy:
misrefactored_assign_op
: fix duplicate diagnostics - clippy:
redundant_closure_call
: don't lint closure originating from a macro - clippy:
unnecessary_cast
: avoid breaking precedence - clippy: add
assigning_clones
lint - clippy: add
mixed_attributes_style
lint - clippy: added msrv to threadlocal initializer check
- clippy: check for try blocks in
question_mark
more consistently - clippy: dedup
std_instead_of_core
by using first segment span for uniqueness - clippy: don't emit "missing backticks" lint if the element is wrapped in
<code>
HTML tags - clippy: fix false positive in
threadlocal!
when falling back toos_local
- clippy: fix
derive_partial_eq_without_eq
false positive on trait projection - clippy: fix
nonminimal_bool
lint regression - clippy: fix
manual_memcpy
wrong indexing for multi dimensional arrays - clippy: handle plural acronyms in
doc_markdown
- clippy: improve
is_lint_level
code - clippy: lower
bstr
version requirement to1.6.0
- clippy: pointers cannot be converted to integers at compile time
- rust-analyzer: add hover display for trait assoc items
- rust-analyzer: add basic support for native debug
- rust-analyzer: autocomplete constants inside format strings
- rust-analyzer: don't destructure
struct
with no public fields - rust-analyzer: don't highlight related assoc items of super traits
- rust-analyzer: goto definition for
deref_mut
- rust-analyzer: goto definition for
index_mut
- rust-analyzer: goto-definition for constants inside range pattern
- rust-analyzer: ignore generic arguments in intra doc link path resolution
- rust-analyzer: put style lints behind disabled-by-default config
- rust-analyzer: fix rust-project.json projects not preferring sysroot rustc
- rust-analyzer: fix wrong closure kind deduction for closures with predicates
- futures: parse rhs of
select!
arms using match-arm rules
Rust Compiler Performance Triage
A bunch of noise this week which has been dropped from the report (but may be present in the summary figures). As a result, the week is pretty busy in amount of changes, but the net effect is nearly neutral to a slight regression for most workloads.
Triage done by @simulacrum. Revision range: 71ffdf7..41d97c8
2 Regressions, 0 Improvements, 10 Mixed; 4 of them in rollups 51 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
- RFC: patchable-function-entry
- RFC: Add native code coverage support in Cargo
- RFC: Packages as (optional) namespaces
Tracking Issues & PRs
Rust
- [disposition: merge] alloc: implement
FromIterator
forBox<str>
- [disposition: merge] rework opaque type region inference
- [disposition: merge] Make
impl<Fd: AsFd>
impl take?Sized
- [disposition: merge] Tracking issue for Allow a re-export for
main
(RFC 1260) - [disposition: merge] Update Windows platform support
- [disposition: close] Resolve region bounds from components of type projection
- [disposition: merge] Propagate temporary lifetime extension into if and match.
- [disposition: merge] more eagerly instantiate binders
- [disposition: merge]
E0492: borrow of an interior mutable value may end up in the final value
during const eval when no inner mutability is involved - [disposition: merge] align_offset, align_to: no longer allow implementations to spuriously fail to align
- [disposition: merge] Soft-destabilize
RustcEncodable
&RustcDecodable
, remove from prelude in next edition - [disposition: merge]
impl From<TryReserveError>
forio::Error
Cargo
- [disposition: merge] Tracking Issue for rustc
--check-cfg
integration
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-03-06 - 2024-04-03 🦀
Virtual
- 2024-03-06 | Virtual (Dublin, IE) | Rust Dublin
- 2024-03-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-03-07 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-03-12 | Hybrid (Virtual + In-person) Munich, DE | Rust Munich
- 2024-03-13 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 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-19 | Virtual (Washinigton, DC, US) | Rust DC
- 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-28 | Virtual (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
Asia
- 2024-03-09 | Karnataka, Bengaluru, IN | Rust Bangalore
- 2024-03-12 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-03-06 | Cologne / Köln, DE | Rust Cologne
- 2024-03-06 | Zürich, CH | Rust Zürisee
- 2024-03-07 | Copenhagen, DK | Copenhagen Rust Community
- 2024-03-12 | Munich, DE + Virtual | Rust Munich
- 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-26 | Barcelona, ES + Virtual | BcnRust
- 2024-03-27 - 2024-03-28 | London, UK | Rust Nation UK
- 2024-03-28 | Berlin, DE | Rust Berlin
North America
- 2024-03-07 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-03-12 | New York, NY, US | Rust NYC
- 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-27 | Austin, TX, US | Rust ATX
- 2024-03-27 | Hawthorne, CA, US | Freeform
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
My experience with C++ is that, as I’ve become more of an expert in the language, I’ve become more disillusioned with it. It’s incredibly hard to do things that you should be able to do in software. And, it’s a huge problem for me to constantly be helping other engineers debug the same bugs over and over. It’s always another use after free. I’ve probably debugged 300 of those. [...]
In our experience using the Rust ecosystem for almost three years now, I don't think we found a bug in a single Rust crate that we've pulled off the shelf. We found a bug in one of them and that was a Rust crate wrapping a C library and the bug was in the C library. The software quality that you kind of get for free is amazing.
– Carter Schultz interviewed on the filtra blog
Thanks to George Barwood 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