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
Official
Foundation
Newsletters
Project/Tooling Updates
- Introducing Hyperlight: Virtual machine-based security for functions at scale
- Introducing Sled, a Rust Library for Creating Spatial LED Strip Lighting Effects
- Redis Shield: A high-performance rate limiting module in Rust using the Token Bucket algorithm
- Cohen: gccrs: An alternative compiler for Rust
- Progress on toolchain security features
- Next-gen builder macro Bon 3.0 release
Observations/Thoughts
- Perhaps Rust needs "defer"
- Rust needs an official specification
- Why is std::pin::Pin so weird?
- Bringing faster exceptions to Rust
- Exploring the Assembly Code generated by Rust Recursive Tree Traversal
- Typed IDs with SeaORM
- Spawning Processes in Linux
- [video] Rust 2024 Project Goals Update & Rust 1.80.1
- [video] Rio: Next generation terminal emulator written in Rust
Rust Walkthroughs
- Parsing arguments in Rust with no dependencies
- Using portable SIMD in stable Rust
- Rust Syn Crate Tutorial: Automate Builder Patterns with Custom Macros
- Tutorial: Implementing JSON parsing
- Impl Snake For Micro:bit - Embedded async Rust on BBC Micro:bit with Embassy
Miscellaneous
Crate of the Week
This week's crate is struct-split, a proc macro to implement partial borrows.
Thanks to Felix 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
- 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.
- Rama — multiple basic/bearer credentials for 'Authorization' server support
- [Rama — implement
take
andreplace
for Context and Extensions](https://github.com/plabayo/rama/issues/353
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
403 pull requests were merged in the last week
- remove the
wasm32-wasi
target from rustc - add a new
wide-arithmetic
feature for WebAssembly - add Unicode block-drawing compiler output support
- add
{ignore,needs}-{rustc,std}-debug-assertions
directive support - add a default implementation for
CodegenBackend::link
- add discriminators to DILocations when multiple functions are inlined into a single point
- add v9, v8plus, and leoncasa target feature to sparc and use v8plus in
create_object_file
- additional tests to ensure let is rejected during parsing
- arbitrary self types v2: (unused) Receiver trait
- basic inline assembly support for SPARC and SPARC64
- coverage: extract safe FFI wrapper functions to
llvm_cov
- coverage: restrict empty-span expansion to only cover
{
and}
- coverage: simplify parts of coverage graph creation
- do not filter empty lint passes & re-do CTFE pass
- do not reveal opaques in the param-env, we got lazy norm instead
- do not trust download-rustc=if-unchanged on CI for now
- don't suggest
.into_iter()
on iterators - don't use
maybe_unwrap_block
when checking for macro calls in a block expr - dont suggest
use<impl Trait>
when we have an edition-2024-related borrowck issue - drop "gnu" in the target env for FreeBSD armv6/7
- emit warning when calling/declaring functions with unavailable vectors
- enforce that raw lifetimes must be valid raw identifiers
- ensure that tail expr receive lifetime extension
- fix parens mangled in shared mut static lint suggestion
- get rid of
check_opaque_type_well_formed
- make
RustString
an extern type to avoidimproper_ctypes
warnings - make
Ty::primitive_symbol
recognizestr
- make
fn_abi_sanity_check
a bit stricter - make sure that we suggest turbofishing the right type arg for never suggestion
- mark some target features as 'forbidden' so they cannot be (un)set with -Ctarget-feature
- only disable cache if predicate has opaques within it
- passWrapper: adapt for new parameter in LLVM
- prefer
pub(super)
inunreachable_pub
lint suggestion - properly suggest
E::assoc
when we encounterE::Variant::assoc
- provide placeholder generics for traits in "no method found for type parameter" suggestions
- reject raw lifetime followed by
'
, like regular lifetimes do - remove 'platform-intrinsic' ABI leftovers
- remove
rustc_session::config::rustc_short_optgroups
- remove support for
rustc_safe_intrinsic
attribute; userustc_intrinsic
functions instead - remove unnecessary pub
enum
glob-imports fromrustc_middle::ty
- require
const_impl_trait
gate for all conditional and trait const calls - revert using
HEAP
static in Windows alloc - set "symbol name" in raw-dylib import libraries to the decorated name
- simplify FFI calls for
-Ztime-llvm-passes
and-Zprint-codegen-stats
- simplify some places that deal with generic parameter defaults
- simplify the internal API for declaring command-line options
- suggest swapping LHS and RHS when RHS impls
PartialEq<lhs_ty>
- tweak E0320 overflow error wording
- tweak detection of multiple crate versions to be more encompassing
- use
download-rustc="if-unchanged"
as a global default - use a separate dir for r-a builds consistently in helix config
- use verbose for path separator suggestion
pointee_info_at
: fix logic for recursing into enumsrustc_codegen_llvm
: Add a new 'pc' option to branch-protectionrustc_target
: more target string fixes for LLVM 20- interpret:
get_alloc_info
: also return mutability - StableMIR: A few fixes to pretty printing
- StableMIR: API to retrieve definitions from crates
- miri: fix linux-futex test being accidentally disabled
- miri: get/set thread name shims return errors for invalid handles
- miri: preparing for merge from rustc
- miri: pthread-sync test: avoid confusing error when running with preemption
- miri: remove MutexID list
- miri: renamed this arguments to ecx
- miri: stacked borrows tests: add those that fail under TB
- miri: standardized variable names for InterpCx
- miri: store futexes in per-allocation data rather than globally
- miri: sync support: dont implicitly clone inside the general sync machinery
- stabilise
const_char_encode_utf16
- stabilize Arm64EC inline assembly
- stabilize WebAssembly
multivalue
, reference-types, and tail-call
target features - stabilize
UnsafeCell::from_mut
- stabilize s390x inline assembly
- add new unstable feature
const_eq_ignore_ascii_case
- make
char::is_whitespace
unstably const - inline
str::repeat
- core/fmt: Replace checked slice indexing by unchecked to support panic-free code
- add Set entry API
- implement
div_ceil
forNonZero<unsigned>
- implement
file_lock
feature - initialize channel
Block
s directly on the heap - disable
f16
on platforms that have recursion problems - cargo: warnings: add build.warnings option
- cargo: test: Make redactions consistent with snapbox
- cargo: git: do not validate submodules of fresh checkouts
- cargo: normalize the
target
paths - cargo: refactor: clone-on-write when needed for InternedString
- cargo: rustfix: replace special-case duplicate handling with error
- rustdoc-search: show type signature on type-driven SERP
- rustdoc-search: simplify rules for generics and type params
- bindgen: fix
field_visibility
not called for new-type aliases - bindgen: fix
unsafe_op_in_unsafe_fn
when using dynamic librarys andwrap_unsafe_ops
- handle separate prefixes in clippy rules
- clippy:
no_mangle_with_rust_abi
: properly position the suggested ABI - clippy: add match-based manual try to
clippy::question_mark
- clippy: collect attribute spans early for disallowed macros
- clippy: fix
large_include_file
lint being triggered all the time by doc comments - clippy: fix:
identity_op
suggestions use correct parenthesis - rust-analyzer: editors/code: change minimum VS Code from 1.78 to 1.83
- rust-analyzer: use completion item indices instead of property matching when searching for the completion item to resolve
Rust Compiler Performance Triage
Regressions primarily in doc builds. No significant changes in cycle or max-rss counts.
Triage done by @simulacrum. Revision range: 27e38f8f..d4822c2d
1 Regressions, 1 Improvements, 4 Mixed; 1 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: merge] [RFC] Thread spawn hook (inheriting thread locals)
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking issue for
const_size_of_val
andconst_align_of_val
- [disposition: merge] mark is_val_statically_known intrinsic as stably const-callable
- [disposition: merge] Tracking issue for
const <*const T>::is_null
- [disposition: merge] Tracking issue for const
Pin
methods - [disposition: merge] Stabilize
const_atomic_from_ptr
Cargo
- [disposition: merge] feat(resolver): Stabilize resolver v3
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
Upcoming Events
Rusty Events between 2024-11-13 - 2024-12-11 🦀
Virtual
- 2024-11-14 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-14 | Virtual and In-Person (Lehi, UT, US) | Utah Rust
- 2024-11-14 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-11-15 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-19 | Virtual (Los Angeles, CA, US) | DevTalk LA
- 2024-11-19 | Virtual (Washington, DC, US) | Rust DC
- 2024-11-20 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-11-20 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-11-21 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-11-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-21 | Virtual (Rotterdam, NL) | Bevy Game Development
- 2024-11-25 | Virtual (Bratislava, SK) | Bratislava Rust Meetup Group
- 2024-11-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-11-28 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-28 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-12-03 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2024-12-04 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-12-05 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-12-10 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-12-11 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Africa
- 2024-12-07 | Virtual( Kampala, UG) | Rust Circle Kampala
Asia
- 2024-11-28 | Bangalore/Bengaluru, IN | Rust Bangalore
- 2024-11-30 | Tokyo, JP | Rust Tokyo
Europe
- 2024-11-13 | Reading, UK | Reading Rust Workshop
- 2024-11-14 | Stockholm, SE | Stockholm Rust
- 2024-11-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-11-19 | Paris, FR | Rust Paris
- 2024-11-21 | Edinburgh, UK | Rust and Friends
- 2024-11-21 | Madrid, ES | MadRust
- 2024-11-21 | Oslo, NO | Rust Oslo
- 2024-11-23 | Basel, CH | Rust Basel
- 2024-11-26 | Warsaw, PL | Rust Warsaw
- 2024-11-27 | Dortmund, DE | Rust Dortmund
- 2024-11-28 | Aarhus, DK | Rust Aarhus
- 2024-11-28 | Augsburg, DE | Rust Meetup Augsburg
- 2024-11-28 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-11-28 | Gdansk, PL | Rust Gdansk
- 2024-11-28 | Hamburg, DE | Rust Meetup Hamburg
- 2024-11-28 | Prague, CZ | Rust Prague
- 2024-12-03 | Copenhagen, DK | Copenhagen Rust Community
- 2024-12-04 | Oxford, UK | Oxford Rust Meetup Group
- 2024-12-05 | Olomouc, CZ | Rust Moravia
- 2024-12-06 | Moscow, RU | RustCon RU
- 2024-12-11 | Reading, UK | Reading Rust Workshop
North America
- 2024-11-14 | Mountain View, CA, US | Hacker Dojo
- 2024-11-14 | Portland, OR, US | PDXRust
- 2024-11-15 | Mexico City, DF, MX | Rust MX
- 2024-11-15 | Somerville, MA, US | Boston Rust Meetup
- 2024-11-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-11-19 | Spokane, WA, US | Spokane Rust
- 2024-11-23 | Boston, MA, US | Boston Rust Meetup
- 2024-11-25 | Ferndale, MI, US | Detroit Rust
- 2024-11-26 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-11-27 | Austin, TX, US | Rust ATX
- 2024-11-28 | Mountain View, CA, US | Hacker Dojo
- 2024-12-05 | St. Louis, MO, US | STL Rust
- 2024-12-10 | Ann Arbor, MI, US | Detroit Rust
Oceania
- 2024-12-08 | Canberra, AU | Canberra Rust User Group
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
Netstack3 encompasses 63 crates and 60 developer-years of code. It contains more code than the top ten crates on crates.io combined. ... For the past eleven months, they have been running the new networking stack on 60 devices, full time. In that time, Liebow-Feeser said, most code would have been expected to show "mountains of bugs". Netstack3 had only three; he attributed that low number to the team's approach of encoding as many important invariants in the type system as possible.
– Joshua Liebow-Feeser at RustConf, as reported by Daroc Alden on Linux Weekly News
Thanks to Anton Fetisov 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