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
- rumqttd now supports MQTTv5 features like topic alias and message expiry
- GlueSQL v0.14 - Schemaless data support
- ratatui 0.21.0 is released! (community fork of tui-rs)
- rust-analyzer Changelog #183
- IntelliJ Rust Changelog #195
- rustc_codegen_gcc: Progress Report #23
- Statement on RustConf & Introspection
Observations/Thoughts
- Paired benchmarking. How to measure performance
- Pattern Extensions
- A governance system, if you can keep it
- [video] Why You Shouldn’t Build Your Next App in Rust
Rust Walkthroughs
- How I finally understood async/await in Rust (part 1)
- Serving dynamic social preview images with rust and serverless functions
- Phase Locked State Machines
- ESP32 Embedded Rust at the HAL: Analog Temperature Sensing using the ADC
- [video] Atomics and Locks Book Club - Chapter 1 - Basics of Rust Concurrency
- [video] Atomics and Locks Book Club - Chapter 2 - Atomics
- [video] Deploy Rust with shuttle.rs
- [video] Building WASM web UI with Rust
- [video] A Practical Introduction to Derive Macros with Attributes
- [video] Building an HTTP Server in Rust: Exploring TCP/IP, Socket Programming, and Asynchronous I/O
- [video] Run Fast! Catch Performance Regressions in eBPF with Rust
- [video] Building a Weather Forecast Command-Line App in Rust
Miscellaneous
- I Am No Longer Speaking at RustConf 2023
- Josh Triplett's Statement on RustConf 2023
- Why I left Rust
- How s2n-quic uses Kani to inspire confidence
Crate of the Week
This week's crate is progenitor, an OpenAPI client generator with support for strongly typed mock tests.
Thanks to John Vandenberg 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 - Define the Mapping between
ConnectorError
andApiErrorResponse
using theErrorSwitch
trait - Hyperswitch - Remove redundant call to fetch payment method data
- Hyperswitch - Remove redundant heap allocation (specifically string construction) in the application
- Hyperswitch - Remove redundant heap allocation present in the logging framework
- Ockam - Don't show a secure channel listener if it does not exist 2
- Ockam -
ockam secure-channel-listener list --node n1
is inconsistent 2 - Ockam - Do not print that a secure channel listener was successfully deleted when it is not the case 2
- Ockam -
tcp-connection show
command should iter all the available nodes to find the requested ID - Ockam - Define json output for
ockam node create
- send-file - create WiFi hotspot on Linux Operating system 1
- send-file - read the device default documents directory and return an array of documents files path 1
- velo - Implement Copy and Paste Functionality for
bevy_cosmic_edit
- Issue #128 - StaffEngineer/velo - GitHub 2 - velo - Fix text height calculation for proper text alignment - Issue #131 - StaffEngineer/velo - GitHub 1
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
325 pull requests were merged in the last week
- promote loongarch64-unknown-linux-gnu to Tier 2 with host tools
- enable sanitizers and profiler for aarch64-unknown-linux-musl
- add support for LLVM SafeStack
- Expand more expressions (RFC #2011)
- parse: return unpected when current token is EOF
- resolve: not defined
extern crate shadow_name
rustc_privacy
: Cleanups and perf improvements toEmbargoVisitor
- add warn-by-default lint when local binding shadows exported glob re-export item
- always require closure parameters to be
Sized
- check opaques for mismatch during writeback
- consider lint check attributes on match arms
- deal with unnormalized projections when structurally resolving types with new solver
- do not prefer substs relate during coherence
- don't ICE if method receiver fails to unify with
arbitrary_self_types
- don't ICE on return-type notation when promoting trait preds to associated type bounds
- don't ICE when computing PointerLike trait when region vars are in param-env
- don't check for misaligned raw pointer derefs inside
Rvalue::AddressOf
- don't skip mir typeck if body has errors
- enable
MatchBranchSimplification
- expose more information in
get_body_with_borrowck_facts
- fix for
Self
not respecting tuple Ctor privacy - fix re-export of doc hidden macro not showing up
- fix some issues with folded AArch64 features
- fix symbol conflict diagnostic mistakenly being shown instead of missing crate diagnostic
- handle opaques in the new solver
- improve error message for calling a method on a raw pointer with an unknown pointee
- inline derived
hash
- leverage the interval property to precompute borrow kill points
- libtest: improve error when missing
-Zunstable-options
- perform MIR type ops locally in new solver
- preprocess and cache dominator tree
- pretty-print inherent projections correctly
- prevent crash when a path is not resolved in intra-doc link
- rework handling of recursive panics
- split out opaque collection from from
type_of
- stop confusing specification levels when computing expectations
- use
ErrorGuaranteed
more in MIR type ops - MIR: opt-in normalization of
BasicBlock
andLocal
numbering - support
#[global_allocator]
without the allocator shim - stabilize
BuildHasher::hash_one
- use an unbounded lifetime in
String::leak
- add Median of Medians fallback to introselect
- add
#[inline]
to array TryFrom impls - add
slice::
{split_
, }{first
,last
}_chunk
{,_mut
} - stdarch: stabilize AArch64 AES/SHA1/SHA2 intrinsics
- regex: fix complete literal optimization issue
- cargo: add: Reduce the chance we re-format the user's
[features]
table - cargo: lints: Switch to -Zlints so stable projects can experiment
- cargo: add a description of
Cargo.lock
conflicts in the Cargo FAQ - cargo: automatically inherit workspace fields when running cargo new/init
- cargo: automatically inherit workspace lints when running cargo new/init
- cargo: consider rust-version when selecting packages for cargo add
- cargo: deps: remove unused features from windows-sys
- cargo: warn when an edition 2021 crate is in a virtual workspace with default resolver
- rustdoc: get unnormalized link destination for suggestions
- rustdoc-json: Use exclusively externally tagged enums in the JSON representation
- new tool
rustdoc-gui-test
- clippy:
default_constructed_unit_structs
: do not lint on type alias paths - clippy:
large_stack_arrays
: check array initializer expressions - clippy: add
needless_else
lint to check for emptyelse
clauses - clippy:
unused_async
: do not considerawait
in nestedasync
blocks as used - clippy: add new lint
ptr_cast_constness
- clippy: display the
needless_return
suggestion - clippy: fix
redundant_pattern_match
on matches! macro - clippy: fix missing block for unsafe code
- clippy: fixing
invalid_regex
with invalid UTF8. Also, adding more test cases - clippy: ignore
#[cfg]
'd out code inneedless_else
- clippy: improve pattern printing for
manual_let_else
- rust-analyzer: editors/code: add markdown syntax highlighting to doc comments
- rust-analyzer: allow users to override the .scip output file path
- rust-analyzer: add diagnostic for incorrect
_
expressions (typed holes) - rust-analyzer: assist to replace generic with impl trait
- rust-analyzer: using doc aliases to search workspace symbols
- rust-analyzer: fix
need-mut
false positive in closure capture of match scrutinee - rust-analyzer: add a toggle to disable the dependency explorer
- rust-analyzer: assists no longer break indentation
- rust-analyzer: change how
#![cfg(FALSE)]
behaves on crate root - rust-analyzer: don't try determining type of token inside macro calls
- rust-analyzer: evaluate
UnevaluatedConst
in unify - rust-analyzer: evaluate
UnevaluatedConst
before trait solving - rust-analyzer: filter out unused cargo features from config
- rust-analyzer: insert type vars in function arguments
- rust-analyzer: use
::core
instead of$crate
inoption_env!
- rust-analyzer: implement
${count()}
metavariable expression
Rust Compiler Performance Triage
A good week overall, with a broad set of improvements to many primary benchmarks. The main single source of primary regressions is from rollup PR #111869; we are in the process of narrowing that down to see if there is a root cause.
Triage done by @pnkfelix. Revision range: cda5becc..1221e43b
3 Regressions, 3 Improvements, 3 Mixed; 4 of them in rollups 26 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
- [disposition: merge] Return position
impl Trait
in traits - [disposition: merge] eRFC: single-file packages ("cargo script") integration
Tracking Issues & PRs
- [disposition: merge] rustdoc: search for slices and arrays by type with
[]
- [disposition: close] dyn Trait comparison should not include the vtable pointer
- [disposition: merge] Uplift
clippy::fn_null_check
lint - [disposition: merge] Uplift
clippy::cmp_nan
lint - [disposition: merge] rustdoc: Add search result item types after their name
New and Updated RFCs
- [new] Unsafe Extern Blocks
- [new] RFC: Implementable trait aliases
- [new] RFC:
#[export]
(dynamically linked crates) - [new] Generic Futures
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:
- Add a
[lints]
table to Cargo.toml (Feature:manifest-lint
)
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-31 - 2023-06-28 🦀
Virtual
- 2023-05-31 | Virtual (Chicago, IL, US) | Chicago Healthcare Cloud Technology Community
- 2023-06-06 | Virtual (Austin, TX, US) | WebAssembly and WasmEdge
- 2023-06-06 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-06-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-06-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-06-07 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-06-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-06-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-06-14 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-06-14 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-06-15 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-06-20 | Virtual (Berlin, DE) | Berline.rs / OpenTechSchool Berlin
- 2023-06-20 | Virtual (Washington, DC, US) | Rust DC
- 2023-06-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-06-25 | Virtual (Auckland, NZ) | ResBaz Aotearoa 2023
- 2023-06-27 | Virtual (Dallas, TX, US) | Dallas Rust
Asia
- 2023-06-10 | Kuala Lumpur, MY | GoLang Malaysia
Europe
- 2023-06-03 | Plovidv, BG | AeroRust
- 2023-06-04 | Plovidv, BG | AeroRust
- 2023-06-08 | Aarhus, DK | Rust Aarhus
- 2023-06-08 | Paris, FR | Stockly.ai
- 2023-06-08 | Zurich, CH | Rust Zurich
- 2023-06-16 | Stuttgart, DE | Rust Community Stuttgart
- 2023-06-28 | Bratislava, SK | Bratislava Rust Meetup Group
North America
- 2023-06-01 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-06-01 | Pasadena, CA, US | Pasadena Thursday Go / Rust
- 2023-06-07 | Austin, TX, US | Rust ATX
- 2023-06-08 | Lehi, UT, US | Utah Rust
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
Panics are overgrown ASSERTs, not an underbuilt exception system.
– Stephan Sokolow on hacker news
Thanks to Stephan Sokolow for the self-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