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
Project/Tooling Updates
- git-cliff 2.5.0 is released!
- Ferrocene 24.08.0 now available!
- Go wild: Wildcard support in Rules and a new open-source wildcard crate
- Why am I writing a Rust compiler in C?
- Current zlib-rs performance
- Bon builder generator 2.0 release 🎉
- Meilisearch 1.10
Observations/Thoughts
- Rust dylib rabbit holes
- I sped up serde_json strings by 20%
- Using StringView / German Style Strings to Make Queries Faster: Part 1 - Reading Parquet
- Rust as My First Language
- Doctests - How were they improved?
- MiniJinja: Learnings from Building a Template Engine in Rust
- Standards for use of unsafe Rust in the kernel
- Rust vs C++: A Real-World Perspective (interview with Tyler Weaver)
- A Piece of UNIX History in Rust
- Why Amazon, Cloudflare and Discord are building servers in Rust but you should probably not
Rust Walkthroughs
- Let the API protect you
- Packaging a Rust Program for Fedora
- Building a Bevy Plugin for Rolling Dice
- [video] Implementing a Lox interpreter in Rust
- [video] Command line tools: Implementing wc in Rust
- [video] Explore Linux TTY, process, signals w/ Rust - Part 1/3 (background info)
Research
Miscellaneous
- Can DARPA’s TRACTOR Pull C to Rust for Memory-Safe Overhaul?
- Crafting a Blockchain in Go and Rust: A Comparative Journey — Private keys, Public Keys and Signatures [Part 1]
- [video] A Multiplatform Mobile Navigation SDK with Rust at the Core
Crate of the Week
This week's crate is wtx, a batteries-included web application framework.
Thanks to Caio for the self-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.
No Calls for participation were submitted this week.
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
429 pull requests were merged in the last week
- add Trusty OS as tier 3 target
- CFI: erase regions when projecting ADT to its transparent non-1zst field
- add missing module flags for CFI and KCFI sanitizers
repr_transparent_external_private_fields
: special-case some std types- add a special case for
CStr
/CString
in theimproper_ctypes
lint - avoid extra
cast()
s afterCStr::as_ptr()
- const checking: properly compute the set of transient locals
- ctfe: make CompileTimeInterpCx type alias public
- detect
*
operator on!Sized
expression - do not ICE on non-ADT rcvr type when looking for crate version collision
- don't consider locals to shadow inner items' generics
- don't generate functions with the
rustc_intrinsic_must_be_overridden
attribute - don't trigger refinement lint if predicates reference errors
- fix extern crates not being hidden with
doc(hidden)
- fix handling of macro arguments within the
dropping_copy_types
lint - implement
-Z embed-source
(DWARFv5 source code embedding extension) - improve diagnostic-related lints:
untranslatable_diagnostic
&diagnostic_outside_of_impl
- interpret: immTy: tighten sanity checks in offset logic
- lint on tail expr drop order change in Edition 2024
- llvm-wrapper: adapt for LLVM 20 API changes
- make
ArgAbi::make_indirect_force
more specific - make
writes_through_immutable_pointer
a hard error - more work on
zstd
compression - mv
build_reduced_graph_for_external_crate_res
into Resolver - pal/hermit: correctly round up microseconds in
Thread::sleep
- panicking: improve hint for Miri's
RUST_BACKTRACE
behavior - point at explicit
'static
obligations on a trait - pretty-print own args of existential projections (dyn-Trait w/ GAT constraints)
- print the generic parameter along with the variance in dumps
- remove invalid
TyCompat
relation for effects - safe transmute: gracefully bubble-up layout errors
- skip updating when external binding is existed
- use
assert_unsafe_precondition!
inAsciiChar::digit_unchecked
- use a LocalDefId in ResolvedArg
- use old ctx if has same expand environment during decode span
- use subtyping for
UnsafeFnPointer
coercion, too - miri:
provenance_gc
: fix comment - miri:
readdir_r
shim: assume FreeBSD v12+ - miri: avoid extra copy by using
retain_mut
and moving the deletion into the closure - miri: disable tree traversal optimization that is wrong due to lazy nodes
- miri: epoll: add a EINVAL case
- miri: epoll: handle edge case for
epoll_ctl
- miri: fix a misleading comment in
tests/pass/tree_borrows/tree-borrows.rs
- miri: fix calling pipe, pipe2, socketpair with a pointer-to-array
- miri: implement SHA256 SIMD intrinsics on x86
- miri: make Tree Borrows Provenance GC no longer produce stack overflows
- miri weak memory emulation: put previous value into initial store buffer
- stabilize opaque type precise capturing (RFC 3617)
- stabilize
const_fn_floating_point_arithmetic
- stabilize
iter::repeat_n
- stabilize feature
char_indices_offset
- implement
debug_more_non_exhaustive
- add
Box::as_ptr
andBox::as_mut_ptr
methods - add
const_cell_into_inner
toOnceCell
- add
f16
andf128
inline ASM support foraarch64
- add a precondition check for
Layout::from_size_align_unchecked
- add implementations for
unbounded_shl
/unbounded_shr
- change neutral element of
<fNN
asiter::Sum>
toneg_zero
- library: move unstable API of
new_uninit
to new features - fix
thread::sleep
Duration-handling for ESP-IDF - fix:
fs::remove_dir_all
: treat internal ENOENT as success - put
Pin::as_deref_mut
in implPin<Ptr>
/ rearrange Pin methods - implement
ptr::fn_addr_eq
- hashbrown: deprecate the raw entry API in favor of
HashTable
- hashbrown: rework the Entry API
- cargo: mdman: Normalize newlines when rendering options
- cargo resolve: Dont show locking workspace members
- cargo: be more permissive while packaging unpublishable crates
- cargo: add
matches_prerelease
semantic - cargo: -Cmetadata includes whether extra rustflags is same as host
- cargo: doctest respects Cargo's color options
- cargo: limiting pre-release match semantics to use only on
OptVersionReq::Req
- cargo: log details of failure if no errors were seen
- cargo: more helpful missing feature error message
- rustdoc-search: use tighter json for names and parents
- rustdoc: animate the
:target
highlight - rustdoc: show exact case-sensitive matches first
- rustdoc: Generate source link on impl associated types
- clippy:
declare_interior_mutable_const
: Ignore pointer types - clippy: add new
too_long_first_doc_paragraph
first paragraph lint - clippy: add new lint:
used_underscore_items
- clippy: check
std::panic::panic_any
in panic lint - clippy: diverging subexpression lint should not fire on
todo!()
- clippy: fix
manual_range_patterns
case with one element at OR - clippy: fix confusing message in
double_must_use
lint - clippy: fix suggestion
unnecessary_lazy_eval
- clippy: ignore underscore-prefixed args for
needless_pass_by_value
lint - clippy: rewrite
empty_line_after_doc_comments
andempty_line_after_outer_attr
, move them fromnursery
tosuspicious
- clippy: start removing
snippet_opt
in favor ofget_source_text
- rust-analyzer: add new assist
toggle_macro_delimiter
- rust-analyzer: allow declaring cfg groups in rust-project.json, to help sharing common cfgs
- rust-analyzer: add workspace level config to ratoml
- rust-analyzer: always show error lifetime arguments as
'_
- rust-analyzer: don't enable the search fast path for short associated functions when a search scope is set
- rust-analyzer: expand proc-macros in workspace root, not package root
- rust-analyzer: fix "Unwrap block" assist with block modifiers
- rust-analyzer: fix Return Type Syntax to include
..
(i.e.method(..)
and notmethod()
) as specified in the RFC - rust-analyzer: fix metadata retrying eating original errors
- rust-analyzer: fix trait method completions not acknowledging
Deref
impls - rust-analyzer: improve proc-macro panic message and workspace loading failure diagnostic
- rust-analyzer: run flycheck without
rev_deps
when target is specified - rust-analyzer: rust-analyzer should watch build files from rust-project.json
- rust-analyzer: wrong
Self: Sized
predicate for trait assoc items - rust-analyzer: wrong
Sized
predicate forgeneric_predicates_for_param
- rust-analyzer: implement floating point casts in const eval
- rust-analyzer: perf: speed up search for short associated functions, especially very common identifiers such as
new
- rust-analyzer: remove the ability to configure the user config path
Rust Compiler Performance Triage
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] crates.io: Remove dev-dependencies from the index
- [disposition: merge] Mergeable rustdoc cross-crate info
- [disposition: merge] Guard Patterns
Tracking Issues & PRs
Rust
- [disposition: merge] Proposal: stabilize
const_refs_to_static
- [disposition: merge] Check WF of source type's signature on fn pointer cast
- [disposition: merge] rustdoc: add header map to the table of contents
- [disposition: merge] doc: Make block of inline Deref methods foldable
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
- 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]
#[derive(Default)]
on enum variants with fields - [new] [RFC] Default field values
- [new] Simplify lightweight clones, including into closures and async blocks
Upcoming Events
Rusty Events between 2024-08-28 - 2024-09-25 🦀
Virtual
- 2024-08-28 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-29 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-08-29 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-09-03 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2024-09-04 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-09-05 | Virtual | LambdaClass
- 2024-09-05 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-09-05 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-09-10 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-09-10 - 2024-09-13 | Hybrid: Virtual and In-Person (Montreal, QC, CA) | Rust Conf
- 2024-09-12 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-09-12 | Virtual (Rotterdam, NL) | Bevy Game Development
- 2024-09-16 | Virtual | Women in Rust
- 2024-09-17 | Virtual (Washington, DC, US) | Rust DC
- 2024-09-18 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-09-18 - 2024-09-20 | Hybrid - Virtual and In-Person (Vienna, AT) | Linux Plumbers Conference
- 2024-09-19 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-09-19 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-09-24 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-09-06 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-09-09 | Ramat Gan, IL | Coralogix
- 2024-09-14 | Bangalore, IN | Rust Bangalore
Europe
- 2024-08-28 | Frankfurt (Main), DE | Rust Rhein Main
- 2024-08-29 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-08-29 | Copenhagen, DK | Copenhagen Rust Community
- 2024-09-04 | Oxford, UK | Oxfrod Rust Meetup Group
- 2024-09-11 | Reading, UK | Reading Rust Workshop
- 2024-09-17 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-09-17 | Trondheim, NO | Rust Trondheim
- 2024-09-18 | Moravia, CZ | Rust Moravia
- 2024-09-18 | Vienna, AT + Virtual | Linux Plumbers Conference
- 2024-09-23 | Bratislava, SK | Bratislava Rust Meetup Group
North America
- 2024-08-28 | Austin, TX, US | Rust ATX
- 2024-08-29 | Nashville, TN, US | Music City Rust Developers
- 2024-08-29 | Chicago, IL, US | Deep Dish Rust
- 2024-08-31 | Cambridge, MA, US | Boston Rust Meetup
- 2024-09-05 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-09-05 | Portland, OR, US | PDX Rust
- 2024-09-05 | St. Louis, MO, US | STL Rust
- 2024-09-07 | Longview, TX, US | Longview Code and Coffee
- 2024-09-08 | Cambridge, MA, US | Boston Rust Meetup
- 2024-09-10 - 2024-09-13 | Hybrid: Virtual and In-Person (Montreal, QC, CA) | Rust Conf
- 2024-09-11 | Boulder, CO, US | Boulder Rust Meetup
- 2024-09-16 | Cambridge, MA, US | Boston Rust Meetup
- 2024-09-17 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-09-18 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-09-19 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-09-21 | Longview, TX, US | Longview Code and Coffee
- 2024-09-24 | Detroit, MI, US | Detroit Rust
- 2024-09-25 | Austin, TX, US | Rust ATX
Oceania
- 2024-08-28 | Sydney, NSW, AU | Rust Sydney
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
... opaque number sequences (\<GitHub> "issue numbers") are not very informative about what is behind that pointer, and pretending they are is harmful. People could provide, instead, actual reasons for things, which do not require dereferencing random pointers, which thrashes cache.
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