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
- Announcing Rust 1.72.0
- Change in Guidance on Committing Lockfiles
- Cargo changes how arrays in config are merged
- Seeking help for initial Leadership Council initiatives
- Leadership Council Membership Changes
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #196
- The First Stable Release of a Memory Safe sudo Implementation
- We're open-sourcing the library that powers 1Password's ability to log in with a passkey
- ratatui 0.23.0 is released! (official successor of tui-rs)
- Zellij 0.38.0: session-manager, plugin infra, and no more offensive session names
Observations/Thoughts
- The fastest WebSocket implementation
- Rust Malware Staged on Crates.io
- ESP32 Standard Library Embedded Rust: SPI with the MAX7219 LED Dot Matrix
- A JVM in Rust part 5 - Executing instructions
- Compiling Rust for .NET, using only tea and stubbornness!
- Ad-hoc polymorphism erodes type-safety
- How to speed up the Rust compiler in August 2023
- This isn't the way to speed up Rust compile times
- Rust Cryptography Should be Written in Rust
- Dependency injection in Axum handlers. A quick tour
- Best Rust Web Frameworks to Use in 2023
- From tui-rs to Ratatui: 6 Months of Cooking Up Rust TUIs
- [video] Rust 1.72.0
- [video] Rust 1.72 Release Train
Rust Walkthroughs
- [series] Distributed Tracing in Rust, Episode 3: tracing basics
- Use Rust in shell scripts
- A Simple CRUD API in Rust with Cloudflare Workers, Cloudflare KV, and the Rust Router
- [video] base64 crate: code walkthrough
Miscellaneous
- Interview with Rust and operating system Developer Andy Python
- Leveraging Rust in our high-performance Java database
- Rust error message to fix a typo
- [video] The Builder Pattern and Typestate Programming - Stefan Baumgartner - Rust Linz January 2023
- [video] CI with Rust and Gitlab Selfhosting - Stefan Schindler - Rust Linz July 2023
Crate of the Week
This week's crate is dprint, a fast code formatter that formats Markdown, TypeScript, JavaScript, JSON, TOML and many other types natively via Wasm plugins.
Thanks to Martin Geisler 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.
- Hyperswitch - add domain type for client secret
- Hyperswitch - deserialization error exposes sensitive values in the logs
- Hyperswitch - move redis key creation to a common module
- mdbook-i18n-helpers - Write tool which can convert translated files back to PO
- mdbook-i18n-helpers - Package a language selector
- mdbook-i18n-helpers - Add links between translations
- Comprehensive Rust - Link to correct line when editing a translation
- Comprehensive Rust - Track the number of times the redirect pages are visited
- RustQuant - Jacobian and Hessian matrices support.
- RustQuant - improve Graphviz plotting of autodiff computational graphs.
- RustQuant - bond pricing implementation.
- RustQuant - implement cap/floor pricers.
- RustQuant - Implement Asian option pricers.
- RustQuant - Implement American option pricers.
- release-plz - add ability to mark Gitea/GitHub release as draft
- zerocopy - CI step "Set toolchain version" is flaky due to network timeouts
- zerocopy - Implement traits for tuple types (and maybe other container types?)
- zerocopy - Prevent panics statically
- zerocopy - Add positive and negative trait impl tests for SIMD types
- zerocopy - Inline many trait methods (in zerocopy and in derive-generated code)
- datatest-stable - Fix quadratic performance with nextest
- Ockam - Use a user-friendly name for the shared services to show it in the tray menu
- Ockam - Rename the Port to Address and support such format
- Ockam - Ockam CLI should gracefully handle invalid state when initializing
- css-inline - Update
cssparser
&selectors
- css-inline - Non-blocking stylesheet resolving
- css-inline - Optionally remove all
class
attributes
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
366 pull requests were merged in the last week
- reassign sparc-unknown-none-elf to tier 3
- wasi: round up the size for
aligned_alloc
- allow
MaybeUninit
in input and output of inline assembly - allow explicit
#[repr(Rust)]
- fix CFI: f32 and f64 are encoded incorrectly for cross-language CFI
- add
suggestion
for some#[deprecated]
items - add an (perma-)unstable option to disable vtable vptr
- add comment to the
push_trailing
function - add note when matching on tuples/ADTs containing non-exhaustive types
- add support for
ptr::write
s for theinvalid_reference_casting
lint - allow overwriting
ExpnId
for concurrent decoding - avoid duplicate
large_assignments
lints - contents of reachable statics is reachable
- do not emit invalid suggestion in E0191 when spans overlap
- do not forget to pass DWARF fragment information to LLVM
- ensure that THIR unsafety check is done before stealing it
- emit a proper diagnostic message for unstable lints passed from CLI
- fix races conditions with
SyntaxContext
decoding - fix waiting on a query that panicked
- improve note for the
invalid_reference_casting
lint - include compiler flags when you
break rust;
- load
include_bytes!
directly into an Lrc - make
Sharded
anenum
and specialize it for the single thread case - make
rustc_on_unimplemented
std-agnostic foralloc::rc
- more precisely detect cycle errors from
type_of
on opaque - point at type parameter that introduced unmet bound instead of full HIR node
- record allocation spans inside
force_allocation
- suggest mutable borrow on read only for-loop that should be mutable
- tweak output of
to_pretty_impl_header
involving only anon lifetimes - use the same DISubprogram for each instance of the same inlined function within a caller
- walk through full path in
point_at_path_if_possible
- warn on elided lifetimes in associated constants (
ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT
) - make RPITITs capture all in-scope lifetimes
- add stable for Constant in smir
- add
generics_of
to smir - add smir
predicates_of
- treat
StatementKind::Coverage
as completely opaque for SMIR purposes - do not convert copies of packed projections to moves
- don't do intra-pass validation on MIR shims
- MIR validation: reject in-place argument/return for packed fields
- disable MIR SROA optimization by default
- miri: automatically start and stop josh in rustc-pull/push
- miri: fix some bad regex capture group references in test normalization
- stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen
- resolve: stop creating
NameBinding
s on every use, create them once per definition instead - fix a
pthread_t
handle leak - when terminating during unwinding, show the reason why
- avoid triple-backtrace due to panic-during-cleanup
- add additional float constants
- add ability to spawn Windows process with Proc Thread Attributes | Take 2
- fix implementation of
Duration::checked_div
- hashbrown: allow serializing
HashMap
s that use a custom allocator - hashbrown: change
&
to&mut
where applicable - hashbrown: simplify
Clone
by removing redundant guards - regex-automata: fix incorrect use of Aho-Corasick's "standard" semantics
- cargo: Very preliminary MSRV resolver support
- cargo: Use a more compact relative-time format
- cargo: Improve TOML parse errors
- cargo: add support for
target.'cfg(..)'.linker
- cargo: config: merge lists in precedence order
- cargo: create dedicated unstable flag for asymmetric-token
- cargo: set MSRV for internal packages
- cargo: improve deserialization errors of untagged enums
- cargo: improve resolver version mismatch warning
- cargo: stabilize
--keep-going
- cargo: support dependencies from registries for artifact dependencies, take 2
- cargo: use AND search when having multiple terms
- rustdoc: add unstable
--no-html-source
flag - rustdoc: rename typedef to type alias
- rustdoc: use unicode-aware checks for redundant explicit link fastpath
- clippy: new lint:
implied_bounds_in_impls
- clippy: new lint:
reserve_after_initialization
- clippy:
arithmetic_side_effects
: detect division by zero forWrapping
andSaturating
- clippy:
if_then_some_else_none
: look into local initializers for early returns - clippy:
iter_overeager_cloned
: detect.cloned().all()
and.cloned().any()
- clippy:
unnecessary_unwrap
: lint on.as_ref().unwrap()
- clippy: allow trait alias DefIds in
implements_trait_with_env_from_iter
- clippy: fix
"derivable_impls
: attributes are ignored" - clippy: fix
tuple_array_conversions
lint on nightly - clippy: skip
float_cmp
check if lhs is a custom type - rust-analyzer: diagnostics for 'while let' loop with label in condition
- rust-analyzer: respect
#[allow(unused_braces)]
Rust Compiler Performance Triage
A fairly quiet week, with improvements exceeding a small scattering of regressions. Memory usage and artifact size held fairly steady across the week, with no regressions or improvements.
Triage done by @simulacrum. Revision range: d4a881e..cedbe5c
2 Regressions, 3 Improvements, 2 Mixed; 0 of them in rollups 108 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
- [disposition: merge] Stabilize
PATH
option for--print KIND=PATH
- [disposition: merge] Add alignment to the NPO guarantee
New and Updated RFCs
- [new] Special-cased performance improvement for
Iterator::sum
onRange<u*>
andRangeInclusive<u*>
- [new] Cargo Check T-lang Policy
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-08-30 - 2023-09-27 🦀
Virtual
- 2023-09-05 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-09-05 | Virtual (Munich, DE) | Rust Munich
- 2023-09-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-09-12 - 2023-09-15 | Virtual (Albuquerque, NM, US) | RustConf
- 2023-09-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-09-13 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-09-13 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-09-14 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-09-20 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-09-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-09-21 | Lehi, UT, US | Utah Rust
- 2023-09-21 | Virtual (Linz, AT) | Rust Linz
- 2023-09-25 | Virtual (Dublin, IE) | Rust Dublin
Asia
- 2023-09-06 | Tel Aviv, IL | Rust TLV
Europe
- 2023-08-30 | Copenhagen, DK | Copenhagen Rust Community
- 2023-08-31 | Augsburg, DE | Rust Meetup Augsburg
- 2023-09-05 | Munich, DE + Virtual | Rust Munich
- 2023-09-14 | Reading, UK | Reading Rust Workshop
- 2023-09-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2023-09-20 | Aarhus, DK | Rust Aarhus
- 2023-09-21 | Bern, CH | Rust Bern
North America
- 2023-09-05 | Chicago, IL, US | Deep Dish Rust
- 2023-09-06 | Bellevue, WA, US | The Linux Foundation
- 2023-09-12 - 2023-09-15 | Albuquerque, NM, US + Virtual | RustConf
- 2023-09-12 | New York, NY, US | Rust NYC
- 2023-09-12 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2023-09-14 | Seattle, WA, US | Seattle Rust User Group Meetup
- 2023-09-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-09-21 | Nashville, TN, US | Music City Rust Developers
- 2023-09-26 | Pasadena, CA, US | Pasadena Thursday Go/Rust
- 2023-09-27 | Austin, TX, US | Rust ATX
Oceania
- 2023-09-13 | Perth, WA, AU | Rust Perth
- 2023-09-19 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-09-26 | Canberra, ACT, AU | Rust Canberra
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 [other languages], I could end up chasing silly bugs and waste time debugging and tracing to find that I made a typo or ran into a language quirk that gave me an unexpected nil pointer. That situation is almost non-existent in Rust, it's just me and the problem. Rust is honest and upfront about its quirks and will yell at you about it before you have a hard to find bug in production.
Thanks to Kyle Strand 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