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
- musi lili retro game engine 0.1 released
- Nutype 0.5.1: better no_std support and bug fixes
- Ibis 0.2.0 - Federated Wiki with Shiny Redesign, based on Diesel, Actix and Leptos
- dagrs 0.4.2 - Flow-based Programming in Rust
- Avian Physics 0.2
- Slint 1.9
- gitoxide - december 2024
Observations/Thoughts
- Dropping Hyper
- Embedding Lua in sqleibniz with Rust
- What would it take to add refinement types to Rust?
- Context-Generic Programming
- Building a Secure Hierarchical Key Derivation System in Rust
- Streamlined dataflow analysis code in rustc
- Four limitations of Rust’s borrow checker
- A Review of Rust in 2024: What Next?
- My actions-rust-cross Action Now Has Built-In Caching
- Transforming Rust Development: How Windsurf AI Tripled Productivity
Rust Walkthroughs
- How to build and publish multi-platform Rust binaries via Github actions
- Compiling C to Safe Rust, Formalized
- Unnecessary Optimization in Rust: Hamming Distances, SIMD, and Auto-Vectorization
Miscellaneous
Crate of the Week
This week's crate is OmniLED, a helper to display things like time or audio volumne on a LED matrix that some peripherials (such as gaming keyboards) have.
Thanks to llogiq for the suggestion!
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
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.
- Rama — provide constants for common (network) hosts to rama-net's Host
- Rama — support vec/array impl for DnsResolver
- Rama — support HAR exporter (http) layer in rama
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.
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
398 pull requests were merged in the last week
- -Znext-solver: modify candidate preference rules
Variants::Single
: do not use invalid VariantIdx for uninhabited enumsrustc_borrowck
: Suggest changing&raw const
to&raw mut
if applicable- abstract
ProcThreadAttributeList
into its ownstruct
- add
--doctest-compilation-args
option to add compilation flags to doctest compilation - add
ignore-rustc-debug-assertions
totests/ui/associated-consts/issue-93775.rs
- align
{i686,x86_64}-win7-windows-msvc
to their parent targets - also lint on option of function pointer comparisons
- always run
tail_expr_drop_order
lint in promoted MIR query - begin to implement type system layer of unsafe binders
- cleanup
TypeVerifier
- cleanup region handling: add
LateParamRegionKind
- correctly note item kind in
NonConstFunctionCall
error message - coverage: dismantle
map_data.rs
by moving its responsibilities elsewhere - coverage: store coverage source regions as
Span
until codegen (take 2) - detect invalid exprs in parser used by pretty-printer tests
- detect missing
.
in method chain inlet
bindings and statements - don't ICE on illegal
dyn*
casts - explain why a type is not eligible for
impl PointerLike
- fix
-Z input-stats
ordering - fix const conditions for RPITITs
- fix effect predicates from item bounds in old solver
- fix logical error with what text is considered whitespace
- fix parenthesization of chained comparisons by pretty-printer
- forbid overwriting types in typeck
- foundations of location-sensitive polonius
- handle
DropKind::ForLint
in coroutines correctly - handle fndef rendering together with signature rendering
- handle member constraints directly in the mir type checker
- hide
= _
as associated constant value inside impl blocks - make sure we don't lose default
struct
value when formattingstruct
- make sure we handle
backwards_incompatible_lint
drops appropriately in drop elaboration - make sure we note ambiguity causes on positive/negative impl conflicts
- move
lint_unused_mut
into sub-fn - next-solver: disable unnecessary hack
- pass FnAbi to
find_mir_or_eval_fn
- point at lint name instead of whole attr for gated lints
- precedence improvements: closures and jumps
- promote powerpc64le-unknown-linux-musl to tier 2 with host tools
- re-export more
rustc_span::symbol
things fromrustc_span
- reduce the amount of explicit
FatalError.raise()
- restrict
#[non_exaustive]
on structs with default field values - simplify
SwitchInt
handling - support pretty-printing
dyn*
trait objects - use
PtrMetadata
instead ofLen
in slice drop shims - use links to edition guide for edition migrations
- win: use POSIX rename semantics for
std::fs::rename
if available - mir-opt: a sub-BB of a cleanup BB must also be a cleanup BB in
EarlyOtherwiseBranch
- miri: add
track_caller
to thread spawning methods for better backtraces - miri: add warning explaining the limitations of the native code mode
- miri: implement blocking
unnamed_socket
- miri: implement many-seeds mode directly in the driver
- miri: provide a way to compare benchmark results with baseline
- speed up
Parser::expected_tokens
- improve
dependency_format
a bit - overhaul token cursors
- fix perf regression in rustdoc after hir attributes
- stabilize
#[diagnostic::do_not_recommend]
- core: fix const
ptr::swap_nonoverlapping
when there are pointers at odd offsets - add a range argument to
vec.extract_if
- optimize
is_ascii
forstr
and[u8]
further - implement
PointerLike
forisize
,NonNull
,Cell
,UnsafeCell
, andSyncUnsafeCell
- unimplement
PointerLike
for trait objects - hashbrown: add 128-bit SIMD implementation for LoongArch
- compiler-builtins: fix a bug in
abs_diff
- cargo: build-std: make Resolve align to what to build
- cargo: cargo-package: add more traces
- cargo: cargo-rustc: stabilize higher precedence trailing flags
- cargo: package: show dirty filepaths relative to git workdir
- cargo: package: use relpath to cwd for vcs dirtiness report
- cargo: add the
test
cfg as a well known cfg before of compiler change - cargo: do not hash absolute sysroot path into stdlib crates metadata
- cargo: fixed the error message for a user to open the crate
- rustfmt: fix incorrect strip r# prefix from labels
- clippy: add allow-indexing-slicing-in-tests option
- clippy: do not mark attributes with unknown namespace as useless
- clippy: don't trigger
filter_map_identity
with an iterator from an empty array - clippy: use multipart suggestion in
unnecessary_to_owned
- rust-analyzer: clear flycheck diagnostics more granularly
- rust-analyzer: fix AsmOption rule in rust.ungram
- rust-analyzer: consider both completion detail fields in
to_proto
- rust-analyzer: delay initial flycheck until after build scripts
- rust-analyzer: do not ask the client to resolve for non existing label details
- rust-analyzer: don't trigger paren wrapping typing handler after idents
- rust-analyzer: fix a case where completion was unable to expand a macro
- rust-analyzer: fix empty check diagnostics not marking files as changed
- rust-analyzer: fix flycheck workspace when requested but package was found
- rust-analyzer: fix pretty-printing of
@
patterns - rust-analyzer: properly check if workspace flychecking is allowed
- rust-analyzer: reduce applicability of
unnecessary_async
assist - rust-analyzer: remove
always!
check forfile_id
inrunnables
- rust-analyzer: remove salsa from proc-macro server dep tree
- rust-analyzer: taking a raw ref of a deref is always safe
Rust Compiler Performance Triage
We missed triage last week due to some process issues, so this triage includes two weeks of data. The overall result is positive, due to parser optimizations (#133793), trait solving optimizations (#134501, #132325) and bumping the cc crate (#134505), which improved the performance of C/C++ dependencies of the compiler.
Triage done by @kobzol. Revision range: 1b3fb316..0eca4dd3
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.5% | [0.3%, 0.8%] | 3 |
Regressions ❌ (secondary) |
1.0% | [1.0%, 1.0%] | 1 |
Improvements ✅ (primary) |
-1.8% | [-7.5%, -0.3%] | 254 |
Improvements ✅ (secondary) |
-1.3% | [-5.4%, -0.3%] | 224 |
All ❌✅ (primary) | -1.8% | [-7.5%, 0.8%] | 257 |
4 Regressions, 10 Improvements, 12 Mixed; 9 of them in rollups 90 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
Rust
- [disposition: merge] Specify the behavior of
file!
- [disposition: merge] Stabilize
feature(trait_upcasting)
- [disposition: merge] Stabilize
derive(CoercePointee)
- [disposition: merge] Stabilize
asm_goto feature gate
- [disposition: merge] Tracking Issue for get_many_mut
- [disposition: merge]
--nocapture
doesn't follow common CLI conventions, making it a stumbling block to people debugging failures - [disposition: merge] Tracking Issue for
sub_ptr
(featureptr_sub_ptr
) - [disposition: merge] From iterator for more tuples
- [disposition: merge] Tracking Issue for const_swap
- [disposition: merge] Tracking issue for const
alloc::Layout
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team Proposals entered Final Comment Period this week.
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] RFC: Set CARGO_CHECK environment variable when type checking
- [new] unsized params in traits
- [new] Convert "reassignment of immutable local" and "mutable borrow of immutable local" from a hard error to a deny-by-default lint
Upcoming Events
Rusty Events between 2024-12-25 - 2025-01-22 🦀
Virtual
- 2024-12-26 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2025-01-02| Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2025-01-04 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2025-01-06 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-01-07 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-01-08 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-01-09 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2025-01-09 | Miami, FL, US | Rust Miami
- 2025-01-09 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2025-01-14 | Virtual (Dallas, TX, US) | Dallas Rust User Meetup
- 2025-01-14 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-01-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2025-01-16 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2025-01-21 | Virtual (Tel Aviv-Yafo, IL) | Rust 🦀 TLV
- 2025-01-21 | Virtual (Washington, DC, US) | Rust DC
- 2025-01-22 | Virtual (Rotterdam, NL) | Bevy Game Development
Asia
- 2025-01-12 | Virtual (Tel Aviv-Yafo, IL) | Rust 🦀 TLV
Europe
- 2025-01-08 | Reading, UK | Reading Rust Workshop
- 2025-01-09 | Oslo, NO | Rust Oslo
- 2025-01-16 | Karlsruhe, DE | Rust Hack & Learn Karlsruhe
- 2025-01-21 | Ghent, BE | Systems Programming Ghent
- 2025-01-21 | Leipzig, SN, DE | Rust - Modern Systems Programming in Leipzig
North America
- 2024-12-26 | Mountain View, CA, US | Hacker Dojo
- 2025-01-10 | Boston, MA, US | Boston Rust Meetup
- 2025-01-16 | Nashville, TN, US | Music City Rust Developers
- 2025-01-18 | Boston, MA, US | Boston Rust Meetup
- 2025-01-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2025-01-22 | 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
It's only a transmute if it's from the transmute region of std; otherwise it's just sparkling unsafety.
Thanks to Josh for the self-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