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
Foundation
- Welcoming Software Engineer Tobias Bieniek to the Rust Foundation Team
- Q1 2023 Recap from Rebecca Rumbul
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #179
- git-cliff 1.2.0 released (Highly Customizable Changelog Generator)
- Fornjot (code-first CAD in Rust) - Weekly Release - Inching Along
- Going beyond build.rs: introducing cargo-px
Observations/Thoughts
- A Mirror for Rust: Compile-Time Reflection Report
- Some thoughts on open collaboration
- The case for stabilizing arbitrary_self_types
- Report on Surprise hyper CVE from 2023-04-11
- [video] Frontend in Rust with Yew and WebAssembly: Intro and Review
- [video] Rust Data Modelling WITHOUT OOP
- [video] Introduction to Rust programming on bare metal hardware by Mike Kefeder
- [video] Writing Performant Concurrent Data Structures by Adrian Alic
- [video] sett: data encryption and transfer made easy(ier) by Jaroslaw Surkont, Christian Ribeaud
- [video] N-Queens Puzzle (PART 1)
- [ES] [video] 01 Taller de Rust (lenguaje) en español
- [audio] SurrealDB with Tobie and Jamie Morgan
- [audio] Rust Embedded WG with Jonathan Pallant
- dev-dependencies and Rust's unused_crate_dependencies lint
Rust Walkthroughs
- Efficient indexing with Quickwit Rust actor framework
- Writing Code with ChatGPT? Improve it with Kani
- Fast(er) binary search in Rust
- Rust allows redeclaring local variables to great benefit
- Build a Rust API with Rocket, Diesel, and MySQL
- Fun and Hackable Tensors in Rust, From Scratch
- Learning Game Dev - Building a platformer with Bevy #1
- How does async Rust work
- 50 Shades of Rust, or emerging Rust GUIs in a WASM world
- ESP32 Embedded Rust at the HAL: Button-Controlled Blinking by Timer Polling
- Write code using async/await in Rust
- What is HyperLogLog and how to build yours in Rust
Research
Miscellaneous
Crate of the Week
This week's crate is script-macro, an experimental way of writing simple proc-macros inline.
Thanks you to Markus Unterwaditzer for the 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 - Fix panic case on
RedisPoolConnection
close - Hyperswitch - Use proxy exclusion instead of a separate proxied client
- Hyperswitch - replace manual implementation using
from_str
function of strum - Ockam -
#[ockam::node]
macro doesn't handle returned errors 1 - Ockam - Update CLI documentation for
identity
commands 2 - Ockam - Add some regression tests for output files: identity, credential, etc...
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Calls for Proposals
Open calls for submissions to conferences and meetups.
If you are an event organizer and would like to have your Call for Proposals listed here, please submit a PR.
Updates from the Rust Project
390 pull requests were merged in the last week
- add loongarch64 asm! support
- clear response values for overflow in new solver
- consider polarity in new solver
- do not resolve anonymous lifetimes in consts to be static
- fix an ICE in conflict error diagnostics
- improve error notes for packed
struct
reference diagnostic - improve niche placement by trying two strategies and picking the better result
- include source error for LoadLibraryExW
- lower
intrinsics::offset
tomir::BinOp::Offset
- make sure that some stdlib method signatures aren't accidental refinements
- only cache typeck results if it's the typeck root
- provide better type hints when a type doesn't support a binary operator
- remove
QueryEngine
trait - remove inline const deadcode in typeck
- rewrite MemDecoder around pointers not a slice
- share
BinOp::Offset
between CTFE and Miri - sprinkle some
#[inline]
inrustc_data_structures::tagged_ptr
- suggest deref on comparison binop RHS even if type is not Copy
- use MIR's
Offset
for pointeradd
too - use
?0
notation for ty/ct/int/float/region vars - miri: fix endianess handling in
eventfd::write
- miri: hide backtrace from stderr files
- miri: tree Borrows: improved diagnostics
- fix
std
compilation error for wasi+atomics - make
mem::replace
simpler in codegen - add
LazyCell::into_inner
- add shortcut for Grisu3 algorithm
- loosen
From<&[T]> for Box<[T]>
bound toT: Clone
- add support for allocators in
LinkedList
- hashbrown: remove lifetime on
RawIterHash
, for more flexibility & to matchRawIter
- cargo: add
-Zmsrv-policy
feature flag - cargo: apply
[env]
to target info discovery rustc - cargo: warn instead of error in
cargo package
on emptyreadme
orlicense-file
in manifest - rustdoc: add a new lint for broken inline code
- rustdoc: catch and don't blow up on impl Trait cycles
- clippy: new lint:
manual_while_let_some
- clippy: add configuration for
semicolon_block
lints - clippy: don't apply
string_lit_as_bytes
if in macro expansion - clippy: fix
items_after_test_module
: Ignore imported modules - rust-analyzer: add hover for closures
- rust-analyzer: deduplicate crates when extending crate graphs
- rust-analyzer: don't wavy-underline iterator chains
- rust-analyzer: fix proc-macro-srv path config not working
- rust-analyzer: fix restart server button trying to start instead of restart the server
- rust-analyzer: fix status command panicking when additional LRU caches are set up
- rust-analyzer: fix vscode workspaces not working properly
- rust-analyzer: force InitializeParams windows path drives to uppercase
- rust-analyzer: handle nested types in
unwrap_result_return_type
assist - rust-analyzer: handle dev-dependency cycles
- rust-analyzer: remove proc-macro server command from the rust-analyzer binary
Rust Compiler Performance Triage
This week the good outweighed the bad. In particular, we had three different PRs that made improvements to a wide range of benchmarks. Special call out to PR #111026, which yielded 3% to 8% improvement for incremental compile times on a large set of benchmarks, by avoiding unnecessary caching in the type checker.
Triage done by @pnkfelix. Revision range: fdeef3ed..a368898d
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
- [disposition: merge] Add a
[lints]
table toCargo.toml
Tracking Issues & PRs
- [disposition: merge] Tracking Issue for negation methods on
NonZeroI*
- [disposition: merge] Tracking Issue for CStr::is_empty
Approved Major Change Proposals (MCP)
- [major change accepted] Integrate Enzyme into nightly rustc
New and Updated RFCs
- [new] RFC: Partial Mutability
- [new] RFC: Partial Types (v2)
- [new] Return position impl Trait in traits
- [new] eRFC: single-file packages ("cargo script") integration
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-05-03 - 2023-05-31 🦀
Virtual
- 2023-05-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-05-03 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-05-04 | Virtual (Raleigh, NC, US) | Triangle BitDevs
- 2023-05-06 | Virtual + In person (Singapore, SG) | Web3Dev.Community
- 2023-05-08 | Virtual + In person (Melbourne, VIC, AU) | Rust Melbourne
- 2023-05-09 | Virtual (Berlin, DE) | Open Tech School Berlin | Berline.rs
- 2023-05-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-05-10 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-05-11 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-05-13 | Virtual | Rust GameDev
- 2023-05-13 | Virtual + In person (Singapore, SG) | Web3Dev.Community
- 2023-05-16 | Virtual (Washington, DC, US) | Rust DC
- 2023-05-17 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-05-17 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-05-18 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-05-20 | Virtual + In person (Singapore, SG) | Web3Dev.Community
- 2023-05-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-05-31 | Virtual (Chicago, IL, US) | Chicago Healthcare Cloud Technology Community
Asia
- 2023-05-06 | Kyoto, JP | Kansai Rust
- Rust Talk: Vec, arrays, and slices
- 2023-05-06 | Singapore, SG | Web3Dev.Community
- 2023-05-13 | Singapore, SG | Web3Dev.Community
- 2023-05-20 | Singapore, SG | Web3Dev.Community
Europe
- 2023-05-10 | Amsterdam, NL | RustNL
- 2023-05-19 | Stuttgart, DE | Rust Community Stuttgart
- 2023-05-23 | Paris, FR | Kaïbee
- 2023-05-25 | Paris, FR | Rust Paris
North America
- 2023-05-03 | Austin, TX, US | Rust ATX
- 2023-05-04 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-05-11 | Lehi, UT, US | Utah Rust
- 2023-05-16 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-05-03 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-05-08 | Melbourne, VIC, AU | Rust Melbourne
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
Since it hasn't been said before, there is an important distinction that needs to be addressed. For anyone who has been doing embedded work for any length of time and hasn't yet been exposed to Rust, the only thing that can really be said is that the language is entirely unlike everything you've experienced before. There is just nothing comparable, and the only way to rationalize questions like why use Rust at all is to put some honest effort into learning and using it.
Hearing things like "it's a bit like C++ except it's memory safe and thread safe, and it's actually practical to build kernels with it" will not sound convincing. You have to see it to believe it.
It's as if you've spent an entire career writing assembly, and one day you hear something or other about a brand-new programming language claiming to be a "portable assembler" called C. It sounds too good to be true. And then the years pass, and all of the mystery and disbelief gives way to obviousness and precision engineering. That's sort of how it is when going from C to Rust.
Thanks to Michael Bryan 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