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
Project/Tooling Updates
- Rust and C filesystem APIs (Rust-for-Linux project)
- Progress toward a GCC-based Rust compiler
- Palette 0.7.4
- Fyrox Game Engine 0.33
- Two months in Servo: better inline layout, stable Rust, and more!
- Ownership and data flow in GPUI
- Function Contracts for Kani
- Slint 1.4 Released with additional Look and Improved APIs
- This Week in Fluvio #58 - Fluvio Open Source Streaming System can be deployed locally as a single binary
- Quickwit 0.7 Released: Elasticsearch API compatibility and 30% performance gains
Observations/Thoughts
- How to benchmark Rust code with Criterion
- Playing with Nom and parser combinators
- Where Does the Time Go? Rust's Problem with Slow Compiles
- ESP32 Embedded Rust at the HAL: I2C Scanner
- We build X.509 chains so you don’t have to
- Process spawning performance in Rust
- Introducing Foundations - our open source Rust service foundation library
- High performance vector graphic video games
- Some recent and notable changes to Rust
- Visualizing Dynamic Programming with FireDBG
- [video] Nine Rules for Data Structures in Rust
Rust Walkthroughs
- Rust Memory Leak Diagnosing Guides using Flame Graphs
- WebSockets - The Beginner’s Guide
- Writing Cronjobs in Rust
- Fearless concurrency with Rust, cats, and a few Raspberry PIs
- Rust macros taking care of even more Lambda boilerplate
- Debugging Tokio Instrumentation
Miscellaneous
Crate of the Week
This week's crate is Apache Iceberg Rust, a Rust implementation of a table format for huge analytic datasets.
Thanks to Renjie Liu for the self-suggestion!
Please submit your suggestions and votes for next week!
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.
- GreptimeTeam - Fix a minor bug in
join_path
for more elegant code - GreptimeTeam - Add tests for
MetaPeerClientRef
to enhance GreptimeDB's stability - Ockam - Syntax highlighting for fenced code blocks, in command help output, on Linux works
- Ockam - Output for
ockam project ticket
is improved and information is not opaque - Ockam - Output for both
ockam project ticket
andockam project enroll
is improved, with support for--output json
- Hyperswitch - [FIX]: Add a configuration validation for workers
- Hyperswitch - [FEATURE]: Create a delete endpoing for Config Table
- Hyperswitch - [FEATURE]: Setup code coverage for local tests & CI
- Hyperswitch - [FEATURE]: Have get_required_value to use ValidationError in OptionExt
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.
No Calls for papers were submitted this week.
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
409 pull requests were merged in the last week
pattern_analysis
: letctor_sub_tys
return any Iterator they wantpattern_analysis
: reuse most of theDeconstructedPat Debug
impl- add
#[coverage(off)]
to closures introduced by#[test]
and#[bench]
- add the
min_exhaustive_patterns
feature gate - add the unstable option to reduce the binary size of dynamic library…
- always normalize
LoweredTy
in the new solver - assert that a single scope is passed to
for_scope
- avoid ICE in trait without
dyn
lint - borrow check inline const patterns
- classify closure arguments in refutable pattern in argument error
- const-eval interning: get rid of type-driven traversal
- coverage: dismantle
Instrumentor
and flatten span refinement - coverage: don't instrument
#[automatically_derived]
functions - coverage: never emit improperly-ordered coverage regions
- do not normalize closure signature when building
FnOnce
shim - don't call
walk_
functions directly if there is an equivalentvisit_
method - don't fire
OPAQUE_HIDDEN_INFERRED_BOUND
on sized return of AFIT - don't manually resolve async closures in
rustc_resolve
- emit suggestion when trying to write exclusive ranges as
..<
- fix assume and assert in jump threading
- fix: correct suggestion arg for impl trait
- improve handling of expressions in patterns
- improve handling of numbers in
IntoDiagnosticArg
- make
#![allow_internal_unstable(..)]
work withstmt_expr_attributes
- manually implement derived
NonZero
traits - modify GenericArg and Term structs to use strict provenance rules
- move condition enabling the pass to
is_enabled
- normalize field types before checking validity
- only assemble alias bound candidates for rigid aliases
- properly recover from trailing attr in body
- provide more context on recursive
impl
evaluation overflow - riscv32im-risc0-zkvm-elf: add target
- scopeTree: remove
destruction_scopes
as unused - split Diagnostics for Uncommon Codepoints: Add List to Display Characters Involved
- split tait and impl trait in assoc items logic
- stop using derivative in
rustc_pattern_analysis
- subtree sync for
rustc_codegen_cranelift
- suggest
array::from_fn
for array initialization - use
assert_unchecked
instead ofassume
intrinsic in the standard library - interpret:
project_downcast
: do not ICE for uninhabited variants - return a finite number of AllocIds per ConstAllocation in Miri
- miri: add
__cxa_thread_atexit_impl
on freebsd - miri: add portable-atomic-util bug to "bugs found" list
- miri: freebsd add *stat calls interception support
- only use dense bitsets in dataflow analyses
- remove all ConstPropNonsense
- remove StructuralEq trait
- boost iterator
intersperse(_with)
performance - stabilise array methods
- std: make
HEAP
initializer never inline - add
AsyncFn
family of traits - add
ErrCode
- add
NonZero*::count_ones
- add
str::Lines::remainder
- adjust Behaviour of
read_dir
andReadDir
in Windows Implementation: Check Whether Path to Search In Exists - core: add
From<core::ascii::Char>
implementations - handle out of memory errors in
io:Read::read_to_end()
- impl
From<&[T; N]>
forCow<[T]>
- rc,sync: do not create references to uninitialized values
- initial implementation of
str::from_raw_parts[_mut]
- remove special-case handling of
vec.split_off(0)
- rewrite the
BTreeMap
cursor API using gaps - specialize
Bytes
onStdinLock<'_>
- stabilize
slice_group_by
- switch
NonZero
alias direction - regex: make additional prefilter metadata public
- cargo:
docs(ref)
: Try to improve reg auth docs - cargo:
fix(cli)
: Improve errors related to cargo script - cargo:
fix(config)
: Deprecate non-extension files - cargo:
refactor(shell)
: Use new fancy anstyle API - cargo: doc: replace version with
latest
for jobserver link - cargo: fix list option description starting with uppercase
- cargo: refactor: remove unnecessary Option in
Freshness::Dirty
- cargo: test: data layout fix for
x86_64-unknown-none-gnu
- rustfmt: wrap macro that starts with nested body blocks
- rustfmt: format diff line to be easily clickable
- clippy: add
to_string_trait_impl
lint - clippy: add new
unnecessary_result_map_or_else
lint - clippy: false positive:
needless_return_with_question_mark
with implicit Error Conversion - clippy:
redundant_closure_for_method_calls
Suggest relative paths for local modules - clippy:
multiple_crate_versions
: add a configuration option for allowed duplicate crates - clippy:
never_loop
: recognize desugaredtry
blocks - clippy: avoid linting redundant closure when callee is marked
#[track_caller]
- clippy: don't warn about modulo arithmetic when comparing to zero
- clippy: assert* in multi-condition after unrolling will cause lint
nonminimal_bool
emit warning - clippy: fix incorrect suggestions generated by
manual_retain
lint - clippy: false positive in
redundant_closure_call
when closures are passed to macros - clippy: suggest existing configuration option if one is found
- clippy: warn if an item coming from more recent version than MSRV is used
- rust-analyzer: add postfix completion for let else
- rust-analyzer: filter out cfg-disabled fields when lowering record patterns
- rust-analyzer: replaced
adjusted_display_range
withadjusted_display_range_new
inmismatched_arg_count
Rust Compiler Performance Triage
This was a very quiet week with only one PR having any real impact on overall compiler performance. The removal of the internal StructuralEq
trait saw a roughly 0.4% improvement on average across nearly 50 real-world benchmarks.
Triage done by @rylev. Revision range: d6b151fc7..5c9c3c7
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.5% | [0.3%, 0.7%] | 5 |
Regressions ❌ (secondary) |
0.5% | [0.2%, 1.4%] | 10 |
Improvements ✅ (primary) |
-0.5% | [-1.5%, -0.2%] | 48 |
Improvements ✅ (secondary) |
-2.3% | [-7.7%, -0.4%] | 36 |
All ❌✅ (primary) | -0.4% | [-1.5%, 0.7%] | 53 |
0 Regressions, 4 Improvements, 4 Mixed; 3 of them in rollups 37 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
Tracking Issues & PRs
- [disposition: merge] static mut: allow mutable reference to arbitrary types, not just slices and arrays
- [disposition: merge] Make it so that async-fn-in-trait is compatible with a concrete future in implementation
- [disposition: merge] Decision: semantics of the
#[expect]
attribute - [disposition: merge] style-guide: When breaking binops handle multi-line first operand better
- [disposition: merge] style-guide: Tweak
Cargo.toml
formatting to not put description last - [disposition: merge] style-guide: Format single associated type where clauses on the same line
- [disposition: merge] PartialEq, PartialOrd: update and synchronize handling of transitive chains
- [disposition: merge]
std::error::Error
-> Trait Implementations: lifetimes consistency improvement
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline RFCs entered Final Comment Period this week.
New and Updated RFCs
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.
Upcoming Events
Rusty Events between 2024-01-31 - 2024-02-28 🦀
Virtual
- 2024-01-31 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-02-01 | Virtual + In Person (Barcelona, ES) | BcnRust
- 2024-02-01 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-02-03 | Virtual + In-person (Brussels, BE) | FOSDEM 2024
- 2024-02-03 | Virtual (Kampala, UG) | Rust Circle
- 2024-02-04 | Virtual | Rust Maven
- 2024-02-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-02-08 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-02-08 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-02-10 | Virtual (Krakow, PL) | Stacja IT Kraków
- 2024-02-10 | Virtual (Wrocław, PL) | Stacja IT Wrocław
- 2024-02-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-02-15 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-02-15 | Virtual + In person (Praha, CZ) | Rust Czech Republic
- 2024-02-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-02-22 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
Asia
- 2024-02-10 | Hyderabad, IN | Rust Language Hyderabad
Europe
- 2024-02-01 | Hybrid (Barcelona, ES) | BcnRust
- 2024-02-03 | Brussels, BE | FOSDEM '24
- 2024-02-03 | Nürnberg, BY, DE | Paessler Rust Camp 2024
- 2024-02-05 | Brussels, BE | Belgium Rust user group
- 2024-02-06 | Bremen, DE | Rust Meetup Bremen
- 2024-02-07 | Cologne, DE | Rust Cologne
- 2024-02-07 | London, UK | Rust London User Group
- 2024-02-08 | Bern, CH | Rust Bern
- 2024-02-15 | Praha, CZ - Virtual + In-person | Rust Czech Republic
- 2024-02-21 | Lyon, FR | Rust Lyon
- 2024-02-22 | Aarhus, DK | Rust Aarhus
North America
- 2024-02-07 | Brookline, MA, US | Boston Rust Meetup
- 2024-02-08 | Lehi, UT, US | Utah Rust
- 2024-02-12 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-02-13 | New York, NY, US | Rust NYC
- 2024-02-13 | Seattle, WA, US | Cap Hill Rust Coding/Hacking/Learning
- 2024-02-15 | Boston, MA, US | Boston Rust Meetup
- 2024-02-15 | Seattle, WA, US | Seattle Rust User Group
- 2024-02-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-02-28 | Austin, TX, US | Rust ATX
Oceania
- 2024-02-06 | Perth, WA, AU | Perth Rust Meetup Group
- 2024-02-27 | Canberra, ACT, AU | Canberra Rust User Group
- 2024-02-27 | Sydney, NSW, AU | Rust Sydney
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
The sheer stability of this program is what made me use rust for everything going forward. The social-service has a 100% uptime for almost 2.5 years now. It’s processed 12.9TB of traffic and is still using 1.5mb of ram just like the day we ran it 2.5 years ago. The resource usage is so low it brings tears to my eyes. As someone who came from Java, the lack of OOM errors or GC problems has been a huge benefit of rust and I don’t ever see myself using any other programming language. I’m a big fan of the mindset “build it once, but build it the right way” which is why rust is always my choice.
Thanks to Brian Kung 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