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
Foundation
Project/Tooling Updates
- Progress Report #26: rustc_codegen_gcc can now compile Rust for Linux!
- Leptos Release v0.5.0
- Announcing Yew 0.21
- Ambient Platform
- Open Sourcing Ferrocene
- rust-analyzer changelog #201
- Zenoh 0.10.0, a pure Rust Pub/Sub/Query protocol for cloud-to-thing continuum, was released and it is packed with new features.
- Announcing Divan: Fast and Simple Benchmarking for Rust
Observations/Thoughts
- Polonius revisited, part 2
- Easing tradeoffs with profiles
- Async Iteration III: The Async Iterator Trait
- Rustconf 2023 recap
- Was async fn a mistake?
- Rust Vs Go: A Hands-On Comparison
- [video] The ultimate Rust IDE is here
- [audio] rb-sys with Ian Ker-Seymer
- [audio] What's New in Rust 1.70 and 1.71
Rust Walkthroughs
- Create an RSS Feed in Axum or Leptos
- Rust Dockerfile Boilerplate
- Nine Rules to Formally Validate Rust Algorithms with Dafny (Part 1): Lessons from Verifying the range-set-blaze Crate
- Send the logs of your Shuttle-powered backend to Datadog
- Tracing Tokio Tasks
- [series] Distributed Tracing in Rust, Episode 4: correlating logs and traces
- [video] Two Ways To Do Dynamic Dispatch
Miscellaneous
Crate of the Week
This week's crate is loole, another multiple-producer multiple-consumer channel.
Thanks to Mahdi Shojaee 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.
- Hyperswitch (Hacktoberfest)- Bitpay: Use connector_response_reference_id as reference to merchant
- Hyperswitch (Hacktoberfest)- Trustpay: Remove Default Case Handling
- Hyperswitch (Hacktoberfest)- Worldline: Currency Unit Conversion
- rust-libp2p - core: remove
upgrade::transfer
module - rust-libp2p - mdns: don't perform IO on main task
- rust-libp2p - quic: don't support draft versions
- Ockam - Improve
ockam enroll
project configuration step by warning user not to exit process - Ockam - Improve
ockam space create
by add missing argument--identity
(clap
command) - Ockam - Improve
ockam enroll
argument--identity
(clap
command)
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
358 pull requests were merged in the last week
- suggestion: insert projection to associated types
skip_binder
toinstantiate_identity
- add "integer square root" method to integer primitive types
- add Exclusive forwarding impls (FnOnce, FnMut, Generator)
- add context to
let: Ty = loop { break };
- allow LTO on
proc-macro
crates with-Zdylib-lto
- anonymize binders for
refining_impl_trait
check - assorted improvements for
rustc_middle::mir::traversal
- build
rustc
with a single CGU on x64 Linux - cleanup number handling in match exhaustiveness
- constParamTy: require Eq as supertrait
- correct codegen of
ConstValue::Indirect
scalar and scalar pair - don't store lazyness in
DefKind::TyAlias
- don't use a thread to load the dep graph
- expose
try_destructure_mir_constant_for_diagnostics
directly to clippy - factor out duplicated
entry_point_type
functions - fix
noop_method_call
detection - gate and validate
#[rustc_safe_intrinsic]
- implement Region for smir
- implement a global value numbering MIR optimization
- lint towards rejecting consts in patterns that do not implement PartialEq
- make
adt_const_params
feature suggestion consistent with other features and improve when it is emitted - make
link_llvm_intrinsics
andplatform_intrinsics
features internal - mark drop calls in landing pads cold instead of noinline
- migrate
rustc_hir_analysis
to session diagnostic (Part 5) - more fixes for running the test suite on a bare metal target
- new solver: remove provisional cache
- only prevent field projections into opaque types, not types containing opaque types
- only visit reachable nodes in SsaLocals
- point at more causes of expectation of break value when possible
- print GHA log groups to stdout instead of stderr
- promote loongarch64-unknown-none* to Tier 2
- properly print
cstr
literals inproc_macro::Literal::to_string
- prototype using const generic for
simd_shuffle
IDX array - remove
rustc_lint_defs::lint_array
- replace
HashMap
withIndexMap
in pattern binding resolve - resolve: skip underscore character during candidate lookup
- reveal opaque types before drop elaboration
- run abi/compatibility test against a whole bunch of targets
- simplify some of the logic in the
invalid_reference_casting
lint - skip MIR pass
UnreachablePropagation
when coverage is enabled - split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things
- stabilize
impl_trait_projections
- stabilize combining +bundle and +whole-archive link modifiers
- use
Vec::retain
inremove_dead_blocks
- use absolute paths in
rustc_lint::passes
macros - use placeholders to prevent using inferred RPITIT types to imply their own well-formedness
- when suggesting
self.x
forS { x }
, useS { x: self.x }
- miri: implement SSE3 and SSSE3 intrinsics
- miri: implement the
llvm.x86.sse2.pmadd.wd
intrinsic - stdio support for UEFI
- Build
rustc
with a single CGU on x64 Linux rustc_arena
overhaul- add
ptr::addr_eq
- add
track_caller
attribute toResult::unwrap_or_else
- implement
From<OwnedFd/Handle>
forChildStdin
/out
/err
object - implement
From<[T; N]>
forRc<[T]>
andArc<[T]>
- implement
From<{&,&mut} [T; N]>
forVec<T>
whereT: Clone
- weaken needlessly restrictive orderings on
Arc::*_count
- cargo: add better suggestion for the unsupported silent flag
- cargo: add missing
strip
entries indev
andrelease
profiles - cargo: fix corruption when cargo killed while writing
- cargo: use full target spec for
cargo rustc --print --target
- rustdoc: speed up processing of cross-crate fns to fix a perf regression
- clippy:
manual_let_else
: only omit block if span is from same ctxt - clippy:
mir_to_const
improvements - clippy:
write_literal
: Fix index of the remaining positional arguments - clippy: add
manual_hash_one
lint - clippy: add lint:
into_iter_without_iter
- clippy: add lint:
iter_without_into_iter
- clippy: describe the type of string in
raw_strings
lints - clippy: do not lint
wildcard_imports
when imported item contains underscore - clippy: don't escape unicode escape braces in
print_literal
- clippy: don't lint
manual_non_exhaustive
whenenum
is#[non_exhaustive]
- clippy: mention that
missing_assert_message
lint ignores test functions - clippy: move
needless_pass_by_ref_mut: suspicious
→nursery
- clippy: move
needless_raw_string_hashes
topedantic
- rust-analyzer: allow more kinds of if let patterns in guarded return assist
- rust-analyzer: downgrade
unused_variables
to experimental - rust-analyzer: make
bool_to_enum
assist createenum
at top-level - rust-analyzer: make
rustc_layout_scalar_valid_range
attributes work for non-decimal literals - rust-analyzer: panic with wrapping/unwrapping result return type assists
- rust-analyzer: recover better on missing parameter in param list
- rust-analyzer: strip base prefix in
layout_scalar_valid_range
- rust-analyzer: typing underscore should not trigger completions in types or patterns
- rust-analyzer: scip: allow customizing cargo config
Rust Compiler Performance Triage
A week completely free of pure regressions! The compiler has definitely come out of this week a decent amount faster and less memory hungry than before with the large gain coming from building the compiler with a single CGU on x64 Linux. This not only allows LLVM to do more optimizations across the entire compiler, but should hopefully also result in less non-deterministic performance regressions in the future. This improvement largely comes only at the expense of a few more minutes spent when bootstrapping the compiler.
Triage done by @rylev. Revision range: 27b4eb..9998f4
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.0% | [0.3%, 6.1%] | 41 |
Regressions ❌ (secondary) |
2.0% | [0.9%, 7.8%] | 21 |
Improvements ✅ (primary) |
-1.3% | [-5.1%, -0.2%] | 134 |
Improvements ✅ (secondary) |
-1.8% | [-6.9%, -0.2%] | 175 |
All ❌✅ (primary) | -0.8% | [-5.1%, 6.1%] | 175 |
0 Regressions, 2 Improvements, 4 Mixed; 0 of them in rollups 74 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
Tracking Issues & PRs
- [disposition: merge] Tracking Issue for pointer_bytes_offsets
- [disposition: merge] Stabilize
atomic_from_ptr
- [disposition: merge] document when atomic loads are guaranteed read-only
- [disposition: merge] const_eval: allow function pointer signatures containing &mut T in const contexts
- [disposition: merge] const-eval: make misalignment a hard error
- [disposition: merge] Stabilize
async fn
andreturn-position impl
Trait in trait - [disposition: merge] rustdoc: hide
#[repr(transparent)]
if it isn't part of the public ABI - [disposition: merge] Stabilize
const_maybe_uninit_assume_init_read
- [disposition: merge] Fix exit status / wait status on non-Unix cfg(unix) platforms
- [disposition: merge] impl Default for ExitCode
- [disposition: merge] rustdoc-search: add impl disambiguator to duplicate assoc items
- [disposition: merge] rustdoc: show crate name beside smaller logo
- [disposition: merge] Implement iterator specialization traits on more adapters
- [disposition: merge] Fix generic bound of
str::SplitInclusive
'sDoubleEndedIterator
impl - [disposition: merge] fix detecting references to packed unsized fields
New and Updated RFCs
- [new] Move rustdoc-types to T-Rustdoc ownership.
- [new] RFC: Syntax for embedding cargo-script manifests
- [new] RFC: cargo-script
- [new] 2024 Edition
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-10-04 - 2023-11-01 🦀
Virtual
- 2023-10-04 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-10-04 | Virtual (Various) | Ferrous Systems
- 2023-10-04 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-10-05 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-10-07 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2023-10-10 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-10-10 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-10-11| Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-10-12 - 2023-10-13 | Virtual (Brussels, BE) | EuroRust
- 2023-10-12 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-10-18 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-10-19 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-10-19 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-10-24 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-10-31 | Virtual (Dallas, TX, US) | Dallas Rust
Asia
- 2023-10-11 | Kuala Lumpur, MY | GoLang Malaysia
Europe
- 2023-10-04 | Lyon, FR | Rust Lyon
- 2023-10-10 | Berlin, DE | OpenTechSchool Berlin
- 2023-10-11 | Brussels, BE | BeCode Brussels Meetup
- 2023-10-12 - 2023-10-13 | Brussels, BE | EuroRust
- 2023-10-12 | Brussels, BE | Rust Aarhus
- 2023-10-12 | Reading, UK | Reading Rust Workshop
- 2023-10-17 | Helsinki, FI | Finland Rust-lang Group
- 2023-10-17 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2023-10-19 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2023-10-19 | Wrocław, PL | Rust Wrocław
- 2023-10-25 | Dublin, IE | Rust Dublin
- 2023-10-26 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
North America
- 2023-10-05 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-10-09 | Chicago, IL, US | Deep Dish Rust
- 2023-10-09 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2023-10-11 | Boulder, CO, US | Boulder Rust Meetup
- 2023-10-12 | Lehi, UT, US | Utah Rust
- 2023-10-17 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-10-18 | Brookline, MA, US | Boston Rust Meetup
- 2023-10-19 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-10-19 | Nashville, TN, US | Music City Rust Developers
- 2023-10-19 | Seattle, WA, US | Seattle Rust User Group
- 2023-10-25 | Austin, TX, US | Rust ATX
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
I've been writing Rust code everyday for years, and I used to say Rust wasn't great for writing prototypes because if forced you to ask yourself many questions that you may want to avoid at that time.
I recently realized this is all wrong: you can write Rust pretty much as fast as you can write code in any other language, with a meaningful difference: with a little discipline it's easy to make the rough edges obvious so you can sort them out later.
There was no suggestion this week, but llogiq is pleased with his choice nonetheless!
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