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 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
Newsletters
Project/Tooling Updates
- r3bl_trerminal_async v0.5.1 released
- minbpe-rs v0.1.0: Port of Andrej Karpathy's
minbpe
to Rust - Message retention and replay with Selium
Observations/Thoughts
- Leaving Rust gamedev after 3 years
- Tasks are the wrong abstraction
- Go or Rust? Just Listen to the Bots
- Cracking the Cryptic (with Z3 and Rust)
- So, you want to write an unsafe crate
- Designing an efficient memory layout in Rust with unsafe & unions, or, an overlong guide in avoiding dynamic dispatch
- Event driven Microservices using Kafka and Rust
- Writing ergonomic async assertions in Rust
- Making an HTML parsing script a hundred times faster with Rayon
- Rust binaries stability
- [audio] Ratatui with Orhun Parmaksiz :: Rustacean Station
- The Mediocre Programmer's Guide to Rust
Rust Walkthroughs
- Boosting Dev Experience with Serverless Rust in RustRover
- developerlife.com - Rust Polymorphism, dyn, impl, using existing traits, trait objects for testing and extensibility
- Performance optimization with flamegraph and Divan
Research
Miscellaneous
- Writing A Wasm Runtime In Rust
- GitHub Sponsor Rust developer Andrew Gallant (BurntSushi)
- Giving Rust a chance for in-kernel codecs
- Zed Decoded: Rope & SumTree
- An almost infinite Fibonacci Iterator
- [video] From C to Rust: Bringing Rust Abstractions to Embedded Linux
Crate of the Week
This week's crate is efs, a no-std ext2 filesystem implementation with plans to add other file systems in the future.
Another week completely devoid of suggestions, but llogiq stays hopeful he won't have to dig for next week's crate all by himself.
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:
- 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 papers or presentations were submitted this week.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
CFP - Speakers
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.
- 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
- 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 submission website through a PR to TWiR.
Updates from the Rust Project
409 pull requests were merged in the last week
- abort a process when FD ownership is violated
- add support for run-make-support unit tests to be run with bootstrap
- ast: generalize item kind visiting
- coverage: avoid hard-coded values when visiting logical ops
- coverage: replace boolean options with a
CoverageLevel enum
- debuginfo: stabilize
-Z debug-macros
,-Z collapse-macro-debuginfo
and#[collapse_debuginfo]
- delegation: support renaming, and async, const, extern "ABI" and C-variadic functions
- deny gen keyword in
edition_2024_compat
lints - deref patterns: lower deref patterns to MIR
- detect borrow error involving sub-slices and suggest
split_at_mut
- disallow ambiguous attributes on expressions
- do not ICE on invalid consts when walking mono-reachable blocks
- don't ICE when
codegen_select_candidate
returns ambiguity in new solver - don't fatal when calling
expect_one_of
when recovering arg inparse_seq
- enforce closure args + return type are WF
- fix ICE on invalid const param types
- fix ICE when ADT tail has type error
- fix weak memory bug in TLS on Windows
- improve diagnostic for unknown
--print
request - improve handling of expr→field errors
- mark unions non-const-propagatable in
KnownPanicsLint
without calling layout - pretty-print parenthesis around binary in postfix match
- provide more context and suggestions in borrowck errors involving closures
- record certainty of
evaluate_added_goals_and_make_canonical_response
call in candidate - remove special-casing for
SimplifiedType
for next solver - rename
inhibit_union_abi_opt()
toinhibits_union_abi_opt()
- renamed
DerivedObligation
toWellFormedDeriveObligation
- require explicitly marking closures as coroutines
- restrict promotion of
const fn
calls - set writable and
dead_on_unwind
attributes for sret arguments - strengthen tracking issue policy with consequences
- suggest ref mut for pattern matching assignment
- suggest using type args directly instead of equality constraint
- use fulfillment in method probe, not evaluation
- use probes more aggressively in new solver
- weak lang items are not allowed to be
#[track_caller]
- miri: detect wrong vtables in wide pointers
- miri:
unix_sigpipe
: don't inline DEFAULT, just use it from rustc - miri: add
-Zmiri-env-set
to set environment variables without modifying the host environment - miri env: split up Windows and Unix environment variable handling
- miri: file descriptors: make write take &mut self
- miri: implement LLVM x86 AVX2 intrinsics
- miri: make miri-script a workspace root
- miri: use the interpreted program's TZ variable in
localtime_r
- miri: windows: basic support for GetUserProfileDirectoryW
- stabilise
inline_const
- stabilize
Utf8Chunks
- stabilize
non_null_convenience
- stabilize
std::path::absolute
- stabilize
io_error_downcast
- deLLVMize some intrinsics (use
u32
instead ofSelf
in some integer intrinsics) - stop using LLVM
struct
types for alloca thread_local
: be excruciatingly explicit in dtor code- fix
offset_of!
returning a temporary - relax
A: Clone
bound forrc::Weak::into_raw_and_alloc
PathBuf
: replace transmuting by accessor functions- codegen_gcc: some fixes for aarch64
- codegen_gcc: some more fixes and workarounds for Aarch64
- cargo: alias: Aliases without subcommands should not panic
- cargo: lints: Don't always inherit workspace lints
- cargo install: Don't respect MSRV for non-local installs
- cargo toml: Be more forceful with underscore/dash redundancy
- cargo toml: Don't double-warn when underscore is used in workspace dep
- cargo toml: Remove underscore field support in 2024
- cargo toml: Warn, rather than fail publish, if a target is excluded
- cargo toml: remove support for inheriting badges
- cargo: note where lint was set
- cargo: cleanup linting system
- cargo: fix target entry in .gitignore
- cargo: fix warning suppression for config.toml vs config compat symlinks
- bindgen: add dynamic loading of variable
- bindgen: remove which dependency
- bindgen: simplify Rust to Clang target conversion
- clippy:
single_match
(_else
) may be machine applicable - clippy:
non_canonical_partial_ord_impl
: Fix emitting warnings which conflict withneedless_return
- clippy:
type_complexity
: Fix duplicate errors - clippy: check if closure as method arg has read access in
collection_is_never_read
- clippy: configurably allow
useless_vec
in tests - clippy: fix
large_stack_arrays
linting invec
macro - clippy: fix false positive in
cast_possible_truncation
- clippy: suppress
readonly_write_lock
for underscore-prefixed bindings - rust-analyzer: different error code of "no such field" error based on variant type
- rust-analyzer: don't retry position relient requests and version resolve data
- rust-analyzer: fix attributes on generic parameters colliding in item tree
- rust-analyzer: fix doc comment desugaring for proc-macros
- rust-analyzer: fix expression scopes not being calculated for inline consts
- rust-analyzer: fix source roots not always being created when necessary
- rust-analyzer: make
cargo run
always available for binaries - rust-analyzer: manual: remove suggestion of rust-project.json example
- rust-analyzer: support hovering limits for adts
- rustfmt: fix wrong indentation on inner attribute
Rust Compiler Performance Triage
Several non-noise changes this week, with both improvements and regresions coming as a result. Overall compiler performance is roughly neutral across the week.
Triage done by @simulacrum. Revision range: a77f76e2..c65b2dc9
2 Regressions, 2 Improvements, 3 Mixed; 1 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:
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] Precise capturing
- [disposition: merge] Unsafe Extern Blocks
- [disposition: merge] MaybeDangling
Tracking Issues & PRs
Rust
- [disposition: merge] Add
Option::take_if
- [disposition: merge] elaborate obligations in coherence
- [disposition: merge] Allow coercing functions whose signature differs in opaque types in their defining scope into a shared function pointer type
- [disposition: merge] Let's
#[expect]
some lints:Stabilize lint_reasons
(RFC 2383) - [disposition: merge] Tracking Issue for ASCII trim functions on byte slices
- [disposition: merge] Add
IntoIterator
forBox<[T]>
+ edition 2024-specific lints - [disposition: merge] Add
Box<[T; N]>: IntoIterator
without any method dispatch hacks - [disposition: merge] rustdoc-search: search for references
- [disposition: close] Extra trait bound makes function body fail to typecheck
- [disposition: merge] Make casts of pointers to trait objects stricter
- [disposition: merge] Tracking Issue for split_at_checked
New and Updated RFCs
- [new] Precise capturing
Upcoming Events
Rusty Events between 2024-05-01 - 2024-05-29 🦀
Virtual
- 2024-05-01 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-05-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-05-02 | Virtual (Aarhus, DK) | Rust Aarhus Organizers
- 2024-05-02 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-05-02 | Virtual (London, UK) | Women in Rust
- 2024-05-07 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 2024-05-09 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-09 | Virtual (Israel) | Rust in Israel
- 2024-05-09 | Virtual (Nuremberg/Nürnberg, DE) | Rust Nuremberg
- 2024-05-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-14 | Virtual (Halifax, NS, CA) | Rust Halifax
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-05-16 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2024-05-21 | Virtual (Washington, DC, US) | Rust DC
- 2024-05-23 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-28 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-05-04 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-05-11 | Bangalore, IN | Rust Bangalore
Europe
- 2024-05-01 | Köln/Cologne, DE | Rust Cologne
- 2024-05-01 | Utrecht, NL | NL-RSE Community
- 2024-05-06 | Delft, NL | GOSIM
- 2024-05-07 & 2024-05-08 | Delft, NL | RustNL
- 2024-05-07 | Oxford, UK | Oxfrod Rust Meetup Group
- 2024-05-08 | Cambridge, UK | Cambridge Rust Meetup
- 2024-05-09 | Gdańsk, PL | Rust Gdansk
- 2024-05-14 | London, UK | Rust London User Group
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-14 | Prague, CZ | Rust Prague
- 2024-05-14 | Reading, UK | Reading Rust Workshop
- 2024-05-16 | Augsburg, DE | Rust Meetup Augsburg
- 2024-05-16 | Paris, FR | Rust Paris
- 2024-05-21 | Aarhus, DK | Rust Aarhus
- 2024-05-21 | Zurich, CH | Rust Zurich
- 2024-05-22 | Leiden, NL | Future-proof Software Development by FreshMinds
- 2024-05-23 | Bern, CH | Rust Bern
- 2024-05-24 | Bordeaux, FR | Rust Bordeaux
- 2024-05-28 - 2024-05-30 | Berlin, DE | Oxidize
North America
- 2024-05-04 | Cambridge, MA, US | Boston Rust Meetup
- 2024-05-08 | Detroit, MI, US | Detroit Rust
- 2024-05-09 | Spokane, WA, US | Spokane Rust
- 2024-05-12 | Brookline, MA, US | Boston Rust Meetup
- 2024-05-14 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-05-16 | Seattle, WA, US | Seattle Rust User Group
- 2024-05-20 | Somerville, MA, US | Boston Rust Meetup
- 2024-05-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-05-22 | Austin, TX, US | Rust ATX
- 2024-05-25 | Chicago, IL, US | Deep Dish Rust
Oceania
- 2024-05-02 | Brisbane City, QL, AU | Rust Brisbane
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'll never!" "No, never is in the 2024 Edition." "But never can't be this year, it's never!" "Well we're trying to make it happen now!" "But never isn't now?" "I mean technically, now never is the unit." "But how do you have an entire unit if it never happens?"
Thanks to Jacob Pratt 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