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
Official
Foundation
- Announcing the First Set of RustConf 2024 Talks & Keynotes
- Unsafe Rust in the Wild: Notes on the Current State of Unsafe Rust
Project/Tooling Updates
- 100 Exercises To Learn Rust
- RustRover Is Released and Includes a Free Non-Commercial Option
- Mysqlclient-sys 0.3.0: Bundled builds and updated bindings
- Ratatui 0.26.3 is released! - a Rust library for cooking up terminal user interfaces
- Maelstrom v0.9.0: Added local-only tests, LPT scheduling, and more
- r3bl_terminal_async v0.5.3 released
Observations/Thoughts
- Some notes on Rust, mutable aliasing and formal verification
- Towards fast
thread_local!
context - Rust's iterators optimize nicely—and contain a footgun
- Why We Forked Quinn
- [audio] AMP - Rust in Production Podcast
- [audio] Rama with Glen De Cauwsemaecker
- [video] What's New in Rust 1.72-1.78 Rustacean Station marathon
- [video] Rust 1.78.0: Last Rust News Video...ever?
- [video] Devoxx UK - Rust 101: Understand the Hype
Rust Walkthroughs
- Using Rust Macros for Custom VTables
- NULL BITMAP Builds a Database #1: The Log is Literally the Database
- The rainbow bridge between sync and async Rust
- developerlife.com - Effective async Rust, non-blocking, concurrent, parallel, event loops, cancellation safety
- Let's build a Load Balancer in Rust - Part 2
Miscellaneous
Crate of the Week
This week's crate is ralertsinua, a text user interface for getting information about Russian air raids in Ukraine.
Thanks to Vladyslav Batyrenko for the 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.
- hyperswitch - [FEATURE]: add pagination support for customers list
- hyperswitch - [FEATURE]: [GlobalPayments] Currency Unit Conversion
- hyperswitch - [FEATURE]: Add support for sending additional metadata in the MessagingInterface
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.
- 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 submission website through a PR to TWiR.
Updates from the Rust Project
364 pull requests were merged in the last week
- add
x86_64-unknown-linux-none
target - enable
rust-lld
on nightlyx86_64-unknown-linux-gnu
rustc_hir_typeck
: Account forskipped_ref_pats
inexpr_use_visitor
rustc_resolve
cleanups- actually use the
#[do_not_recommend]
attribute if present - add
#[inline]
to floatDebug
fallback used bycfg(no_fp_fmt_parse)
- add
fn into_raw_with_allocator
to Rc/Arc/Weak - add an experimental feature gate for global registration
- add and use
generics.is_empty()
andgenerics.is_own_empty,
rather than using generics' attributes - also expand weak alias tys inside consts inside
expand_weak_alias_tys
- android: use
posix_memalign
for aligned allocations - avoid using
aligned_alloc
;posix_memalign
is better-behaved - check whether the
next_node
is else-less if inget_return_block
- coverage:
CoverageIdsInfo::mcdc_bitmap_bytes
is never needed - coverage: memoize and simplify counter expressions
- defrost
RUST_MIN_STACK=ice rustc hello.rs
- delegation: implement list delegation
- don't ICE because recomputing overflow goals during
find_best_leaf_obligation
causes inference side-effects - don't do post-method-probe error reporting steps if we're in a suggestion
- fix ICE in non-operand
aggregate_raw_ptr
intrinsic codegen - fix println! ICE when parsing percent prefix number
- fix suggestion in E0373 for
!Unpin
coroutines - fix the dedup error because of spans from suggestion
- improve error message: missing
;
inmacro_rules
- include line tables in compiler profile
- lldb-formatters: use StdSliceSyntheticProvider for &str
- make
EvalCtxt
generic overInferCtxtLike
- make crashes dump mir to build dir
- never type unsafe lint improvements
- note for E0599 if shadowed bindings has the method
- only find segs chain for missing methods when no available candidates
- only make GAT ambiguous in
match_projection_projections
considering shallow resolvability - refactor: add rustc-perf submodule to src/tools
- report better WF obligation leaf obligations in new solver
- style-guide: when breaking binops handle multi-line first operand better
- suggest setting lifetime in borrowck error involving types with elided lifetimes
- temporarily revert to NonZeroUsize in rustc-abi to fix building on stable
- track cycle participants per root
- use a proper probe for shadowing impl
- use a single static for all default slice Arcs
- warn against changes in opaque lifetime captures in 2024
- miri: adjust Allocation Bytes used by Miri to custom MiriAllocBytes
- miri: directly implement native exception raise methods in miri
- miri: give
FileDescription::{read, write}
access to theMiriInterpCx
- miri: ignore the Helix configuration directory
- miri: make basic things work on Android
- miri: properly print error in 'cargo miri setup --print-sysroot'
- miri: support
aligned_alloc
for unixes - miri: use
throw_unsup_format!
instead of returningENOTSUP
in the mmap shim - miri: use a little arg-parsing helper for miri-script
- remove libc from MSVC targets
- optimize character escaping
- alloc: implement FromIterator for
Box<str>
- implemented Default for
Arc<str>
- fix
read_exact
andread_buf_exact
for&[u8]
andio:Cursor
- fix assertion when attempting to convert
f16
andf128
withas
- inline
Duration
construction intoDuration::from_
{secs
,millis
,micros
,nanos
} - remove bound checks from
BorrowedBuf
andBorrowedCursor
methods - optimize inplace collection of
Vec
- make
Debug
impl forTerm
simpler - invert comparison in
u
N::checked_sub
- add
f128
float to integer conversion functions - add addition, subtraction, multiplication, and compare operations for
f128
- add
powi
fof16
andf128
- add v0 symbol mangling for
f16
andf128
- re-add
From<f16> for f64
- cargo: add special
check-cfg
lint config for theunexpected_cfgs
lint - cargo: fix warning about unused Permissions
- cargo: fix warning output in
build_with_symlink_to_path_dependency_with_build_script_in_git
- cargo: fix: make path dependencies with the same name stays locked
- cargo: fix: support IPv6-only network for cargo fix
- cargo: load
libsecret
by itsSONAME
,libsecret-1.so.0
- cargo: preserve file permissions on unix during
write_atomic
- cargo: silence warnings running embedded unittests
- rustdoc: don't strip items with inherited visibility in
AliasedNonLocalStripper
- rustdoc: negative impls are not notable
- add
-
(stdin) support in rustdoc - clippy:
assigning_clones
: move topedantic
so it is allow by default - clippy:
doc_lazy_continuation
: do not warn onEnd
events - clippy: add configuration option for ignoring
panic!()
in tests - clippy: don't lint path statements in
no_effect
- clippy: don't lint
missing_panic_docs
for panics inconst
environments - clippy: improve
match_same_arms
messages, enable rustfix test - clippy: less aggressive
needless_borrows_for_generic_args
- clippy: make sure the msrv for
const_raw_ptr_deref
is met when lintingmissing_const_for_fn
- clippy: manually set library paths in .github/driver.sh
- rust-analyzer: fix metrics workflow not actually updating the toolchain
- rust-analyzer: fix: don't emit --keep-going for custom build script commands
- rust-analyzer: fix: expand macro recursively expands both fp-like and attribute macros when intertwined
- rust-analyzer: fix: extract mod to file should respect path attribute
- rust-analyzer: fix: hash file contents to verify whether file actually changed
Rust Compiler Performance Triage
Fairly quiet week with the exception of a very large improvement coming from the switch to rust-lld
on nightly Linux. This can have very large impacts on benchmarks where linking dominates the build time (e.g., ripgrep
, exa
, small binaries like hello-world
). Aside from that change, there were a few small regressions that were either deemed worth it or are still being investigated.
Triage done by @rylev. Revision range: 9105c57b..1d0e4afd
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.7% | [0.1%, 2.5%] | 30 |
Regressions ❌ (secondary) |
0.5% | [0.2%, 0.8%] | 5 |
Improvements ✅ (primary) |
-30.4% | [-71.7%, -0.4%] | 35 |
Improvements ✅ (secondary) |
-25.6% | [-70.9%, -0.5%] | 75 |
All ❌✅ (primary) | -16.1% | [-71.7%, 2.5%] | 65 |
4 Regressions, 1 Improvement, 4 Mixed; 2 of them in rollups 66 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:
- MaybeDangling
- RFC: New range types for Edition 2024
- Merge RFC 3484: Unsafe extern blocks
- RFC: cargo-script
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] change method resolution to constrain hidden types instead of rejecting method candidates
- [disposition: merge] Tracking Issue for asm_const
- [disposition: merge] rustdoc: Add support for --remap-path-prefix
- [disposition: merge] Make
std::env::{set_var, remove_var}
unsafe in edition 2024 - [disposition: merge] Tracking Issue for
slice_flatten
- [disposition: merge] Edition 2024: Make
!
fall back to!
- [disposition: merge] Stabilize div_duration
- [disposition: merge] Panic if
PathBuf::set_extension
would add a path separator - [disposition: merge] Support C23's Variadics Without a Named Parameter
- [disposition: merge] Stabilize
LazyCell
andLazyLock
- [disposition: merge] Turn remaining non-structural-const-in-pattern lints into hard errors
- [disposition: merge] Edition 2024: don't special-case diverging blocks
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
- [disposition: merge] document guarantee about evaluation of associated consts and const blocks
Unsafe Code Guidelines
- No Unsafe Code Guideline RFCs entered Final Comment Period this week.
New and Updated RFCs
- [new] [RFC] Add
#[export_ordinal(n)]
attribute - [new] [RFC] Add
#[diagnostic::blocking]
attribute - [new] Guard Patterns
Upcoming Events
Rusty Events between 2024-05-22 - 2024-06-19 🦀
Virtual
- 2024-05-23 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-23 | Virtual (Israel) | Rust in Israel
- 2024-05-24 | Virtual (Rotterdam, NL)| Bevy Game Development
- 2024-05-28 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-28 & 2024-05-28 | Virtual | Mainmatter
- 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-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-18 | Virtual (Washington, DC, US) | Rust DC
- 2024-06-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Africa
- 2024-06-01 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-05-22 | Singapore, SG | SG Rust Meetup
Europe
- 2024-05-22 | Leiden, NL | Future-proof Software Development by FreshMinds
- 2024-05-23 | Bern, CH | Rust Bern
- 2024-05-23 | Łodz, PL | Mobica
- 2024-05-23 | Manchester, UK | Rust Manchester
- 2024-05-23 | Salzburg, AT | SRUG: Salzburg Rust User Group
- 2024-05-24 | Bordeaux, FR | Rust Bordeaux
- 2024-05-25 | Stockholm, SE | Stockholm Rust
- 2024-05-25 | Tampere, FI | Finland Rust-lang Group
- 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
North America
- 2024-05-22 | Austin, TX, US | Rust ATX
- 2024-05-25 | Chicago, IL, US | Deep Dish Rust
- 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
Oceania
- 2024-05-28 | Sydney, NSW, AU | Rust Sydney
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
In other words, I do not want the compiler to just insert code to uphold the bare minimum guarantees, I want the compiler to check my work for me and assist me in developing an algorithm I can confidently assert is right.
Thanks to scottmcm 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