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.
Updates from Rust Community
Official
Newsletters
Project/Tooling Updates
- Fyrox Game Engine 0.34
- Wasmi's New Execution Engine - Faster Than Ever
- iroh@0.17.0 - Everything is a little better
- venndb@0.5.0 - support multi dimensional filter options to be filtered in group
Observations/Thoughts
- Diesel: Continuous Benchmarking Case Study
- Visions of the future: formal verification in Rust
- Avoiding Over-Reliance on
mpsc
channels in Rust - How We Migrated Our Static Analyzer From Java To Rust
- Building Agentic RAG with Rust, Qdrant & OpenAI
- Making a Secure Chat in Rust
- Parsing structured environment variables in Rust
- Types and self-documenting code in Rust
- Iggy.rs — one year of building the message streaming
- When allocating unused memory boosts performance by 2x
- Atomic Polling Intervals for Highly Concurrent Workloads
- Taming Floating-Point Sums
- Send & Mutex - Misconceptions about Send
Rust Walkthroughs
- Build with Naz : Linux io_uring and tokio-uring exploration with Rust
- Getting Started with Loco & SeaORM
Miscellaneous
- Rebuilding Consumer Social In Rust
- Report on variadic generics discussion at RustNL.
- How to use ChatGPT with Rust
- [video] Programming Education: Tailoring Tools and Techniques for Rust (Will Crichton in the RustRover livestream series)
Crate of the Week
This week's crate is pulso, a simple metrics collector for TCP/IP.
Thanks to guapodero for the self-suggestion!
Please submit your suggestions and votes for next week!
Call 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.
- zerocopy - CI cache not including installed Cargo tools?
- zerocopy - Debug GitHub Actions issue
- zerocopy - Cargo doc step
jq
error
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.
- Rust Argentina June 2024 | Closes 2024-05-31 | Buenos Aires, AR | Event date: 2024-06-04
- EuroRust 2024 | Closes 2024-06-03 | Vienna, Austria & online | Event date: 2024-10-10
- Scientific Computing in Rust 2024 | Closes 2024-06-14 | online | Event date: 2024-07-17 - 2024-07-19
- Rust Ukraine 2024 | Closes 2024-07-06 | Online + Ukraine, Kyiv | Event date: 2024-07-27
- Conf42 Rustlang 2024 | Closes 2024-07-22 | online | Event date: 2024-08-22
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
397 pull requests were merged in the last week
- MIR validation: ensure that downcast projection is followed by field projection
- actually use TAIT instead of emulating it
- allow coercing functions whose signature differs in opaque types in their defining scope into a shared function pointer type
- allow monomorphization time const eval failures if the cause is a type layout issue
- an async closure may implement
FnMut
/Fn
if it has no self-borrows - detect unused structs which implement private traits
- disallow cast with trailing braced macro in let-else
- don't continue probing for method if in suggestion and autoderef hits ambiguity
- don't do cc detection for synthetic targets
- don't eagerly monomorphize drop for types that are impossible to instantiate
- don't suggest adding the unexpected cfgs to the build-script it-self
- drop region constraints for ambiguous goals
- exit the process a short time after entering our ctrl-c handler
- expand
for_loops_over_fallibles
lint to lint on fallibles behind references - f32: use constants instead of reassigning a dummy value as PI
- fail relating constants of different types
- fix OutsideLoop's error suggestion: adding label
'block
forif
block - fix
unexpected_cfgs
lint on std - fix incorrect suggestion for undeclared hrtb lifetimes in where clauses
- fix parsing of erroneously placed semicolons
- follow-up fixes to
report_return_mismatched_types
- force the inner coroutine of an async closure to
move
if the outer closure ismove
andFnOnce
- handle
ReVar
innote_and_explain_region
- make sure that the method resolution matches in
note_source_of_type_mismatch_constraint
- move
#[do_not_recommend]
to the#[diagnostic]
namespace - only allow immutable statics with
#[linkage]
- only suppress binop error in favor of semicolon suggestion if we're in an assignment statement
- panic directly in
Arguments::new*
instead of recursing - pattern types: Prohibit generic args on const params
- properly deal with missing/placeholder types inside GACs
- relax restrictions on multiple sanitizers
- remove
DefId
fromEarlyParamRegion
- remove proof tree formatting, make em shallow
- rename
FrameworkOnlyWindows
toRawDylibOnlyWindows
- resolve anon const's parent predicates to direct parent instead of opaque's parent
- stop SRoA'ing
DynMetadata
in MIR - support C23's Variadics Without a Named Parameter
- tag more stuff with
WG-trait-system-refactor
- turn remaining non-structural-const-in-pattern lints into hard errors
- use
Backtrace::force_capture
instead ofBacktrace::capture
inrustc_log
- validate the special layout restriction on
DynMetadata
- warn (or error) when
Self
ctor from outer item is referenced in inner nested item - wrap Context.ext in AssertUnwindSafe
- interpret: make overflowing binops just normal binops
- miri: add back some tokio features
- miri: bugfix
MiriAllocBytes
to guarantee different addresses - miri: completely refactor how we manage blocking and unblocking threads
- perf: Delay the construction of early lint diag structs
- stabilize
LazyCell
andLazyLock
- stabilize
div_duration
- stabilize
slice_flatten
- rewrite native thread-local storage
- rewrite TLS on platforms without threads
- simplify key-based thread locals
- add opt-for-size core lib feature flag
- always use the general case char count with
optimize_for_size
- add
IntoIterator
forBox<[T]>
+ edition 2024-specific lints - add
assert_unsafe_precondition
tounchecked_{add,sub,neg,mul,shl,shr}
methods - add a fast-path to
Debug
ASCII&str
- add manual
Sync
impl forReentrantLockGuard
- fix
VecDeque::shrink_to
UB whenhandle_alloc_error
unwinds - simplify the
unchecked_sh[lr]
ub-checks a bit - less syscalls for the
copy_file_range
probe - make
clamp
inline - fix
c_char
on AIX - panic if
PathBuf::set_extension
would add a path separator - codegen_llvm: add support for writing summary bitcode
- codegen_gcc: simd: implement pointer provenance intrinsics
- rust-lld: fallback to rustc's sysroot if there's no path to the linker in the target sysroot
- self-contained linker: retry linking without
-fuse-ld=lld
on CCs that don't support it - cargo: add more high level traces
- cargo: fetch specific commits even if the github fast path fails
- cargo: fix: check if rev is full commit sha for github fast path
- cargo: fix: remove symlink dir on Windows
- cargo: improve error description when deserializing partial field
struct
- cargo: test: switch from
drop
tolet _
due to nightly rustc change - cargo: upgrade gix from 0.62 to 0.63
- cargo: use
i32
rather thanusize
as "default integer" in library template - clippy:
significant_drop_in_scrutinee
: Trigger lint only if lifetime allows early significant drop - clippy: add new lint
while_float
- clippy: add parentheses to
let_and_return
's suggestion - clippy: bug fix: lint
numbered_fields
message error - clippy: correctly handle closing parens in
missing_backticks
doc lint - clippy: Quick Fix for bare URLs
- clippy: fix
unnecessary_to_owned
interaction with macro expansion - clippy: fulfill expectations in
check_partial_eq_without_eq
- clippy: fulfill expectations in
check_unsafe_derive_deserialize
- clippy: suppress
iter_on_empty_collections
if the iterator's concrete type is relied upon - rust-analyzer: add
toggle_async_sugar
assist code action - rust-analyzer: allow sysroots to only consist of the source root dir
- rust-analyzer: clear diagnostics only after new ones were received
- rust-analyzer: more callable info
- rust-analyzer: fix
data_constructor
ignoring generics forstruct
- rust-analyzer: fix inconsistent cwd of
run
anddebug
command in client - rust-analyzer: ensure implied bounds from associated types are considered in autocomplete
- rust-analyzer: fix
format_args
lowering passing incorrect parameters torustc_parse_format
- rust-analyzer: infer type of async block with tail return expr
- rust-analyzer: resolve extern prelude for local mods in block modules
- rust-analyzer: use correct toolchain channel when generating builtin type doc links
- rust-analyzer: various find path fixes
- rust-analyzer: handle
{self}
when removing unused imports - rust-analyzer: implement assist to switch between doc and normal comments
Rust Compiler Performance Triage
A relatively quiet week, with few large changes, the largest driven by further increasing the scope of unsafe precondition checking.
Triage done by @simulacrum. Revision range: 1d0e4afd..a59072ec
2 Regressions, 3 Improvements, 5 Mixed; 3 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:
- 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
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking Issue for
Error
incore
- [disposition: merge] Make
WHERE_CLAUSES_OBJECT_SAFETY
a regular object safety violation - [disposition: merge] Show files produced by
--emit foo
in json artifact notifications - [disposition: merge] Do not try to reveal hidden types when trying to prove Freeze in the defining scope
- [disposition: merge] Item bounds can reference self projections and still be object safe
- [disposition: merge] Use a default lifetime of
'static
in associated consts - [disposition: merge] Stabilize
custom_code_classes_in_docs
feature - [disposition: merge] Tracking issue for integer_atomics
- [disposition: merge] Constification of BinaryHeap construction
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team RFCs 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 RFCs entered Final Comment Period this week.
New and Updated RFCs
- [new] [RFC] Named macro capture groups
- [new] Change crates.io policy to not offer crate transfer mediation
- [new] Externally implementable traits
- [new] [RFC] On_unimplemented_trait_use
- [new] [RFC] Thread spawn hook (inheriting thread locals)
Upcoming Events
Rusty Events between 2024-05-29 - 2024-06-26 🦀
Virtual
- 2024-05-29 | Virtual | Training 4 Programmers LLC
- 2024-05-30 | Virtual + In Person (Barcelona, ES) | Mainmatter & BcnRust
- 2024-05-30 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-06-04 | Virtual | Women in Rust
- 2024-06-04 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 2024-06-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-06-06 | Virtual | Code Mavens
- 2024-06-06 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-06-09 | Virtual | Code Mavens
- 2024-06-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-06-13 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-06-13 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-06-16 | Virtual | Code Mavens
- 2024-06-18 | Virtual (Washington, DC, US) | Rust DC
- 2024-06-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-06-20 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-06-25 | Virtual (Dallas, TX, US)| Dallas Rust User Group
Africa
- 2024-06-01 | Kampala, UG | Rust Circle Kampala
Europe
- 2024-05-28 - 2024-05-30 | Berlin, DE | Oxidize
- 2024-05-30 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2024-05-30 | Barcelona, ES | Mainmatter & BcnRust
- 2024-05-30 | Berlin, DE | Rust Berlin
- 2024-05-30 | Copenhagen, DK | Copenhagen Rust Community
- 2024-05-30 | Oslo, NO | Rust Oslo
- 2024-05-30 | Vienna, AT | Rust Vienna
- 2024-06-05 | Hamburg, DE | Rust Meetup Hamburg
- 2025-06-06 | Vilnius, LT | Rust Vilnius
- 2024-06-19 - 2024-06-24 | Zürich, CH | RustFest Zürich
- 2024-06-20 | Aarhus, DK | Rust Aarhus
North America
- 2024-05-30 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-05-31 | Boston, MA, US | Boston Rust Meetup
- 2024-06-08 | Somerville, MA, US | Boston Rust Meetup
- 2024-06-13 | Spokane, WA, US | Spokane Rust
- 2024-06-18 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-06-20 | Seattle, WA, US | Seattle Rust User Group
Oceania
- 2024-06-25 | Canberra, ACt, AU | Canberra Rust User Group (CRUG)
South America
- 2024-06-06 | Buenos Aires, AR | Rust en Español | Rust Argentina
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
I’ve said it before and I’ll say it again: as a child of OCaml and C++, Rust currently is the best language for production compiler-shaped things.
Thanks to Stephan Sokolow 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