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 and archives can be viewed at this-week-in-rust.org. 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 #186
- Tantivy 0.20: Schemaless
- lz4_flex 0.11: Gainzzzzz Unleashed!
- redb (Rust Embedded DataBase) 1.0 release
- rust-libp2p v0.52.0: a modular p2p networking stack
autometrics
0.5 - Automatically connecting Prometheus metrics to traces with exemplars- Introducing ducktor: Duck typed constructors for Rust structs with wasm-bindgen JsValue
Observations/Thoughts
- How we built the Grafbase local development experience in Rust
- Encoding ML-style modules in Rust
- Shuttle Launchpad #2: Structs and Enums
- Building vector search in 200 lines of Rust
- Leveraging the Type System for Domain Modeling in Rust
- Building an out-of-tree Rust Kernel Module Part Three
- Paying with (in memory) cache
- Rewriting Ockam in Rust
Rust Walkthroughs
Miscellaneous
- Fossil Data Platform Rewritten in Rust 🦀
- Build a CLI Tool for Data Masking, Encryption, and Decryption With Rust
- Santiago Pastorino: Maintainer Retention
- Meilisearch across the Semantic Verse
- [DE] Programmiersprachen: Die Beliebtheit von Rust bleibt ungebrochen
Crate of the Week
This week's crate is release-plz, a crate to automate changelog generation, GitHub/Gitea release tagging, publishing on crates.io and bumping the version.
Thanks to Marco Ieni 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 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.
- Send-file - Get device memory information
- Send-file - create hotspot on Windows operating system
- Ockam - Implement clap commands
ockam uninstall
andockam upgrade
- Ockam - Enable pnpm support in dependabot
- Ockam - Add an "optional" tag to commands arguments' description when generating markdown docs
- Hyperswitch - Make get_redis_conn return result in StorageInterface
- Hyperswitch - Implement
QueueInterface
forMockDb
- Hyperswitch - Maintain consistency between
PaymentIntent
andPaymentAttempt
forconnector_id
- Hyperswitch - Implement
PaymentMethodInterface
forMockDb
- Hyperswitch - Use the newtype pattern for ZIP/PIN codes
- mirrord - Non-indicative error when running on a Completed pod
- mirrord - Log problem in layer and exit when agent image is not found
- mirrord - Further tests for HTTP header filtering.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
410 pull requests were merged in the last week
- collect VTable stats & add
-Zprint-vtable-sizes
- prevent
.eh_frame
from being emitted for-C panic=abort
#[test]
function signature verification improvements- add
<meta charset="utf-8">
to-Zdump-mir-spanview
output - add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer
- continue folding in query normalizer on weak aliases
- don't record adjustments twice in
note_source_of_type_mismatch_constraint
- don't ICE on bound var in
reject_fn_ptr_impls
- don't ICE on unsized
extern "rust-call"
call - don't capture
&[T; N]
when contents isn't read - extend
unused_must_use
to cover block exprs - fix
dead_code_cgu
computation - fix explicit-outlives-requirements lint span
- fix suggestion for E0404 not dealing with multiple generics
- fix the overflow issue for
transmute_generic_consts
- handle interpolated literal errors
- non-unwinding panic for misaligned pointer deref
- make
struct
layout not depend on unsizeable tail - new solver proof tree generation
- opportunistically resolve regions in new solver
- normalize closure output in
equate_inputs_and_outputs
- safe Transmute: Enable handling references
- support 128-bit
enum
variant in debuginfo codegen - introduce a minimum CGU size in non-incremental builds
- ignore the always part of
#[inline(always)]
in MIR inlining - introduce a
Stable
trait to translate MIR to SMIR - make mir dataflow graphviz dumps opt-in
- miri: dereference pointers in shims as correct types
- promote unchecked integer math to MIR
BinOp
s - simplify
unchecked_{shl,shr}
- implement
TryFrom<&OsStr>
for&str
- extend
io::copy
buffer reuse to BufReader too - stabilize
String::leak
available_parallelism
using native netbsd api first- only depend on dlmalloc for wasm*-unknown
- don't drain-on-drop in
DrainFilter
impls of various collections - make
BinaryHeap
parametric over Allocator - optimize
slice::Iter::fold
- relax implicit
T: Sized
bounds onBufReader<T>
,BufWriter<T>
andLineWriter<T>
- hashbrown: fix leaking of allocator in
RawIntoIter
andRawIntoParIter
- cargo: Align package name sanitization with cargo-new
- cargo: Don't auto-discover build.rs files
- cargo: Switch to
syn
for parsing doc comments - cargo: enable
doctest-in-workspace
by default - cargo: fix version requirement example in Dependency Resolution, SemVer compatibility section
- rustdoc: Fix URL encoding of % sign
- rustdoc: Fix invalid handling of "going back in history" when "go to only search result" setting is enabled
- rustdoc-gui: allow running on Windows
- rustdoc-search: search never type with
!
- rustdoc: add search result item types after their name
- rustfmt: adjust
enum
variant spans to exclude any explicit discriminant - rustfmt: prevent ICE when calling
parse_attribute
without an attribute - clippy: add lint
incorrect_clone_impl_on_copy_type
- clippy: new lint
single_call_fn
- clippy: new lint
single_range_in_vec_init
- clippy: new lint:
drain_collect
- clippy:
arithmetic_side_effects
also lint const arithmetic - clippy:
missing_panics_doc
: pickup expect method - clippy:
redundant_closure_call
: handle nested closures - clippy: fix
find_format_arg_expr
when incremental compilation is enabled - clippy:
derivable_impls
: don't lint ifdefault()
call expr unsize-coerces to trait object - clippy:
map_unwrap_or
: don't lint when referenced variable is moved - clippy:
match_same_arms
: don't lint ifnon_exhaustive_omitted_patterns
- clippy:
missing_const_for_fn
: Ensure dropped locals are~const Destruct
- clippy:
needless_doctest_main
: ignoremain()
inno_test
code fences - clippy: make
missing_panics_doc
not lint fortodo!()
- clippy: don't lint non-statement/faux empty
needless_if
s - clippy: fix false positive of
self_named_module_files
andmod_module_files
- clippy: ignore more type aliases in
unnecessary_cast
- clippy: adding configuration to allow safety comment above stmt containing unsafe block
- clippy: improve suggestion for
needless_lifetimes
- clippy:
from_over_into
: Show suggestions for non-Self expanded paths - clippy:
unnecessary_fold
: suggest turbofish if necessary - clippy:
no_effect
: Suggest addingreturn
if applicable - clippy: make
--explain
subcommand return 1 for missing lints - rust-analyzer: correctly handle inlining of async fn
- rust-analyzer: deduplicate tuple indices for completion
- rust-analyzer: add binding definition for for-expr iterator desugared binding
- rust-analyzer: ensure that ws loading error includes path to ws
- rust-analyzer: implement missing members doesn't transform const params and default types
Rust Compiler Performance Triage
Fairly positive week with very few regressions and some decent (albeit incremental) improvements. The most widespread gains came from some standard library improvements which are not a particularly common cause of large improvements in compiler performance. Overall a large chunk of the perf test suite showed an average of 0.6% improvement.
Triage done by @rylev. Revision range: 4bd4e2e..b9d608c
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.4% | [0.5%, 3.6%] | 16 |
Regressions ❌ (secondary) |
1.0% | [0.2%, 3.5%] | 29 |
Improvements ✅ (primary) |
-0.8% | [-7.8%, -0.2%] | 157 |
Improvements ✅ (secondary) |
-2.9% | [-48.3%, -0.3%] | 84 |
All ❌✅ (primary) | -0.6% | [-7.8%, 3.6%] | 173 |
3 Regressions, 7 Improvements, 4 Mixed; 3 of them in rollups 51 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] Implement PartialOrd for
Vec
s over different allocators - [disposition: merge] Add
Read
,Write
andSeek
impls forArc<File>
where appropriate - [disposition: merge] Return
Ok
on kill if process has already exited - [disposition: close] Tracking issue for RFC 1868: A portability lint
- [disposition: merge] Implement
Sync
formpsc::Sender
New and Updated RFCs
- [new] Propose code string literals
- [new] Contextual target feature detection
- [new] Introduce the Store API for great good.
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-06-21 - 2023-07-19 🦀
Virtual
- 2023-06-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-06-22 | Virtual (Karlsruhe, DE) | Karlsruhe Functional Programmers Group
- 2023-06-25 | Virtual (Auckland, NZ) | ResBaz Aotearoa 2023
- 2023-06-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-06-28 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-06-28 | Virtual (Chicago, IL, US) | Chicago Healthcare Cloud Technology Community
- 2023-06-29 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-06-29 | Virtual (Ciudad de México, MX) | Rust MX
- 2023-07-01 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-07-04 | Virtual (Berlin, DE) | Berline.rs / OpenTechSchool Berlin
- 2023-07-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-07-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-07-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-07-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-07-13 - 2023-07-14 | Virtual | Scientific Computing in Rust
- 2023-07-13 | Virtual (Edinburgh, UK) | Rust Edinburgh
Asia
- 2023-06-29 | Seoul, KR | T-RUST meetup
Europe
- 2023-06-22 | Vienna, AT | Papers We Love Vienna
- 2023-06-22 | Bern, CH | Rust Bern
- 2023-06-22 | Wrocław, PL | Rust Wrocław
- 2023-06-27 | Bucharest, RO | Rust Lang Bucharest Meetup
- 2023-06-27 | London, UK | Rust London User Group
- 2023-06-27 | Paris, FR | Rust Paris
- 2023-06-28 | Bratislava, SK | Bratislava Rust Meetup Group
- 2023-06-29 | Augsburg, DE | Rust Meetup Augsburg
- 2023-06-29 | Copenhagen, DK | Copenhagen Rust Community
- 2023-06-29 | Vienna, AT | Rust Vienna
- 2023-07-01 | Basel, CH | Rust Basel
- 2023-07-03 | Zurich, CH | Rust Zurich
- 2023-07-05 | Lyon, FR | Rust Lyon
- 2023-07-11 | Breda, NL | Rust Nederland
- 2023-07-13 | Reading, UK | Reading Rust Workshop
North America
- 2023-06-21 | Austin, TX, US | Rust ATX
- 2023-06-21 | Somerville, MA, US | Boston Rust Meetup
- 2023-06-22 | New York, NY, US | Rust NYC
- 2023-06-24 | San Jose, CA, US | Rust Breakfast & Learn
- 2023-06-28 | Cambridge, MA, US | Boston Rust Meetup
- 2023-06-29 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-07-01 | San Jose, CA, US | Rust Breakfast & Learn
- 2023-07-07 | Chicago, IL, US | Deep Dish Rust
- 2023-07-13 | Seattle, WA, US | Seattle Rust User Group Meetup
- 2023-07-18 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-07-11 | Melbourne, VIC, AU | Rust Melbourne
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
rust programmers when they see each other again:
Long time no C
– ciscoffeine on mond-basis.eu
Thanks to Brian Kung 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