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? Tweet us at @ThisWeekInRust 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
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #132
- This week in Databend #44: A Modern Cloud Data Warehouse for Everyone
- This week in Databend #45: A Modern Cloud Data Warehouse for Everyone
- Slint UI crate weekly updates
- This week in Fluvio #35: the programmable streaming platform
- Fornjot (code-first CAD in Rust) - Weekly Dev Log - 2022-W22
- GCC Rust Monthly Report #17 May 2022
- Zellij 0.30.0: use your $EDITOR to search and save your scrollback
Observations/Thoughts
- Stacked Futures and why they are impossible
- Rust Is Hard, Or: The Misery of Mainstream Programming
- Trivia About Rust Types: An (Authorized) Transcription of Jon Gjengset’s Twitter Thread
- Hyper vs Rocket - Low Level vs Batteries included
- (async) Rust doesn't have to be hard
- Rust language’s explosive popularity comes with challenges
- [audio] egui with Emil Ernerfeldt
Rust Walkthroughs
- Introduction to Rust generics (2/2): Trait Objects - Static vs Dynamic dispatch
- Beginner-Intermediate Errror Handling in Rust
- Macro Patterns - A match made in heaven
- Using the Kani Rust Verifier on a Rust Standard Library CVE
- The entrait pattern
- Web Scraping with Rust
- Logan Keenan - A Rust Server App Compiled to WASM as an SPA
- [video] Async I/O in Depth: Creating a High Performance HTTP Web Server in Rust (Part 1)
- [video] Stream Ingestion with Kafka & Kinesis
- [video] is salvo really the simplest rust web framework?
- [video] Rust wgpu Graphics Programming Tutorial
Research
Miscellaneous
Crate of the Week
This week's crate is osmpbf an OpenStreetMap pbf-file reader.
Thanks to Kornel for the suggestion.
Please submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but didn't 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.
- mirrord - Handle Job/Pod creation errors in mirrord-layer
- mirrord - mirrord-layer panics without any relevant info if the agent exits
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
385 pull requests were merged in the last week
- support the
#[expect]
attribute on fn parameters (RFC #2383) - tighten spans for bad fields in struct deriving
Copy
- add a suggestion to replace parentheses with angle brackets on associated trait constraint
- diagnose anonymous lifetimes errors more uniformly between async and regular fns
- do not ICE when failing to normalize during inlining
- fail gracefully when encountering an HRTB in APIT
- fix reachability analysis for const methods
- fix wrong suggestion for adding where clauses
- suggest
extern crate foo
when failing to resolveuse foo
- suggest adding
{}
for'label: non_block_expr
- suggest adding a semicolon to a closure without block
- suggest
?
when method is missing onResult<T, _>
but found onT
- use strict provenance APIs
- provide more context when denying invalid type params
- optimize the diagnostic generation for
extern unsafe
- improve soundness of
rustc_data_structures
- on E0204 suggest missing type param bounds
- interpret: better control over whether we read data with provenance
- miri: add support for
_COARSE
clocks - miri: save a created event for zero-size reborrows
- miri: weak memory emulation using store buffers
- miri: adjust for better provenance control
- miri: make Miri's scheduler proper round-robin
- iterate over
maybe_unused_trait_imports
when checking dead trait imports - inline
bridge::Buffer
methods - lazify
SourceFile::lines
- lazily allocate and initialize pthread locks
- add windows application manifest to rustc-main
- Implement faster memcmp for x86_64
- inline
Vec
'sDeref/DerefMut
- add unicode fast path to
is_printable
- additional
*mut [T]
methods - expose
get_many_mut
andget_many_unchecked_mut
toHashMap
- implement
[OsStr]::join
- make
from{,_mut}_ptr_range
const - stabilize
box_into_pin
- stabilize
toowned_clone_into
- stabilize {slice, array}
::from_ref
- hashbrown: add shortcircuit in iteration if we yielded all elements
- futures: fix orderings in
LocalPool
waker - futures: switch to
FuturesOrdered
dynamically intry_join_all
- futures: stream: fix
Chunk
adapters size hints - cargo: emit warning upon encountering multiple packages with the same name
- cargo: expose rust-version through env var
- rustdoc: improve calculation of "Impls on Foreign Types"
- rustdoc: also index impl trait and raw pointers
- rustdoc: avoid including impl blocks with filled-in generics
- clippy: clippy book
- clippy: add lint
almost_complete_letter_range
- clippy: add lint
needless_parens_on_range_literals
- clippy: add lint
mismatching_type_param_order
- clippy: new lint
swap_ptr_to_ref
- clippy: new lint:
borrow_deref_ref
- clippy: add
as_underscore
lint - clippy: improve
for_loops_over_fallibles
to detect the usage of iter, iter_mut and into_iterator - clippy: fix
use_self
false negative with on struct and tuple struct patterns - clippy: fix
manual_range_contains
false negative with chains of&&
and||
- clippy: when setting suggestion for significant_drop_in_scrutinee, add suggestion for MoveAndClone for non-ref
- clippy:
needless_return
checks for macro expr in return stmts - clippy: don't lint
useless_transmute
on types with erased regions - clippy:
cast_abs_to_unsigned
: do not remove cast if it's required - clippy: remove
large_enum_variant
suggestion forCopy
types - clippy: fix
manual_find_map
andmanual_filter_map
: check clone method - clippy: fix ICE in shadow lints
- clippy: needless_late_init: fix ICE when all branches return the never type
- clippy: set correct
ParamEnv
forderive_partial_eq_without_eq
- rust-analyzer: increase worker thread stack and name them
- rust-analyzer: move trait_impl completion analysis into CompletionContext
- rust-analyzer: order auto-imports by relevance
- rust-analyzer: cleaer status bar bg color / command when server status returns to OK
- rust-analyzer: support
$$
in macros - rust-analyzer:
Merge imports
assist can merge multiple selected imports - rust-analyzer: don't remove diagnostic with empty message
- rust-analyzer: resolving import panics and improve import resolution
- rust-analyzer: type-mismatch when using equals w/ a trait bound
- rust-analyzer: cleanup output channels when restarting server
- rust-analyzer: fix VSCode config patching incorrectly patching some configs
- rust-analyzer: fix completions disappearing when typing two keys in quick succession
- rust-analyzer: fix match to if let assist for wildcard pats
- rust-analyzer: fix trait impl completions using wrong insert position
- rust-analyzer: restart the server instead of reloading the window when config changes
- rust-analyzer: float display impl
- rust-analyzer: parsing of
?
opt-out trait bounds
Rust Compiler Performance Triage
A busy week in compiler performance, but fortunately improvements outweighed regressions. The biggest improvements came from @nnethercote's work on making the decoding of SourceFile::lines
lazy which significantly cuts the costs of decoding crate metadata. The biggest regressions came from the removal of json handling in rustc_serialize
which has been a multi-month effort to improve the maintainability of json (de-)serialization in the compiler.
Triage done by @rylev. Revision range: 0a43923a..bb55bd
Summary:
mean | max | count | |
---|---|---|---|
Regressions 😿 (primary) |
0.5% | 3.2% | 36 |
Regressions 😿 (secondary) |
0.3% | 0.9% | 15 |
Improvements 🎉 (primary) |
-1.3% | -15.1% | 124 |
Improvements 🎉 (secondary) |
-2.7% | -13.5% | 182 |
All 😿🎉 (primary) | -0.9% | -15.1% | 160 |
2 Regression, 6 Improvements, 5 Mixed; 4 of them in rollups 48 artifact comparisons made in total
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:
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.
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
Tracking Issues & PRs
- [disposition: merge] Make {Mutex, Condvar, RwLock}::new() const.
- [disposition: merge] Make std::mem::needs_drop accept ?Sized
- [disposition: merge] Tracking Issue for scoped threads
New and Updated RFCs
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2022-06-08 - 2022-07-06 🦀
Virtual
- 2022-06-08 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-06-08 | Cardiff, UK | Rust and C++ Cardiff
- 2022-06-09 | Dublin, IE | Rust Dublin
- 2022-06-09 | Nürnberg, DE | Rust Nurnberg DE
- 2022-06-09 | San Diego, CA, US | San Diego Rust
- 2022-06-09 | Stuttgart, DE | Rust Community Stuttgart
- 2022-06-11 | Online | Rust Gamedev
- 2022-06-14 | Dallas, TX, US | Dallas Rust
- 2022-06-14 | Rostock, DE | Altow Academy
- 2022-06-14 | Saarbrücken, DE | Rust-Saar
- 2022-06-15 | Philadelphia, PA, US | Rust Philly (Rust Philadelphia)
- 2022-06-15 | Vancouver, BC, CA | Vancouver Rust
- 2022-06-21 | Washington, DC, US | Rust DC
- 2022-06-28 | Dallas, TX, US | Dallas Rust
- 2022-06-29 | Stuttgart, DE | Rust Community Stuttgart
- 2022-06-30 | Linz, AT | Rust Linz
- 2022-07-05 | Austin, TX, US | WebAssembly and WasmEdge
- 2022-07-05 | Beijing, CN | WebAssembly and Rust Meetup (Rustlang)
- 2022-07-05 | Buffalo, NY, US | Buffalo Rust Meetup
- 2022-07-06 | Indianapolis, IN, US | Indy Rust
North America
- 2022-06-08 | Atlanta, GA, US | Rust ATL
- 2022-06-09 | Columbus, OH, US | Columbus Rust Society
- 2022-06-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2022-06-29 | Austin, TX, US | ATX Rustaceans
Europe
- 2022-06-09 | Edinburgh, UK | Rust Edinburgh
- 2022-06-09 | Oslo, NO | Rust Oslo
- 2022-06-14 | Stuttgart, DE | Rust Community Stuttgart
- 2022-06-16 | Bristol City, UK | Rust Bristol
- 2022-06-21 | Oslo, NO | Rust Oslo
- 2022-06-22 | Amsterdam, NL | Rust Developers Amsterdam Group
Oceania
- 2022-06-14 | Canberra, ACT, AU | Rust Canberra
- 2022-06-17 | Melbourne, VIC, AU | Rust Melbourne
- 2022-06-23 | Brisbane, QLD, AU | Rust Brisbane
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.
Rust Jobs
Spire Global
Meilisearch
Stockly
Nikulipe
GMEX Group
Enso
Kraken
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
I wrote a bespoke time-series database in Rust a few years ago, and it has had exactly one issue since I stood it up in production, and that was due to pessimistic filesystem access patterns, rather than the language. This thing is handling hundreds of thousands of inserts per second, and it's even threaded.
Given that I've been programming professionally for over a decade in Python, Perl, Ruby, C, C++, Javascript, Java, and Rust, I'll pick Rust absolutely any time that I want something running that I won't get called at 3 AM to fix. It probably took me 5 times as long to write it as if I did it in Go or Python, but I guarantee it's saved me 10 times as much time I would have otherwise spent triaging, debugging, and running disaster recovery.
Thanks to Erich Gubler 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.
Email list hosting is sponsored by The Rust Foundation