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
FOSDEM 2023
- [video] Building an actor library for Quickwit's indexing pipeline
- [video] Building a distributed search engine with tantivy
- [video] Aurae: Distributed Runtime
- [video] BastionLab, a Rust open-source privacy framework for confidential data science collaboration
- [video] Neovim and rust-analyzer are best friends
- [video] A Rusty CHERI - The path to hardware capabilities in Rust
- [video] Slint: Are we GUI yet?
- [video] Rust API Design Learnings
- [video] A deep dive inside the Rust frontend for GCC
- [video] Merging process of the rust compiler
- [video] Let's write Snake game!
- [video] Glidesort
- [video] How Pydantic V2 leverages Rust's Superpowers
- [video] Scalable graph algorithms in Rust (and Python)
- [video] Using Rust for your network management tools!
- [video] Backward and forward compatibility for security features
- [video] atuin: magical shell history with Rust
- [video] A Rust-Based, modular Unikernel for MicroVMs
Newsletters
Project/Tooling Updates
- Release Engineering Is Exhausting So Here's cargo-dist
- rust-analyzer changelog #167
- Glidesort, my stable adaptive quicksort/mergesort hybrid sorting algorithm
- Fornjot (code-first CAD in Rust) - Weekly Release - Ostensibly Quiet
- derive-adhoc: "derive by example", an ergonomic replacement for (some) proc macros
- Lemmy release 0.17.0 - A link aggregator for the Fediverse
- Arti 1.1.1 is released: Groundwork for onion services
- SeaORM 0.11.0 - 🐚 An async & dynamic ORM for Rust
Observations/Thoughts
- Async trait send bounds, part 1: intro
- Speeding up Rust semver-checking by over 2000x
- Announcing Masonry 0.1, and my vision for Rust UI
- Rust Is Beyond Object-Oriented, Part 2: Polymorphism
- [video] Rust Malaysia - The journey to rust from a student
- Improving incremental test times in Rust
- Using HTML as a compile target
- Tauri vs Iced vs egui: Rust GUI framework performance comparison
- Improving Rust compile times to enable adoption of memory safety
- [audio] Cloudflare with Adam Chalmers
Rust Walkthroughs
- Building a Rust parser using Pest and PEG
- Rustler - Using Rust crates in Elixir
- LifetimeKata: Exercises to learn how to use lifetimes
- Exploring Rust for Vulkan drivers, part 1
- Rustproofing Linux (Part 1/4 Leaking Addresses)
- STM32F4 Embedded Rust at the PAC: svd2rust
Miscellaneous
- My Reaction to Dr. Stroustrup's Recent Memory Safety Comments
- This Is the Kind of Rust the Automotive Industry Needs
Crate of the Week
This week's crate is envious, a serde-based deserializer from environment variables.
Thanks to musicmatze 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.
- this-week-in-rust - Make dark mode more accessible
- Ockam - 'ockam tcp-connection create' should return the tcp-connection ID
- Ockam - 'ockam node stop' should output a message when exiting successfully
- comprehensive-rust - We now support translations!
- comprehensive-rust - Extract text more carefully in mdbook-xgettext
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
350 pull requests were merged in the last week
- retry opening proc-macro DLLs a few times on Windows
- autotrait bounds on dyn-safe trait methods
- do not depend on Generator trait when deducing closure signature
- parse and recover from type ascription in patterns
- recover
_
as..
in field pattern - recover form missing expression in
for
loop - recover from lifetimes with default lifetimes in generic args
- don't generate unecessary
&&self.field
in deriving Debug - emit warnings on unused parens in index expressions
- erase regions before doing uninhabited check in borrowck
- extend
-Z print-type-sizes
to distinguish generator upvars+locals from "normal" fields - fix invalid float literal suggestions when recovering an integer
- fix suggestion for coercing
Option<&String>
toOption<&str>
- fix syntax in
-Zunpretty-expanded
output for derivedPartialEq
- fixing confusion between mod and remainder
- implement unsizing in the new trait solver
- don't point at nonexisting code beyond EOF when warning about delims
- improve diagnostic for missing space in range pattern
- improve panic message for slice windows and chunks
- improve pretty-printing of
HirIdValidator
errors - make
unaligned_reference
a hard error - make const/fn return params more suggestable
- make the "extra if in let...else block" hint a suggestion
- provide structured suggestion for binding needing type on E0594
- refine error spans for "The trait bound
T: Trait
is not satisfied" when passing literal structs/tuples - remove confusing 'while checking' note from opaque future type mismatches
- sort Generator
print-type-sizes
according to their yield points - suggest
move
in nested closure when appropriate - suggest
std::ptr::null
if literal 0 is given to a raw pointer function argument - suggest
{var:?}
when finding{?:var}
in inline format strings - suggest adding a return type for async functions
- intern external constraints in new solver
- optimize
fold_ty
- do not deaggregate MIR
- adapt SROA MIR opt for aggregated MIR
- test
drop_tracking_mir
before querying generator - track bound types like bound regions
- futures: poll
Select
futures without moving them - cargo: add partial support for SSH known hosts markers
- cargo: config: deny
CARGO_HOME
in env table - cargo: do not error for
auth-required: true
without-Z sparse-registry
- cargo: handle .cargo-ok being truncated
- cargo: make cargo install report needed features
- cargo: verify source before recompile
- rustfmt: prevent shorthand init for tuple struct
- rustfmt: lists doc comments
- clippy:
needless_lifetimes
: lint local macros - clippy:
unused_io_amount
: lint withis_ok
andis_err
- clippy:
wildcard_enum_match_arm
lint takes the enum origin into account - clippy: add
extra_unused_type_parameters
lint - clippy: add machine applicable suggestion for
needless_lifetimes
- clippy: don't depend on FormatArgsExpn in ManualAssert
- clippy: fix version declared for
semicolon_inside_block
andsemicolon_outside…
- clippy: mark
uninlined_format_args
as pedantic - rust-analyzer: add more basic issue templates with auto category labeling
- rust-analyzer: expand docs section on Visual Studio to mention all three available extensions
- rust-analyzer: remove support for 1.58 proc-macro abi
- rust-analyzer: fix negative trait bound in outline view (#14044)
- rust-analyzer: consider relative offset to fake ident token in expansion for completion
- rust-analyzer: don't panic on broken syntax trees in adjustment inlay hints
- rust-analyzer: don't render fieldless discriminant inlay hints for datacarrying enums
- rust-analyzer: support non-ascii characters in case conversion
- rust-analyzer: unsize cast array only on pointer type
- rust-analyzer: implement proc-macro-api versioning
- rust-analyzer: record method resolution for remaining operator expressions
- rust-analyzer: reuse fetching target data layout from rustc function
- rust-analyzer: support computing layout of RPIT
- rust-analyzer: support generic function in
generate_function
assist - rust-analyzer: support sysroot library source being defined inside the workspace
Rust Compiler Performance Triage
Much noise in benchmarks this week, which makes it hard to tell what the real
improvements were and what they were due to. A query cache change (PR #107667)
is part of the story. In addition, much improvement was reaped from the change
to not deaggregate MIR (PR #107267). Finally, microoptimizing fold_ty
(PR #107627) yielded a small improvement to a broad set of benchmarks.
Triage done by @pnkfelix. Revision range: a64ef7d0..e4dd9edb
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
2.4% | [0.3%, 18.8%] | 18 |
Regressions ❌ (secondary) |
1.8% | [0.2%, 4.1%] | 21 |
Improvements ✅ (primary) |
-1.0% | [-3.2%, -0.3%] | 88 |
Improvements ✅ (secondary) |
-4.0% | [-13.1%, -0.1%] | 47 |
All ❌✅ (primary) | -0.4% | [-3.2%, 18.8%] | 106 |
3 Regressions, 3 Improvements, 8 Mixed; 3 of them in rollups 41 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:
- 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] rework min_choice algorithm of member constraints
- [disposition: merge] fix: Unexpected trait bound not satisfied in HRTB and Associated Type
- [disposition: merge] Stabilize feature
cstr_from_bytes_until_nul
- [disposition: merge] rustdoc: remove inconsistently-present sidebar tooltips
- [disposition: merge] Relax ordering rules for
asm!
operands
New and Updated RFCs
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-02-08 - 2023-03-08 🦀
Virtual
- 2023-02-08 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-02-08 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-09 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-02-11 | Virtual | Rust GameDev
- 2023-02-13 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-02-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-02-14 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-14 | Virtual (Saarbrücken, DE) | Rust-Saar
- 2023-02-15 | Virtual | MongoDB
- 2023-02-15 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US; São Paulo, BR) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco and Microsoft Reactor São Paulo
- 2023-02-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-02-16 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-02-21 | Virtual (Washington, DC, US) | Rust DC
- 2023-02-23 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-02-23 | Virtual (Kassel, DE) | Java User Group Hessen
- 2023-02-23 | Virtual (México City, MX) | Rust MX
- 2023-02-28 | Virtual (Berlin, DE) | Open Tech School Berlin
- 2023-02-28 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-02-28 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-02-28 | Virtual (Munich, DE) | Rust Munich
- 2023-03-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-03-02 | Virtual (Linz, AT) | Rust Linz
- 2023-03-07 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-03-08 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
Asia
- 2023-02-14 | Tokyo, JP | Tokyo Rust Meetup
- 2023-02-20 | Tel Aviv, IL | Rust TLV
Europe
- 2023-02-09 | Lille, FR | Rust Lille
- 2023-02-15 | London, UK | Rust London User Group
- 2023-02-15 | Trondheim, NO | Rust Trondheim
- 2023-02-16 | Bordeaux, FR | DedoTalk
- 2023-02-16, 2023-02-17 | London, UK | Rust Nation UK
- 2023-02-18 | London, UK | Rust London User Group
- 2023-02-21 | Paris, FR | Rust Paris
- 2023-02-21 | Zurich, CH | Rust Zurich
- 2023-02-23 | Copenhagen, DK | Copenhagen Rust Community
- 2023-02-23 | Vienna, AT | Rust Vienna
- 2023-02-28 | Munich, DE + Virtual | Rust Munich
North America
- 2023-02-09 | Mountain View, CA, US | Mountain View Rust Study Group
- 2023-02-09 | New York, NY, US | Rust NYC
- 2023-02-13 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2023-02-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-02-23 | Lehi, UT, US | Utah Rust
Oceania
- 2023-02-23 | Brisbane, QLD, AU | Rust Brisbane
- 2023-02-28 | Canberra, ACT, AU | Canberra Rust User Group
- 2023-03-01 | Sydney, NSW, AU | Rust Sydney
South America
- 2023-02-22 | Montevideo, UY | Rust Meetup Uruguay
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
It's been 7.5 years since #27060 was reported, but the problem is finally fixed for good. :)
Thanks to scottmcm 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