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
- rust-analyzer changelog #190
- Generating terminal user interfaces with Ratatui + ChatGPT
- Kani 0.32.0 has been released!
- Bevy XPBD 0.2.0: Spatial queries, Bevy 0.11 support, and a lot more
- bwrap : A fast, lightweight, embedded environment-friendly Rust library for wrapping text
- We Just Released our Rust Teleconferencing System for Free | Repo
Observations/Thoughts
- Mutex without lock, Queue without push: cancel safety in lilos
- Why Rust is a great fit for embedded software - 2023 update
- {n} times faster than C, where n = 128
- I have written a JVM in Rust
- On Maximizing Your Rust Code's Performance
- How
rustdoc
achieves a genius design - ESP32 Standard Library Embedded Rust: GPIO Control
- Rust vs Julia in scientific computing
- Writing a toy DNS resolver in Rust
Rust Walkthroughs
- [series] Rust multi crate monorepo microservices series with Kafka, Apache Avro, OpenTelemetry tracing
- The easiest way to speed up Python with Rust
- Writing an AI Chatbot in Rust and Solid.js
- Simple Rust Function Macros
- Updated fluvio SQL sink connector (repo) | Walkthrough of deduplication on write using upsert function
- [video] Rust Releases! Rust 1.71.0
- ratatui 0.22.0 is released! (community fork of tui-rs)
- Asynchronous Rust on Cortex-M Microcontrollers
Research
Miscellaneous
- [video] How Functions Function
- [video] Rust's iterators are more interesting than they look
- [audio] Bootstrapping Rust with Albert Larsan
[release] A Decade of Rust, and Announcing Ferrocene
Crate of the Week
This week's crate is ratatui, a crate to build rich terminal user interfaces and dashboards.
Thanks to orhun for the (partial self-)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.
- Hyperswitch - Replacing the occurrences of gen_range with a safe alternative
- Hyperswitch - Include Currency Conversion utility functions to Currency Trait implementation
- Hyperswitch - Change Currency Enum to text string
- Ockam - Tauri based Ockam App: Stop app from appearing in the macOS dock 1
- Ockam - Tauri based Ockam App: Verify if a user is properly enrolled when starting the app 1
- Ockam - Clap based Ockam Command: Irregular spacing in output when calling
ockam node list
1
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
391 pull requests were merged in the last week
- dynamically size sigaltstk in rustc
- add
#[rustc_confusables]
attribute to allow targeted "no method" error suggestions on standard library types - add machine-applicable suggestion for
unused_qualifications
lint - add support for inherent projections in new solver
- allow escaping bound vars during
normalize_erasing_regions
in new solver - avoid building proof trees in select
- check entry type as part of item type checking
- don't call
predicate_must_hold
-esque functions during fulfillment in intercrate - don't fail early if
try_run
returns an error - don't suggest
impl Trait
in path position - enable
potential_query_instability
lint inrustc_hir_typeck
- enable coinduction support for Safe Transmute
- generate safe stable code for derives on empty enums
- implement "items do not inherit unsafety" note for THIR unsafeck
- implement selection for
Unsize
for better coercion behavior - lint against misplaced where-clauses on associated types in traits
- normalize lazy type aliases when probing for ADTs
- structurally resolve in pattern matching when peeling refs in new solver
- trait system refactor ping: also apply to nested modules of
solve
- uplift
clippy::fn_null_check
lint - while let suggestion will work for closure body
- implement a few more rvalue translation to SMIR
- add Adt to SMIR
- add more ty conversions to SMIR
- enable MIR reference propagation by default
- miri: fail when calling a function that requires an unavailable target feature
- miri: protect
Move()
function arguments during the call - miri: work around
custom_mir
span rustc_target
: Add alignment to indirectly-passed by-value types, correcting the alignment of byval on x86 in the process- add a cache for
maybe_lint_level_root_bounded
- rewrite
UnDerefer
, again - add support for allocators in
Rc
&Arc
std::io
: add backBorrowedBuf::filled_mut
- eliminate ZST allocations in
Box
andVec
- regex: improve literal extraction from certain repetitions
- codegen_gcc: add support for
pure
function attribute - codegen_gcc: add support for
returns_twice
function attribute - cargo: Always generate valid package names
- cargo: Error on intentionally unsupported commands
- rustdoc: add jump to doc to sourceview
- clippy:
arithmetic_side_effect
: allow different types on the right hand side forWrapping<T>
- clippy:
panic_in_result_fn
removetodo!
, unimplemented!, unreachable!
- clippy:
semicolon_if_nothing_returned
: add an autofix - clippy:
tuple_array_conversions
: move fromcomplexity
tonursery
- clippy:
unnecessary_literal_unwrap
: also lintunwrap_(err_)unchecked
- clippy: don't lint
needless_return
in fns across a macro boundary - clippy: new lint:
format_collect
- rust-analyzer: add
write_bytes
and ctlz intrinsics - rust-analyzer: enable cfg miri in analysis
- rust-analyzer: fix eager token mapping panics
- rust-analyzer: fix rust-analzyer ssr help message
- rust-analyzer: give real
discriminant_type
to chalk - rust-analyzer: handle TyAlias in
projected_ty
- rust-analyzer: make fields of
mir::Terminator
public - rust-analyzer: normalize type alias in
projected_ty
- rust-analyzer: revert "Handle TyAlias in
projected_ty"
Rust Compiler Performance Triage
A lot of spurious results in the regressions this week. However, we did see some real gains with PR #113609, with nearly 40 real-world benchmarks improving their check-build performance by >=1%.
Triage done by @pnkfelix. Revision range: 1d4f5aff..6b9236ed
5 Regressions, 5 Improvements, 5 Mixed; 2 of them in rollups 57 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] Infer type in irrefutable slice patterns with fixed length as array
- [disposition: merge] discard default auto trait impls if explicit ones exist (rebase of #85048)
- [disposition: merge] Support interpolated block for
try
andasync
- [disposition: close] Uplift
clippy::option_env_unwrap
lint - [disposition: merge] Add documentation on v0 symbol mangling.
- [disposition: merge] Check Cargo.lock in to version control for libraries
New and Updated RFCs
- [new] Unsafe fields
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-07-19 - 2023-08-16 🦀
Virtual
- 2023-07-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-07-20 | Virtual (Tehran, IR) | Iran Rust Meetup
- 2023-07-24 | Virtual (Toronto, CA) | Programming Languages Virtual Meetup
- 2023-07-25 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-07-25 | Virtual (Dublin, IE) | Rust Dublin
- 2023-07-26 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-07-27 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-07-28 | Virtual (Tunis, TN) | Rust Meetup Tunisia
- 2023-08-01 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-08-01 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-08-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-08-15 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-08-16 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Asia
- 2023-07-27 | Seoul, KR | Rust Programming Meetup Seoul
Europe
- 2023-07-21 | Nuremberg, DE | Rust Nuremberg
North America
- 2023-07-27 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-08-10 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-08-15 | Seattle, WA, US | Seattle Rust User Group 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
(...) complexity in programming is just like energy in physics: it cannot be created, nor destroyed, but only transformed. So, if a programming language is simple and can only express very simple concepts, the complexity is going to move from the language constructs to your source code and vice versa. One needs to find a balance here, it's a personal choice based on mindset and experience.
Thanks to Arthur Rodrigues 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