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
- 2023 Annual Rust Survey Results
- Rust participates in Google Summer of Code 2024
- Leadership Council March Representative Selections
Foundation
- Save the Date: RustConf 2024 – September 10-13
- Second Security Initiative Report Details Rust Security Advancements
Project/Tooling Updates
- Bevy 0.13
- Bevy XPBD 0.4: Collider Agnosticism, Layer Rework, and Bevy 0.13
- uv: Python packaging in Rust
- git-cliff: What's new in 2.0.0? (highly customizable changelog generator)
- rustc_codegen_gcc: Progress Report #30
- RustRover Q4 2023 Feature Updates Retrospective
- rust-analyzer changelog #221
- Anouncing Stabby 3.0
- argmin_testfunctions 0.2.0: test functions for optimization problems in Rust and Python
- vscode-rustup released: interface with rustup as a VSCode extension
- OpenPGP-card-tools 0.10.0 released. The project provides the
oct
commandline tool for inspecting, configuring and using OpenPGP card devices such as Nitrokey or Yubikey. - Rust Client for Timeplus Proton SQL Streaming
Observations/Thoughts
- FuturesUnordered and the order of futures
- Rust Tooling: 8 tools that will increase your productivity
- Writing down my mental model of unsafe
- How can Rust be so fast in the TechEmpower Web Framework Benchmarks?
Rust Walkthroughs
- From 1s to 4ms
- Translating OpenStreetMap data to HTML5 Canvas with Rust and WebAssembly
- macros_rule!
- Implementing JWT Authentication in Rust
- Deploying Axum to Lambda and ECS, using Lambda Web Adapter
- Rust/C++ Interop Part 3 - Cxx
- [FR] Les closures en Rust
- [video] Safe Rust AIN'T SAFE!? (cve-rs)
Miscellaneous
Crate of the Week
This week's crate is kind, a helper crate for typed UUIDs.
Thanks to Denys Séguret for the self-suggestion!
Please submit your suggestions and votes for next week!
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:
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.
Call for Participation; projects and speakers
CFP - Projects
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.
- Ockam - Syntax highlighting for fenced code blocks, in command help output, on Linux works
- Ockam - Shut down Worker/Processor if initialization failed
- Ockam - Output for ockam project ticket is improved and information is not opaque
- Hyperswitch - [FEATURE] : add
offset
field to disputes list - Hyperswitch - [FEATURE]: add
offset
field to mandates list - Hyperswitch - [FEATURE]: add pagination support for customers list
If you are a Rust project owner and are looking for contributors, please submit tasks here.
CFP - Speakers
Are you a new or experienced speaker looking for a place to share something cool? This section highlights events that are being planned and are accepting submissions to join their event as a speaker.
If you are an event organizer hoping to expand the reach of your event, please submit a link to the submission website through a PR to TWiR.
Updates from the Rust Project
508 pull requests were merged in the last week
- implicitly enable evex512 if avx512 is enabled
const_mut_refs
: allow mutable pointers to staticsmacro_rules
: Preserve all metavariable spans in a global side table- add APIs for fetching foreign items
- add
rust.frame-pointers
config option - add more checks for
unnamed_fields
during HIR analysis - allow AST and HIR visitors to return
ControlFlow
- allow mutable references in const values when they point to no memory
- always evaluate free constants and statics, even if previous errors occurred
- avoid an ICE in diagnostics
- be less confident when
dyn
suggestion is not checked for object safety - check normalized call signature for WF in mir typeck
- consider principal trait ref's auto-trait super-traits in dyn upcasting
- continue compilation after
check_mod_type_wf
errors - continue compilation even if inherent impl checks fail
- continue reporting remaining errors instead of silently dropping them
- detect when method call on argument could be removed to fulfill failed trait bound
- fix an ICE in the recursion lint
- ignore unsized types when trying to determine the size of the original type
- make
ConstPropLint
lint run on promoteds - make
async Fn
trait kind errors better - properly deal with weak alias types as self types of impls
- rename
ConstPropLint
toKnownPanicsLint
- store static initializers in metadata instead of the MIR of statics
- suggest
into_iter()
whenIterator
method called onimpl IntoIterator
- trigger
unsafe_code
lint on invocations ofglobal_asm
- use fulfillment in next trait solver coherence
- miri: implement x86 AVX intrinsics
- optimize
delayed_bug
handling - optimize away poison guards when std is built with panic=abort
- overhaul
Diagnostic
andDiagnosticBuilder
- implement
Instant
for UEFI - implement
Default
forAsciiChar
- store
core::str::CharSearcher::utf8_size
as u8 - make
File::read_to_end
less special - implement
NonZero
traits generically - make
NonZero::get
generic - make
io::BorrowedCursor::advance
safe - make
is_nonoverlapping #[inline]
- specialize flattening iterators with only one inner item
- specialize some methods of
io::Chain
- rename
MaybeUninit::write_slice
- don't use
mem::zeroed
invec::IntoIter
- optimize
VecDeque::drain
for (half-)open ranges - fix BTreeMap's
Cursor::remove_{next,prev}
- add
Future
andIntoFuture
to the 2024 prelude - hashbrown: inline tweaks to
HashTable
- hashbrown: make
HashSet::insert
return OccupiedEntry - codegen_gcc: correctly handle
--use-system-gcc
- codegen_gcc: implement dummy emit=llvm-ir
- codegen_gcc: use the default rust mangling
- codegen_cranelift: fix
simd_select_bitmask
on big-endian systems - codegen_cranelift: fix download hash check on big-endian systems
- cargo add: Ensure users know a feature is being created
- cargo add: Remove inconsistent period
- cargo test: Suggest
--
for libtest arguments - cargo: respect
rust-version
when generating lockfile - rustdoc: correctly handle long crate names on mobile
- rustdoc: cross-crate re-exports: correctly render late-bound params in source order even if early-bound params are present
- rustdoc: fix handling of
doc_auto_cfg
feature for cfg attributes on glob reexport - rustfmt: fix error trying to format unnormalized UTF8
- format
async
trait bounds in rustfmt - add clippy into the known
cfg
list - clippy: add new lint
deprecated_clippy_cfg_attr
- clippy:
case_sensitive_file_extension_comparisons
: Don't trigger on digits-only extensions - clippy:
implied_bounds_in_impls
: avoid linting on overlapping associated tys - clippy:
incompatible_msrv
: allow expressions that come from desugaring - clippy:
new_without_default
: Now emits on const fns - clippy: allow negative literals in
redundant_guards
- clippy: check trait items in
min_ident_chars
- clippy: default test output conflict handling to error
- clippy: ensure ASM syntax detect
global_asm!
andasm!
only on x86 architectures - clippy: add check for identical guards in lint
match_same_arms
- clippy: make
#[allow]
work on field forpub_underscore_fields
- clippy: ignore imported items in
min_ident_chars
- rust-analyzer: activate on top level
Cargo.toml
andrust-project.json
files - rust-analyzer: deduplicate references when some of them are in macro expansions
- rust-analyzer: create alias when renaming an import
- rust-analyzer: add non-exhaustive-let diagnostic
- rust-analyzer: add unresolved-ident diagnostic
- rust-analyzer: support multiple tab stops for completions in VSCode
- rust-analyzer: add basic support for
become
expr/tail calls - rust-analyzer: don't add
\
before{
- rust-analyzer: don't show type mismatches for
{unknown}
to non-{unknown}
mismatches - rust-analyzer: fix "needless return" diagnostic for trailing item declarations
- rust-analyzer: fix build scripts not being rebuilt in some occasions
- rust-analyzer: fix false positives for "unnecessary else" diagnostic
- rust-analyzer: fix snippets being placed leftwards of where they should be
- rust-analyzer: improve recover on
=
for record field initializer and pattern - rust-analyzer: only complete traits in
impl .. for
- rust-analyzer: place snippets correctly in multi-edit assists
- rust-analyzer: server hanging up on build script task
Rust Compiler Performance Triage
Relatively few PRs affecting performance, but massive improvements thanks to the update to LLVM 18 (PR #12005), as well as the merging of two related compiler queries (PR #120919) and other small improvements from a rollup (PR #121055).
Triage done by @pnkfelix. Revision range: 74c3f5a1..5af21304
3 Regressions, 1 Improvements, 6 Mixed; 1 of them in rollups 65 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
Tracking Issues & PRs
Rust
- [disposition: merge] change equate for binders to not rely on subtyping
- [disposition: merge] Implement RFC 3373: Avoid non-local definitions in functions
- [disposition: merge] Tracking Issue for
waker_getters
- [disposition: merge] Stabilize the
#[diagnostic]
namespace and#[diagnostic::on_unimplemented]
attribute - [disposition: merge] Tracking Issue for cfg-target-abi
- [disposition: merge] make non-PartialEq-typed consts as patterns a hard error
- [disposition: close] Allow ?-converting from
Result<T, E>
in functions returningOption<Result<T, E>>
- [disposition: merge] Add Read Impl for &Stdin
- [disposition: merge] Make
Barrier::new()
const - [disposition: close] Implement
Future
forOption<F>
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-02-21 - 2024-03-20 🦀
Virtual
- 2024-02-21 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-02-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-02-22 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-02-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-02-29 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-02-29 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-03-07 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-03-12 | Hybrid (Virtual + In-person) Munich, DE | Rust Munich
- 2024-03-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2024-03-21 | Seattle, WA, US | Seattle Rust User Group
- 2024-03-26 | Virtual + In Person (Barcelona, ES) | BcnRust
Europe
- 2024-02-21 | Lyon, FR | Rust Lyon
- 2024-02-22 | Aarhus, DK | Rust Aarhus
- 2024-02-29 | Berlin, DE | Rust Berlin
- 2024-03-12 | Munich, DE + Virtual | Rust Munich
- 2024-03-19 | Aarhus, DK | Rust Aarhus
- 2024-03-20 | Girona, ES | Rust Girona
- 2024-03-26 | Barcelona, ES + Virtual | BcnRust
- 2024-03-26, 2024-03-28 | London, UK | Rust Nation UK
North America
- 2024-02-21 | Boston, MA, US | Boston Rust Meetup
- 2024-02-22 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-02-28 | Austin, TX, US | Rust ATX
- 2024-03-07 | Mountain View, CA, US | Mountain View Rust Meetup
Oceania
- 2024-02-27 | Canberra, ACT, AU | Canberra Rust User Group
- 2024-02-27 | Sydney, NSW, AU | Rust Sydney
- 2024-02-29 | Brisbane, QLD, AU | Rust Brisbane
- 2024-03-05 | Auckland, NZ | Rust AKL
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
Shared mutable state is evil, and you can solve it by forbidding mutation, or by forbidding sharing. Rust supports both.
Thanks to Aleksey Kladov 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