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. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Official
Project/Tooling Updates
- rust-analyzer changelog #174
- IntelliJ Rust Changelog #191
- clap v4.2
- CrossBus, A Platform-Less, Runtime-Less Actor Computing Model
- Fornjot (code-first CAD in Rust) - Weekly Release - Some Good Progress
- Announcing
scoped-trace
. - dfdx v0.11.0: cuda accelerated deep learning
- Rust Search Extension v1.10.0 has been released
- Introducing Kobold
- autometrics-rs 0.3: Defining Service-Level Objectives (SLOs) in Rust Source Code
- Rocket's 3rd v0.5 Release Candidate - Rocket Web Framework
- Seven Tasks with Rust and Egui
- ngrok-rs: portable network ingress to your Rust apps w/ native hyper+axum support
- [video] Rust Releases! Rust 1.68.1
- [video] Rust Releases! Rust 1.68.2
Observations/Thoughts
- STV-rs: Single Transferable Vote implementation in Rust
- STM32F4 Embedded Rust at the PAC: Creating Hardware Abstractions with embedded-hal
- Rust's Golden Rule
- Linearity and Control
- Zig And Rust
- Generators
- The AsyncIterator interface
- A Proposal for Safe Window Handles
- Rust Is a Scalable Language
- Paradigm Shift
Rust Walkthroughs
- Building a Fibonacci Heap
- Embedded Rust on BBC Micro Bit: unlocking Vec and HashMap
- STM32F4 Embedded Rust at the PAC: Creating Hardware Abstractions
- State Machine testing with Proptest
- Linear Types One-Pager
- Writing a Linux executable from scratch with x86_64-unknown-none and Rust
- Efficient, Extensible, Expressive: Typed Tagless Final Interpreters in Rust
- Making Python 100x faster with less than 100 lines of Rust
- [video] Env Config Option
Research
Miscellaneous
- How we built our Embedded World Demo on Rust for QNX
- A Rustaceans Tour of embedded world
- [video] I built my own memory profiler (in Rust, on Linux)
- [video] Build Universal Libraries with Rust
- [video] How to Learn Rust
- [video] How Bevy FlyCam Works
- [video] Why I Swaped to Fixed Point Numbers in my game #UTDTG #devlog 2
- [video] Make iterators 10X better with itertools
Crate of the Week
This week's crate is typst, a modern LaTeX replacement.
Thanks to H2CO3 for the suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
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.
- Raccoon - Call for contributors on Raccoon - an IAM server for microservices
- Ockam - Refactor the processing of environment variables
- Ockam - Display the available environment variables in the ockam command help
- Ockam - Pin Telegraf dockerfile images
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
398 pull requests were merged in the last week
panic_immediate_abort
requires abort as a panic strategyrustc_interface
: Add a new querypre_configure
- a general type system cleanup
- add
CastKind::Transmute
to MIR - add
dist.compression-profile
option to control compression speed - add inlining annotations in
dec2flt
- add parentheses properly for method calls
- avoid ICE of attempt to add with overflow in emitter
- cleanup
codegen_fn_attrs
- constrain const vars to error if const types are mismatched
- custom MIR: Allow optional RET type annotation
- custom MIR: Support aggregate expressions
- deeply check well-formedness of return-position
impl Trait
in trait - detect uninhabited types early in const eval
- do not consider synthesized RPITITs on missing items checks
- do not suggest bounds restrictions for synthesized RPITITs
- don't elaborate non-obligations into obligations
- don't pass
TreatProjections
separately tofast_reject
- eagerly intern and check CrateNum/StableCrateId collisions
- enforce non-lifetime-binders in supertrait preds are not object safe
- fix bad suggestion for
clone/is_some
in field init shorthand - fix handling of trailing bare CR in
str::lines
- fix type suggestions in match arms
- make alias-eq have a relation direction (and rename it to alias-relate)
- make link clickable
- make local query providers receive local keys
- make param bound vars visibly bound vars with -Zverbose
- mv tests/codegen/issue-* tests/codegen/issues/
- new solver cleanup + implement coherence
- new solver: make all goal evaluation able to be automatically rerun
- not all retags might be explicit in Runtime MIR
- only clear written-to locals in ConstProp
- only implement
Fn*
traits for extern "Rust" safe function pointers and items - optimize
incremental_verify_ich
- permit the MIR inliner to inline diverging functions
- rPITITs are
DefKind::Opaque
with new lowering strategy - simpler checked shifts in MIR building
- split
execute_job
intoexecute_job_incr
andexecute_job_non_incr
- upgrade to LLVM 16, again
- use
SmallVec
in bitsets - use an
IndexVec
to debug fingerprints - use poison instead of undef
- use region-erased self type during IAT selection
- walk un-shifted nested
impl Trait
in trait when setting up default trait method assumptions - miri: fix raw pointer dyn receivers
- miri: correctly quote env vars in single quoted string in bash
- miri: have the miri cronjob link to the failed run
- stabilize
arc_into_inner
andrc_into_inner
- stabilize
nonnull_slice_from_raw_parts
- drop all messages in bounded channel when destroying the last receiver
- implement Default for some alloc/core iterators
- implement
read_buf
for a few more types - add
#[inline]
toas_deref
- add
#[inline]
to the Into for From impl - shrink unicode case-mapping LUTs by 24k
- windows: make
Command
prefer non-verbatim paths - hashbrown: use strict provenance APIs on nightly
- stdarch: mark more
arm_shared
intrinsics and types as stable in docs - futures: don't ignore empty state polling
- futures: fu: always replace inner wakers
- futures: selectAll doesn't need pin-project
- futures: use
Waker::will_wake()
to avoid a cloning op - cargo: add the old github keys as revoked
- cargo: added new GitHub RSA Host Key
- rustdoc: add support for type filters in arguments and generics
- rustdoc: handle generics better when matching notable traits
- rustdoc: optimize impl sorting during rendering
- rustdoc: remove redundant
.content
prefix from span/a colors - clippy: lint clear with drain
- clippy: do not propose to remove
async move
if variables are captured by ref - clippy: do not propose to simplify a not expression coming from a macro
- clippy: fix
cast_possible_truncation
offering wrong suggestion for casting float to integer - clippy: move
unnecessary_struct_initialization
to nursery - clippy: new lint: detect unnecessary
struct
building - clippy: significantly optimize
significant_drop_tightening
- clippy: wrap
transmutes_expressible_as_ptr_casts
suggestions in parentheses - rust-analyzer: don't escape double hashes outside of Rust code blocks
- rust-analyzer: load proc-macros asynchronously
- rust-analyzer: fix VS Code status message formatting error
- rust-analyzer: fix proc-macro paths using incorrect CrateId's for
rust-project.json
workspaces - rust-analyzer: fix renames of locals being broken in macro calls
- rust-analyzer: remove client side proc-macro version check
Rust Compiler Performance Triage
A busy week with lots of real performance gains. Most regressions seemed to be due to noise. The biggest highlight was large wins in incremental compilation leading to a lot of (albeit modest gains) of 1% performance in a majority of incremental compilation test scenarios. Other than that most performance gains were smaller and more incremental. One of the biggest performance regressions came in an update too LLVM. However, nearly just as many test cases showed improvements as regressions.
Triage done by @rylev. Revision range: ef03fda3..cbc064b3
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.7% | [0.5%, 3.5%] | 24 |
Regressions ❌ (secondary) |
1.2% | [0.2%, 2.6%] | 18 |
Improvements ✅ (primary) |
-1.5% | [-10.9%, -0.3%] | 168 |
Improvements ✅ (secondary) |
-4.0% | [-65.3%, -0.4%] | 119 |
All ❌✅ (primary) | -1.1% | [-10.9%, 3.5%] | 192 |
3 Regressions, 7 Improvements, 8 Mixed; 5 of them in rollups 46 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] Tracking Issue for IsTerminal / is_terminal
- [disposition: merge] Initial support for return type notation (RTN)
- [disposition: merge] Tracking Issue for Option::is_some_and and Result::is_{ok,err}_and
- [disposition: merge] Tracking Issue for "C-unwind ABI", RFC 2945
- [disposition: merge] rustdoc: run more HIR validation to mirror rustc
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 2023-03-29 - 2023-04-26 🦀
Virtual
- 2023-03-29 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-03-31 | Virtual (Tunis, TN) | Rust Tunisia
- 2023-04-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-04-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-04-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-04-06 | Virtual (Tehran, IR) | Iran Rust Meetup
- 2023-04-08 | Virtual | Rust GameDev
- 2023-04-11 | Virtual (Berlin, DE) | Berline.rs - OpenTechSchool Berlin
- 2023-04-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-04-11 | Virtual | Rust Live
- 2023-03-08 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-04-12 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-04-13 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-04-18 | Virtual (Washington, DC, US) | Rust DC
- 2023-04-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-04-20 | Virtual (Munich, DE) | Rust Munich
- 2023-04-20 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-04-25 | Virtual (Dallas, TX, US) | Dallas Rust
Asia
- 2023-04-08 | Beijing, CN | Rust Chinese Group
- 2023-04-08 | Kyoto, JP | Kansai Rust
- 2023-04-12 | Kuala Lumpur, MY | Rust Malaysia; Telegram
Europe
- 2023-03-29 | Paris, FR | Rust Paris
- 2023-03-30 | Copenhagen, DK | Copenhagen Rust Community
- 2023-03-30 | Lille, FR | Rust Lille
- 2023-03-30 | Vienna, AT | Rust Vienna
- 2023-04-04 | Berlin, DE | Berline.rs
- 2023-04-06 | Lyon, FR | Rust Lyon
- 2023-04-19 | Zurich, CH | Rust Zurich
- 2023-04-20 | Aarhus, DK | Rust Aarhus
- 2023-04-20 | Munich, DE + Virtual | Rust Munich
- 2023-04-20 | Bern, CH | Rust Bern
North America
- 2023-03-30 | Ciudad de México, MX | Rust MX
- 2023-04-13 | New York, NY, US | Rust NYC
- 2023-04-18 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-04-04 | Aukland, NZ | Rust AKL
- 2023-04-04 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-04-13 | 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
As part of this work, I even found two memory safety bugs in the DRM scheduler component that were causing kernel oopses for Alyssa and other developers, so the Rust driver work also benefits other kernel drivers that use this shared code! Meanwhile, I still haven't gotten any reports of kernel oopses due to bugs in the Rust code at all.
– Asahi Lina on the Asahi Linux blog
llogiq is patting himself on the back 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