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 X (formerly 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.
Want TWIR in your inbox? Subscribe here.
Updates from Rust Community
Newsletters
Project/Tooling Updates
- Tauri 2.0 Release Candidate
- CGlue 0.3 Future and Beyond
- ratatui - v0.28.0
- Pigg 0.3.3 the GUI for RPi GPIO interaction released, with Remote GPIO feature!
- Announcing SeaORM 1.0
- Danube - Queuing and Pub/Sub message patterns
Observations/Thoughts
- Trying and mostly failing to optimize frustum culling in a WebGL + TS + Rust engine
- Panic! At The Async Runtime Shutdown
- Debugging a rustc segfault on illumos
- Tracing my way with tracing-rs
- [Series] The Hitchhiker’s Guide to Building a Distributed Filesystem in Rust.
- Best Rust books for 2024
- Phantom Menace: memory leak that wasn't there
- Developing a cryptographically secure bootloader for RISC-V in Rust
- Extending the #[diagnostic] tool attribute namespace
Rust Walkthroughs
- Tracing Tokio Resources
- [Series] Mastering Dependency Injection in Rust: Crafting a Custom Container
Research
Miscellaneous
- Rustic: Enhanced Org Babel integration
- Efficient Logging - Speeding up production code by logging more efficiently
Crate of the Week
This week's crate is WhenFS, a FUSE filesystem that misuses your google calendar as storage. And yes, your schedule will look as packed as mine once you store one or two files in there.
Despite yet another week fully devoid of suggestions nor votes, llogiq is reasonably pleased with his choice.
Please submit your suggestions and votes for next week!
Calls 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:
RFCs
- No calls for testing were issued this week.
Rust
- No calls for testing were issued this week.
Rustup
- No calls for testing were issued 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.
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.
- rencfs - Abstract file access layer
- rencfs - Add RustCrypto as a feature
- rencfs - File and fs API
- rencfs - io API
- rfs - Coordinator node API)
- rfs - Data node API
- rfs - File upload and changes
- rfs - Communication between Coordinator and Data nodes
- syncoxiders - Two-way sync
- syncoxiders - Sync chunks in parallel
- syncoxiders - Integrate SurrealDB to store metadata
- syncoxiders - Migrate scripts tests to integration tests
- rencfs-desktop - Implement daemon
- Proposal: Deprecate Tokio's LocalSet
If you are a Rust project owner and are looking for contributors, please submit tasks here or through a PR to TWiR or by reaching out on X (Formerly twitter) or Mastodon!
CFP - Events
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.
No Calls for papers or presentations were submitted this week.
If you are an event organizer hoping to expand the reach of your event, please submit a link to the website through a PR to TWiR or by reaching out on X (formerly Twitter) or Mastodon!
Updates from the Rust Project
381 pull requests were merged in the last week
- fix vita build of std and forbid unsafe in unsafe in the os/vita module
derive(SmartPointer)
: require pointee to be maybe sized- add
#[must_use]
to someinto_raw*
functions - add
REDUNDANT_IMPORTS
lint for new redundant import detection - add
f16
andf128
math functions - allow overwriting the output of
rustc --version
- allow setting
link-shared
andstatic-libstdcpp
with CI LLVM - android: remove libstd hacks for unsupported Android APIs
- assert that all attributes are actually checked via
CheckAttrVisitor
and aren't accidentally usable on completely unrelated HIR nodes - better handle suggestions for the already present code and fix some suggestions
- built-in derive: remove
BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE
hack and lint - cleanup sys module to match house style
- create COFF archives for non-LLVM backends
- custom MIR: add support for tail calls
- delegation: second attempt to improve perf
- delegation: support generics for delegation from free functions
- detect non-lifetime binder params shadowing item params
- do not fire unhandled attribute assertion on multi-segment
AttributeType::Normal
attributes with builtin attribute as first segment - don't re-elaborate already elaborated caller bounds in method probe
- elaborate unknowable goals
- emit an error if
#[optimize]
is applied to an incompatible item - enforce supertrait outlives obligations hold when confirming impl
- fix removed
box_syntax
diagnostic if source isn't available - fix the invalid argument type
- ignore
use
declaration reformatting in.git-blame-ignore-revs
- implement
UncheckedIterator
directly forRepeatN
- improve error message when
global_asm!
usesasm!
operands - interpret: on a signed deref check, mention the right pointer in the error
- make
///
doc comments compatible with naked functions - mark
Parser::eat
/check
methods as#[must_use]
- match LLVM ABI in
extern "C"
functions forf128
on Windows - match lowering: Hide
Candidate
from outside the lowering algorithm - more unsafe attr verification
- normalize when equating
dyn
tails in MIR borrowck - on short error format, append primary span label to message
- peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks
- properly mark loop as diverging if it has no breaks
- remove
crate_level_only
fromELIDED_LIFETIMES_IN_PATHS
- revert recent changes to dead code analysis
- set branch protection function attributes
- simplify match based on the cast result of
IntToInt
- structured suggestion for
extern crate foo
whenfoo
isn't resolved in import - temporarily switch
ambiguous_negative_literals
lint to allow - the output in stderr expects panic-unwind
- turn
invalid_type_param_default
into aFutureReleaseErrorReportInDeps
- tweak type inference for
const
operands in inline asm - use
object
inrun-make/symbols-visibility
- use a separate pattern type for
rustc_pattern_analysis
diagnostics - miri: add a flag to do recursive validity checking
- miri: add
miri_start
support - miri: use Scalar consistently in foreign item emulation
- linker: pass fewer search directories to the linker
- use Vec in
instantiate_binder_with_fresh_vars
- change output normalization logic to be linear against size of output
- check divergence value first before doing span operations in
warn_if_unreachable
- accelerate GVN a little
- stabilize Wasm relaxed SIMD
- stabilize unsafe extern blocks (RFC 3484)
- enable
std::io::copy
specialisation forstd::pipe::{PipeReader, PipeWriter}
- rewrite binary search implementation
- implement cursors for
BTreeSet
- implement the
once_wait
feature - configure which platforms have
f16
andf128
enabled by default - hashbrown: implement Default for iterators
- regex: rust nightly removed the lifetime from Pattern
- cargo-miri: better error when we seem to run inside bootstrap but something is wrong
- cargo: build-std: remove hack on creating virtual std workspace
- cargo: config: Adjust MSRV resolve config field name / values
- cargo: publish: Don't strip non-dev features
- cargo: also build manpage for cargo.md
- rustdoc-json: discard non-local inherent impls for primitives
- rustdoc: cleanup
CacheBuilder
code for building search index - rustdoc: fix handling of
Self
type in search index and refactor its representation - rustdoc: make the hover trail for doc anchors a bit bigger
- rustdoc: Make the buttons remain when code example is clicked
- rustdoc: simplify
body
usage - rustfmt: add repo cloning to check-diff crate
- rustfmt: check exit status of git commands spawned by build script
- rustfmt: impl
rewrite_result
for Pat, TuplePatField - clippy: check exit status of subcommands spawned by
rustc_tools_util
- clippy: fix
redundant_closure
false positive with closures has return type contains'static
- clippy: fix
redundant_slicing
when the slice is behind a mutable reference - clippy: fix broken list for lints config
- clippy: fix false positive for
missing_backticks
in footnote references - clippy: limit number of
nonminimal_bool
ops - clippy: lintcheck: force warn all lints
- clippy: make restriction lints use
span_lint_and_then
(a → e) - clippy: make restriction lints use
span_lint_and_then
(q → w) - clippy: remove
multispan_sugg[_with_applicability]
- clippy: remove duplicated
peel_middle_ty_refs
- clippy: simplify lint deprecation
- clippy: use a deterministic number of digits in
rustc_tools_util
commit hashes - clippy: use a single multipart suggestion for
implicit_hasher
- rust-analyzer: implement diagnostic for
await
outside ofasync
- rust-analyzer: load sysroot library via cargo metadata
- rust-analyzer: support inlay hint for more expr with label
- rust-analyzer: apply
IndexMut
obligations for non-assigning mutable index usages - rust-analyzer: errors on method call inferences with elided lifetimes
- rust-analyzer: insert a generic arg for
impl Trait
when lowering generic args - rust-analyzer: insert a tail
Ok(())
for expr block instead of wrapping withOk
- rust-analyzer: panic in path transform with default type parameters
- rust-analyzer: remove AbsPath requirement from linkedProjects
- rust-analyzer: surpress type mismatches in calls with mismatched arg counts
- rust-analyzer: improve crate manifests, adding missing
[package.repository]
and[package.description]
fields - rust-analyzer: segregate syntax and semantic diagnostics
- rust-analyzer: split out syntax-bridge into a separate crate
- rust-analyzer: when josh-proxy screws up the roundtrip, say what the involved commits are
Rust Compiler Performance Triage
This week saw several large improvements caused mostly by the update to LLVM 19. There were some regressions in several pull requests, but most of them were immediately fixed in a follow-up PR.
Triage done by @kobzol. Revision range: 7e3a9718..8c7e0e16
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.0% | [0.2%, 3.8%] | 91 |
Regressions ❌ (secondary) |
1.9% | [0.2%, 19.2%] | 104 |
Improvements ✅ (primary) |
-4.4% | [-15.8%, -0.3%] | 120 |
Improvements ✅ (secondary) |
-3.3% | [-10.4%, -0.2%] | 70 |
All ❌✅ (primary) | -2.1% | [-15.8%, 3.8%] | 211 |
6 Regressions, 3 Improvements, 5 Mixed; 4 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:
- Merge RFC 3529: Add named path bases to cargo
- Merge RFC 3668: Async closures
- Promote aarch64-apple-darwin to Tier 1
- RFC for project goals
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
Rust
- [disposition: merge] Stabilize
raw_ref_op
(RFC 2582) - [disposition: merge] Tracking Issue for
Ready::into_inner()
- [disposition: merge] Tracking issue for thread::Builder::spawn_unchecked
- [disposition: merge] Tracking Issue for is_none_or
- [disposition: merge] CloneToUninit impls
- [disposition: close] Tracking issue for HashMap
OccupiedEntry::{replace_key, replace_entry}
- [disposition: close] Tracking issue for HashMap::raw_entry
- [disposition: merge] Implement DoubleEnded and ExactSize for Take\<Repeat> and Take\<RepeatWith>
- [disposition: merge] Implement owned ops for
HashSet
andBTreeSet
- [disposition: merge] Tracking Issue for
Option::get_or_insert_default
- [disposition: merge] Unify run button display with "copy code" button and with mdbook buttons
- [disposition: merge] Greatly speed up doctests by compiling compatible doctests in one file
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team Tracking Issues or PRs entered Final Comment Period this week.
Language Reference
- [disposition: \<not specified>] Reformat (and only reformat) the inline assembly chapter
Unsafe Code Guidelines
- No Unsafe Code Guideline Tracking Issues or PRs entered Final Comment Period this week.
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-08-07 - 2024-09-04 🦀
Virtual
- 2024-08-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-08-08 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-08-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-08-08 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-08-15 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-08-20 | Virtual (Washington, DC, US) | Rust DC
- 2024-08-21 | Hybrid - Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-08-22 | Virtual | Conf42: Online Tech Events
- 2024-08-22 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-08-22 | Virtual (Karlsruhe, DE) | Karlsruhe Functional Programmers Group
- 2024-08-27 | Virtual | Ardan Labs
- 2024-08-27 | Virtual (Bordeaux, FR) | Rust Bordeaux
- 2024-08-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-08-27 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-28 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-29 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-09-03 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2024-09-04 | Virtual (Indianapolis, IN, US) | Indy Rust
Europe
- 2024-08-14 | Köln/Cologne, DE | Rust Cologne
- 2024-08-14 | Reading, UK | Reading Rust Workshop
- 2024-08-20 | Aarhus, DK | Rust Aarhus
- 2024-08-21 | Nürnberg, DE | Rust Nuremberg
- 2024-08-22 | Manchester, UK | Rust Manchester
- 2024-08-26 | Mainz, DE | Fachschaft Mathematik+Informatik der JGU Mainz
- 2024-08-29 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
North America
- 2024-08-08 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-08-08 | Seattle, WA, US | Seattle Rust User Group
- 2024-08-19 | Minneapolis, MN US | Minneapolis Rust Meetup
- 2024-08-20 | New York, NY, US | Rust NYC
- 2024-08-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-08-21 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-08-28 | Austin, TX, US | Rust ATC
- 2024-08-29 | Nashville, TN, US | Music City Rust Developers
Oceania
- 2024-08-22 | Auckland, NZ | Rust AKL
- 2024-08-27 | Canberra, ACT, AU | Canberra Rust User Group (CRUG)
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
Want to have a crate with a million features? Host your own registry and revel in the combinatorial explosion of choices!
Thanks to Jonas Fassbender 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