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
Project/Tooling Updates
- rust-analyzer changelog #134
- Fornjot (code-first CAD in Rust) - Weekly Dev Log - 2022-W24
- Slint UI crate weekly updates
- This week in Databend #47: A Modern Cloud Data Warehouse for Everyone
- Postcard 1.0.0 Release
- mold 1.3.0
Observations/Thoughts
- That vendored OpenSSL 🦀 most of us rely on probably needs a patch ..
- GUI in Rust with iced #2: Composable Layout
- Remote development with Rust on fly.io
- NVIDIA GPU profiling with Rust
- Unsafe code highlighting with rust-analyzer
- When serde_json::to_string() fails
- Aeneas: Rust Verification by Functional Translation
- Rust: Turtles all the way down
- What is
Box<str>
and how is it different fromString
in Rust? - What it feels like when Rust saves your bacon
- Serde by Example 1: JSON-RPC
- [video] Adding a Rust compiler front end to GCC Philip Herron & Arthur Cohen, Embecosm
- [audio] This Week in Rust - Issue 445
- [audio] Fig with Grant Gurvis
- [audio] Building with Rust: Ernest Kissiedu on the DevX Initiative
Rust Walkthroughs
- Build a simple template engine in <100 lines of Rust code
- A short introduction to async Rust
- Nine rules for elegant Rust library APIs
- Automated maintenance and dependencies security for Rust projects
- [video] Async I/O in Depth (Part 3): Implementing an Async Runtime
- [video] Rust for Beginners -- Learning Rust Syntax faster with these Rustlings Tips
Crate of the Week
This week's crate is error-stack, a currently nightly-only error handling library that optimizes for ease of use while allowing to add arbitrary context data to errors.
Thanks to Alfred Mountfield 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 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.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
374 pull requests were merged in the last week
- add Apple WatchOS compile targets
- std support for the Nintendo 3DS
- make missing argument placeholder more obvious that it's a placeholder
- improve
lifetime arguments are not allowed on
error message - improve parser diagnostics
- improve parsing errors and suggestions for bad
if
statements - suggest adding a
#[macro_export]
to a private macro - hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown
- do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros
- fix suggestions for
&a: T
parameters - miri: prevent futex_wait from actually waiting if a concurrent waker was executed before us
- miri: add ICE error level
- fix
MissingDoc
quadratic behaviour - fix
SourceScope
forif let
bindings - make "Assemble stage1 compiler" orders of magnitude faster (take 2)
BitSet
related perf improvements- obligation forest tweaks
- batch
proc_macro
RPC forTokenStream
iteration and combination operations - compile
unicode-normalization
faster - use valtrees as the type-system representation for constant values
- make some lints incremental
- optimize heapsort
impl Termination for Infallible
and then make theResult
impls ofTermination
more genericStdio::makes_pipe
- implement
core::slice::IterMut::as_mut_slice
andimpl<T> AsMut<[T]> for IterMut<'_, T>
- add
core::mem::copy
to complementcore::mem::drop
- avoid
thread::panicking()
in non-poisoning methods ofMutex
andRwLock
- make {
Mutex
,Condvar
,RwLock
}::new()
const - add
#[inline]
to small fns of futexRwLock
- add {
Arc
,Rc
}::downcast_unchecked
- add
VecDeque::extend
fromTrustedLen
specialization BTreeMap
: Support custom allocators (v1.5)- use unchecked mul to compute slice sizes
- stabilize
try_reserve_2
- stabilize
io_safety
- stabilize
Path::try_exists()
and improve doc - const-stabilize checked slice →
str
conversion functions - hashbrown: Add an
Entry
API forHashSet
- hashbrown: allow compiling on 1.56.0
- codegen_gcc: more intrinsics
- clippy: add lint output to lint list
- clippy: fix false positive for
never_loop
struct expression fields - clippy: rework
branches_sharing_code
- clippy: warn about read into zero-length
Vec
- clippy: ignore
todo!
andunimplemented!
inif_same_then_else
- clippy: add
default_iter_empty
- clippy: unused_async: lint async methods
- rustfmt: add width for codeblocks in comments
- rust-analyzer: show proc-macro loading errors in unresolved-proc-macro diagnostics
- rust-analyzer: add fold range for multi line match arm list
- rust-analyzer: fix methods in pub trait generated by macro cannot be completed
- rust-analyzer: ask the user to reload the vscode window when changing server settings
- rust-analyzer: check for the correct proc-macro settings in missing proc-macro diagnostics
- rust-analyzer: clear proc-macro changed flag when reloading workspace
- rust-analyzer: don't trigger pattern completions when typing a wildcard pattern
Rust Compiler Performance Triage
A pretty busy week for performance, with quite a few PRs landing with significant improvements to specific benchmarks. Overall the week was positive, with many benchmarks improving at least a little. No significant changes in memory usage this week.
Triage done by @simulacrum. Revision range: edab34a..abace0a
5 Regressions, 6 Improvements, 3 Mixed; 1 of them in rollups 54 artifact comparisons made in total
See full report for details.
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.
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] Refined trait implementations
Tracking Issues & PRs
- [disposition: merge] Remove a back-compat hack on lazy TAIT
- [disposition: merge] allow unions with mutable references and tuples of allowed types
- [disposition: merge] make const_err show up in future breakage reports
New and Updated RFCs
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2022-06-22 - 2022-07-20 🦀
Virtual
- 2022-06-22 | Cardiff, UK | Rust and C++ Cardiff
- 2022-06-24 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 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
- 2022-07-07 | Charlottesville, VA, US | Charlottesville Rust Meetup
- 2022-07-09 | Virtual | Rust Game Dev
- 2022-07-13 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-07-14 | Nürnberg, DE | Rust Nurnberg DE
- 2022-07-14 | Stuttgart, DE | Rust Community Stuttgart
- 2022-07-16 | Vancouver, BC, CA | Vancouver Rust
- 2022-07-19 | Sydney, NSW, AU | Rust Australia
- 2022-07-19 | Washington, DC, US | Rust DC
Asia
- 2022-07-04 | Tel Aviv, IL | Rust TLV
Europe
- 2022-06-22 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2022-06-23 | Wrocław, PL | Rust Wrocław
- 2022-06-28 | London, UK | Rust London User Group
- 2022-06-29 | Nijmegen, NL | Rust Nederland
- 2022-06-30 | Copenhagen, DK | Copenhagen Rust Group
North America
- 2022-06-29 | Austin, TX, US | ATX Rustaceans
- 2022-06-29 | Austin, TX, US | Rust ATX
- 2022-07-13 | Atlanta, GA, US | Rust Atlanta
- 2022-07-14 | Columbus, IL | Columbus Rust Society
- 2022-07-19 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 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
Mutate
Matician
Lithic
Spire Global
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
Rwlock vs Mutex? Please, tell me like I'm 5
Mutex: "Mom says it's my turn on the synchronization primitive."
vs.
Write lock: "Hey! You all are not allowed to look until I'm done writing!" Read lock: "Hey! You are not allowed to edit what you wrote until we're done reading it!"
Thanks for an actual 5 year old reply, made me laugh
– /u/LyonSyonII and /u/everything-narrative on /r/rust
Thanks to Josh Triplett 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