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
Foundation
- Rust Foundation Joins Open Infrastructure Foundation as Associate Member
- Rust Identified as Safer Coding Tool by NIST
- Rewarding Resilience: Rust & the U.S. National Cybersecurity Strategy
Project/Tooling Updates
- Helix editor 23.03 released
- Rustls 0.21.0 Released With Exciting New Features
- Slint 1.0: The Next-Generation Native GUI Toolkit Matures
- rust-analyzer changelog #175
- Introducing SeaStreamer - a stream processing toolkit for Kafka and Redis Streams
- youki 0.0.5 has been released
- Fluvio Connector Development Kit released
Observations/Thoughts
- Thoughts on async closures
- How to speed up the Rust compiler in March 2023
- Two things that Rust does better than C++
- Rust Tidbits #1
- Follow up on cracking ZIP archives in Rust
- 58 Rust Resources Every Learner Should Know in 2023
- [audio] AI-NC with Tom Miles
- [audio] Servo with Josh Matthews
Rust Walkthroughs
- Building a Classic Mac OS App in Rust
- Cross Compiling Rust Projects in GitHub Actions
- Rust on the CH32V003
- Build your own CountMinSketch in Rust
- Nine Rules for Creating Fast, Safe, and Compatible Data Structures in Rust (Part 1): Lessons from RangeSetBlaze
- A definitive guide to sealed traits in Rust
- [ZH] Build a Lua interpreter in Rust
Miscellaneous
- Rust for C#/.NET Developers
- [video] Rust Wasm-Bindgen in 2 Minutes: Bridging the Gap Between WASM & JavaScript
Crate of the Week
This week's crate is keshvar, a library providing a host of information on every country.
Thanks to Pouriya 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 - Use newtype pattern for email addresses
- Hyperswitch - Determine card brand from card BIN
- Hyperswitch - Validate card number while accepting payment method information
- man-in-the-middle-proxy - Transparent mode
- man-in-the-middle-proxy - TLS Decoder
- man-in-the-middle-proxy - Edit and resend requests
- man-in-the-middle-proxy - Duplicate and resend requests
- rusticify - Arrows parallel mode
- ockam - Update ockam tcp-outlet create clap command to have defined default arguments
- ockam - Update ockam forwarder create clap command to have defined default arguments
- ockam - Display worker address in the output of ockam tcp-connection create clap command
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
390 pull requests were merged in the last week
- initial support for return type notation (RTN)
- specialization involving RPITITs is broken so ignore the diagnostic differences
- add a builtin
FnPtr
trait that is implemented for all function pointers - middle: emit error rather than delay bug when reaching limit
- closures always implement
FnOnce
in new solver - correctly substitute GAT's type used in
normalize_param_env
incheck_type_bounds
- do not consider elaborated projection predicates for objects in new solver
- don't ICE on
DiscriminantKind
projection in new solver - don't ICE on placeholder consts in deep reject
- erase impl regions when checking for impossible to eagerly monomorphize items
- freshen normalizes-to hack goal RHS in the evaluate loop
- improve error message when writer is forgotten in write and writeln macro
- make init mask lazy for fully initialized/uninitialized const allocations
- numeric vars can only be unified with numerical types in deep reject
- simplify transmutes in MIR InstCombine
- stable MIR: Add basic MIR body datastructures
- stop special-casing
'static
in evaluation - suggest ..= when someone tries to create an overflowing range
- drop array patterns using subslices
- add
IndexSlice
to go withIndexVec
- use
&IndexSlice
instead of&IndexVec
where possible - partial stabilization of
once_cell
- optimize
LazyCell
size - drop unstable
Option::contains
, Result::contains, Result::contains_err
- use span of placeholders in
format_args!()
expansion - change
advance(_back)_by
to return the remainder instead of the number of processed elements binary_heap
: Optimize Extend implementation- stabilize
binary_heap_retain
- hashbrown: optimize insertion to only use a single lookup
- codegen_gcc: optimize bitreverse codegen
- cargo: add delays to network retries
- rustdoc + rustdoc-json support for
feature(non_lifetime_binders)
- rustdoc: run more HIR validation to mirror rustc
- clippy: add large future lint
- clippy: added the
unnecessary_box_returns
lint - clippy: flag
bufreader.lines().filter_map(Result::ok)
as suspicious - clippy: add suggestions to
extra_unused_type_parameters
- clippy:
arithmetic_side_effects
: correctly handle division and module when the right-hand-side is unknown - clippy: fix
nonminimal_bool #[allow]
attributes - clippy: fix allow attribute, items from macros in
items_after_statements
- clippy: ignore
file!()
macro inprint_literal
,write_literal
- clippy: in uninit checking, add fallback for polymorphic types
- rust-analyzer: expand Macro Recursively: don't append "!" to non-bang macro name
- rust-analyzer: feat: pop a notification prompting the user to add a Cargo.toml of unlinked file to the linkedProjects
- rust-analyzer: fix stack overflow in
is_ty_uninhabited_from
- rust-analyzer: add missing autoborrow adjustment for index expressions
- rust-analyzer: allow new, subsequent
rust-project.json
-based workspaces to get proc macro expansion - rust-analyzer: canonicalize rust-project.json manifest path
- rust-analyzer: handle box and raw pointers correctly in
builtin_deref
- rust-analyzer: lower adjusts in simple index except the last one
- rust-analyzer: properly handle local trait impls
- rust-analyzer: recover from
pub()
visibility modifier - rust-analyzer: use
struct_tail_without_normalization
inExpectation::rvalue_hint
- rust-analyzer: use async block in async fn type inference
- rust-analyzer: limited syntax support for return type notations (RTN)
- rust-analyzer: missing runnable env on debug target
Rust Compiler Performance Triage
A large improvement in const evaluation (particularly for large types) in #109670 and a large improvement to many-paged rustdoc workloads in #109876 by removing quadratic behavior. Regressions are comparatively limited this week.
Triage done by @simulacrum. Revision range: cbc064b341be231403d181402a786cce7f1c73f1..7c96e40da81165beef4f273f44e96eeef5a1bd30
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
2.3% | [0.4%, 8.4%] | 18 |
Regressions ❌ (secondary) |
1.6% | [0.3%, 10.7%] | 26 |
Improvements ✅ (primary) |
-2.5% | [-77.6%, -0.3%] | 63 |
Improvements ✅ (secondary) |
-4.0% | [-27.9%, -0.3%] | 52 |
All ❌✅ (primary) | -1.4% | [-77.6%, 8.4%] | 81 |
1 Regressions, 4 Improvements, 3 Mixed; 2 of them in rollups 54 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] rustdoc-search: add support for nested generics
- [disposition: merge] Tracking Issue for const_ptr_read
- [disposition: merge] Uplift
clippy::{drop,forget}_{ref,copy}
lints - [disposition: close] Tracking issue for the #[alloc_error_handler] attribute (for no_std + liballoc)
- [disposition: merge] Implement Neg for signed non-zero integers.
- [disposition: merge] Tracking Issue for IsTerminal / is_terminal
- [disposition: close] Tracking Issue for array_zip
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-04-05 - 2023-05-03 🦀
Virtual
- 2023-04-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-04-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-04-06 | Virtual (Tehran, IR) | Iran Rust Meetup
- 2023-04-08 | Virtual | Rust GameDev
- 2023-04-08 | Virtual | Ukrainian Rust Community
- 2023-04-11 | Virtual (Berlin, DE) | Berline.rs - OpenTechSchool Berlin
- 2023-04-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-04-11 | Virtual | Rust Live
- 2023-04-11 | Virtual (Saarbrücken, DE) | Rust-Saar
- 2023-04-12 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-04-12 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-04-13 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-04-13 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-04-18 | Virtual (Washington, DC, US) | Rust DC
- 2023-04-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-04-20 | Virtual (Munich, DE) | Rust Munich
- 2023-04-20 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-04-25 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-04-26 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-04-27 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-04-29 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-05-02 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-05-03 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-04-08 | Beijing, CN | Rust Chinese Group
- 2023-04-08 | Kyoto, JP | Kansai Rust
- 2023-04-12 | Kuala Lumpur, MY | Rust Malaysia; Telegram
- 2023-04-18 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2023-04-05 | Cologne, DE | Rust Cologne
- 2023-04-06 | Lyon, FR | Rust Lyon
- 2023-04-13 | Roma, IT | Rust Roma
- 2023-04-13 | Wrocław, PL | Rust Wrocław
- 2023-04-19 | Paris, FR | Rust Paris
- 2023-04-19 | Trondheim, NO | Rust Trondheim
- 2023-04-19 | Zurich, CH | Rust Zurich
- 2023-04-20 | Aarhus, DK | Rust Aarhus
- 2023-04-20 | Munich, DE + Virtual | Rust Munich
- 2023-04-20 | Bern, CH | Rust Bern
- 2023-04-21 | Stuttgart, DE | Rust Community Stuttgart
- 2023-05-02 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2023-05-10 | Amsterdam, NL | RustNL
North America
- 2023-04-08 | Durham, NC, US | Triangle Rust
- 2023-04-13 | New York, NY, US | Rust NYC
- 2023-04-18 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-04-13 | Sydney, NSW, AU | Rust Sydney
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
As usual, the borrow checker is correct: we are doing memory crimes.
Thanks to Jelte Fennema 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