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
rPGP 0.14.0 (a pure Rust implementation of OpenPGP) now supports the new RFC 9580
Official
Project/Tooling Updates
- Two weeks of binsider
- egui 0.29
- pantheon: Parsing command line arguments
- System76 COSMIC Alpha 2 Released
- Linus and Dirk on succession, Rust, and more
- What the Nova GPU driver needs
- Getting PCI driver abstractions upstream
- Coccinelle for Rust
- An update on gccrs development
- BTF, Rust, and the kernel toolchain
- tokio-graceful 0.2.0: support shutdown trigger delay and forceful shutdown
- Cargo Watch 8.5.3: the final update, as the project goes dormant
Observations/Thoughts
- Best practices for error handling in kernel Rust
- A discussion of Rust safety documentation
- (Re)Using rustc components in gccrs
- Whence '\n'?
- Should you use Rust in LLM based tools for performance?
- Code Generation in Rust vs C++26
- Rust adventure to develop a Game Boy emulator — Part 3: CPU Instructions
- Improved Turso (libsql) ergonomics in Rust
- Rewriting Rust
- Making overwrite opt-in #crazyideas
- Rust needs a web framework for lazy developers
- Safety Goggles for Alchemists
- Beyond multi-core parallelism: faster Mandelbrot with SIMD
- Nine Rules for Running Rust on WASM WASI
- Rust needs an extended standard library
Rust Walkthroughs
- New Book: "100 Exercises to Learn Rust: A hands-on course by Mainmatter".
- Rust interop in practice: speaking Python and Javascript
- [Series] Mastering Dependency Injection in Rust: Despatma with Lifetimes
- Sqlx4k - Interoperability between Kotlin and Rust, using FFI (Part 1)
- Serde for Trait objects
- [video] Build with Naz : Rust clap colorization
Miscellaneous
Crate of the Week
This week's crate is binsider, a terminal UI tool for analyzing binary files.
Despite yet another week without suggestions, llogiq is appropriately 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.
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.
- Rustikon CFP | Event Page | Closes 2024-10-13 | Warsaw, PL | Event 2025-03-26
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
451 pull requests were merged in the last week
- add new Tier-3 target:
loongarch64-unknown-linux-ohos
- add RISC-V vxworks targets
cfg_match
Generalize inputs- add InProgress ErrorKind gated behind
io_error_inprogress
feature - allow instantiating object trait binder when upcasting
- allow instantiating trait object binder in ptr-to-ptr casts
- ban combination of GCE and new solver
- collect relevant item bounds from trait clauses for nested rigid projections
- diagnostics: wrap fn cast suggestions in parens when needed
- don't trap into the debugger on panics under Linux
- enable compiler fingerprint logs in verbose mode
- fix
adt_const_params
leaking{type error}
in error msg - fix diagnostics for coroutines with () as input
- fix error span if arg to
asm!()
is a macro call - fix the misleading diagnostic for
let_underscore_drop
on type withoutDrop
implementation - fix: ices on virtual-function-elimination about principal trait
- implement trim-paths sysroot changes - take 2 (RFC #3127)
- improve compile errors for invalid ptr-to-ptr casts with trait objects
- initial std library support for NuttX
- make
clashing_extern_declarations
considering generic args for ADT field - mark some more types as having insignificant dtor
- on implicit
Sized
bound on fn argument, point at type instead of pattern - only add an automatic SONAME for Rust dylibs
- pass Module Analysis Manager to Standard Instrumentations
- pass correct HirId to
late_bound_vars
in diagnostic code - preserve brackets around if-lets and skip while-lets
- properly elaborate effects implied bounds for super traits
- reference UNSPECIFIED instead of
INADDR_ANY
injoin_multicast_v4
- reject leading unsafe in
cfg!(...)
and--check-cfg
- rename
standalone
doctest attribute intostandalone_crate
- reorder stack spills so that constants come later
- separate collection of crate-local inherent impls from error tracking
- simple validation for unsize coercion in MIR validation
- check vtable projections for validity in miri
- miri: implements
arc4random_buf
shim for freebsd/solarish platforms - miri: make returning io errors more uniform and convenient
- miri: refactor
return_read_bytes_and_count
andreturn_written_byte_count_or_error
- miri: switch custom target JSON test to a less exotic target
- skip query in
get_parent_item
when possible - stabilize
const_cell_into_inner
- stabilize
const_intrinsic_copy
- stabilize
const_refs_to_static
- stabilize
option_get_or_insert_default
- improve autovectorization of
to_lowercase
/to_uppercase
functions - add
File
constructors that return files wrapped with a buffer - add
must_use
attribute tolen_utf8
andlen_utf16
- add
optimize_for_size
variants for stable and unstable sort as well asselect_nth_unstable
- fix
read_buf
uses instd
- make ptr metadata functions callable from stable const fn
- mark
make_ascii_uppercase
andmake_ascii_lowercase
in[u8]
andstr
as const - fix some cfg logic around
optimize_for_size
and 16-bit targets - hook up
std::net
to wasi-libc on wasm32-wasip2 target - compute
RUST_EXCEPTION_CLASS
from native-endian bytes - hashbrown: change signature of
get_many_mut
APIs - regex: add
SetMatches::matched_all
- cargo timings: support dark color scheme in HTML output
- cargo toml: Add
autolib
- cargo rustc: give trailing flags higher precedence on nightly
- cargo config: Don't double-warn about
$CARGO_HOME/config
- cargo compiler: zero-copy deserialization when possible
- cargo: add
CARGO_MANIFEST_PATH
env variable - cargo: lockfile path implies --locked on cargo install
- cargo: make lockfile v4 the default
- cargo: correct error count for
cargo check --message-format json
- cargo perf: improve quality of completion performance traces
- cargo test: add support for features in the sat resolver
- cargo test: relax compiler panic assertions
- cargo test: relax panic output assertion
- rustdoc perf: clone
clean::Item
less - rustdoc: do not animate :target when user prefers reduced motion
- rustdoc: inherit parent's stability where applicable
- rustdoc: rewrite stability inheritance as a doc pass
- rustdoc: copy correct path to clipboard for modules/keywords/primitives
- rustdoc: redesign toolbar and disclosure widgets
- rustdoc toolbar: Adjust spacings and sizing to improve behavior with over-long names
- add
field@
andvariant@
doc-link disambiguators - rustfmt: add
style_edition
2027 - clippy:
wildcard_in_or_patterns
will no longer be triggered for types annotated with#[nonexhaustive]
- clippy:
invalid_null_ptr_usage
: fix false positives forstd::ptr::slice_from_raw_parts
functions - clippy: add reasons for or remove some
//@no-rustfix
annotations - clippy: extend
needless_lifetimes
to suggest elidingimpl
lifetimes - clippy: specifying reason in
expect(clippy::needless_return)
no longer triggers false positive - clippy: ignore
--print
/-Vv
requests inclippy-driver
- clippy: remove method call receiver special casing in
unused_async
lint - clippy: suggest
Option<&T>
instead of&Option<T>
- clippy: convert
&Option<T>
toOption<&T>
- clippy: use
std_or_core
to determine the correct prefix - rust-analyzer: building before a debugging session was restarted
- rust-analyzer: index workspace symbols at startup rather than on the first symbol search
- rust-analyzer: provide an config option to not set
cfg(test)
- rust-analyzer: ambiguity with CamelCase diagnostic messages, align with rustc warnings
- rust-analyzer: better support references in consuming postfix completions
- rust-analyzer: consider lifetime GATs object unsafe
- rust-analyzer: don't report a startup error when a discover command is configured
- rust-analyzer: fix a bug in span map merge, and add explanations of how span maps are stored
- rust-analyzer: fix name resolution when an import is resolved to some namespace and then later in the algorithm another namespace is added
- rust-analyzer: fix resolution of label inside macro
- rust-analyzer: handle block exprs as modules when finding their parents
- rust-analyzer: pass all-targets for build scripts in more cli commands
Rust Compiler Performance Triage
A quiet week without too many perf. changes, although there was a nice perf. win on documentation builds thanks to [#130857](https://github.com/rust-lang/rust/. Overall the results were positive.
Triage done by @kobzol. Revision range: 4cadeda9..c87004a1
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.5% | [0.2%, 0.8%] | 11 |
Regressions ❌ (secondary) |
0.3% | [0.2%, 0.6%] | 19 |
Improvements ✅ (primary) |
-1.2% | [-14.9%, -0.2%] | 21 |
Improvements ✅ (secondary) |
-1.0% | [-2.3%, -0.3%] | 5 |
All ❌✅ (primary) | -0.6% | [-14.9%, 0.8%] | 32 |
3 Regressions, 4 Improvements, 3 Mixed; 2 of them in rollups 47 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
- [disposition: postpone] Make
cargo install
respect lockfiles by default - [disposition: postpone] RFC: Templating
CARGO_TARGET_DIR
to make it the parent of all target directories - [disposition: postpone] Cargo: providing artifacts (for artifact dependencies) via build.rs
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking Issue for constify-ing non-trait
Duration
methods - [disposition: merge] Tracking Issue for const
Result
methods - [disposition: merge] Tracking issue for const
Option
functions - [disposition: merge] Tracking Issue for
slice_first_last_chunk
feature (slice::{split_,}{first,last}_chunk{,_mut}
) - [disposition: merge] Partially stabilize const_pin
- [disposition: merge] Check elaborated projections from dyn don't mention unconstrained late bound lifetimes
- [disposition: merge] Stabilize the
map
/value
methods onControlFlow
- [disposition: merge] Do not consider match/let/ref of place that evaluates to
!
to diverge, disallow coercions from them too - [disposition: merge] Tracking issue for const slice::from_raw_parts_mut (const_slice_from_raw_parts_mut)
- [disposition: merge] Stabilize
const {slice,array}::from_mut
- [disposition: merge] Tracking Issue for
feature(const_slice_split_at_mut)
- [disposition: merge] Tracking Issue for
str::from_utf8
_unchecked_mut as aconst fn
- [disposition: merge] Tracking Issue for
#![feature(const_unsafecell_get_mut)]
- [disposition: merge] Tracking Issue for const_maybe_uninit_assume_init
- [disposition: merge] Tracking issue for
#![feature(const_float_classify)]
- [disposition: merge] Tracking Issue for const_str_as_mut
- [disposition: merge] Tracking Issue for
pin_deref_mut
- [disposition: merge] Tracking Issue for
UnsafeCell::from_mut
- [disposition: merge] Tracking Issue for
BufRead::skip_until
Cargo
- [disposition: merge] docs(charter): Declare new Intentional Artifacts as 'small' changes
Language Team
- [disposition: merge] Meeting proposal: rename "object safety" to "dyn compatibility"
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline Tracking Issues or PRs entered Final Comment Period this week.
New and Updated RFCs
- [new] num::WrappingFrom trait for conversions between integers
- [new] Add helper methods on primitive pointer types for pointer tagging
Upcoming Events
Rusty Events between 2024-10-02 - 2024-10-30 🦀
Virtual
- 2024-10-02 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2024-10-02 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-10-02 | Virtual (Vancouver, BC, CA) | Vancouver Postgres
- 2024-10-03 | Virtual | Women in Rust
- 2024-10-03 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-10-10 | Virtual | Women in Rust
- 2024-10-10 | Virtual (Barcelona, ES) | BcnRust + Codurance + Heavy Duty Builders
- 2024-10-10 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-10 | Virtual (Girona, ES) | Rust Girona
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-14 | Virtual | Women in Rust
- 2024-10-15 | Virtual (Washington, DC, US) | Rust DC
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17 | Virtual | Women in Rust
- 2024-10-17| Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-22 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-10-24 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-26 | Virtual (Gdansk, PL) | Stacja IT Trójmiasto
- 2024-10-29 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-10-05 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-10-09 | Subang Jaya / Kuala Lumpur, Selangor, MY | Rust Malaysia
- 2024-10-17 - 2024-10-18 | Beijing, CN | Global Open-Source Innovation Meetup (GOSIM)
- 2024-10-19 | Bangalore/Bengaluru, IN | Rust Bangalore
Europe
- 2024-10-02 | Oxford, UK | Oxfrod Rust Meetup Group
- 2024-10-02 | Stockholm, SE | Stockholm Rust
- 2022-10-03 | Nürnberg, DE | Rust Nurnberg DE
- 2024-10-03 | Oslo, NO | Rust Oslo
- 2024-10-09 | Reading, UK | Reading Rust Workshop
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-15 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-10-17 | Darmstadr, DE | Rust Rhein-Main
- 2024-10-15 | Cambridge, UK | Cambridge Rust Meetup
- 2024-10-15 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-10-15 | Munich, DE | Rust Munich
- 2024-10-16 | Manchester, UK | Rust Manchester
- 2024-10-17 | Barcelona, ES | BcnRust
- 2024-10-17 | Bern, CH | Rust Bern
- 2024-10-22 | Warsaw, PL | Rust Warsaw
- 2024-10-28 | Paris, FR | Rust Paris
- 2024-10-29 | Aarhus, DK | Rust Aarhus
- 2024-10-30 | Hamburg, DE | Rust Meetup Hamburg
North America
- 2024-10-03 | Boston, MA, US | SquiggleConf
- 2024-10-03 | Montréal, QC, CA | Rust Montréal
- 2024-10-03 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-10-03 | St. Louis, MO, US | STL Rust
- 2024-10-04 | Mexico City, DF, MX | Rust MX
- 2024-10-05 | Cambridge, MA, US | Boston Rust Meetup
- 2024-10-08 | Detroit, MI, US | Detroit Rust
- 2024-10-15 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-10-19 | Cambridge, MA, US | Boston Rust Meetup
- 2024-10-23 | Austin, TX, US | Rust ATX
- 2024-10-27 | Cambridge, MA, US | Boston Rust Meetup
Oceania
- 2024-10-29 | 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
Just to provide another perspective: if you can write the programs you want to write, then all is good. You don't have to use every single tool in the standard library.
I co-authored the Rust book. I have twelve years experience writing Rust code, and just over thirty years of experience writing software. I have written a macro_rules macro exactly one time, and that was 95% taking someone else's macro and modifying it. I have written one proc macro. I have used Box::leak once. I have never used Arc::downgrade. I've used Cow a handful of times.
Don't stress yourself out. You're doing fine.
Thanks to Jacob Finkelman 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