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
- Q2 2024 Recap from Rebecca Rumbul
- Welcoming Infrastructure Engineer, Marco Ieni to the Rust Foundation Team
Project/Tooling Updates
- This month in Servo: console logging, parallel tables, OpenXR, and more!
- Copper is Out!
- rust-analyzer changelog #244
- SBOM support in Rust
- pixi - system package manager written in Rust now also supports WASM
- How to do named function arguments in Rust. Introducing
bon
crate - Maelstrom 0.11.0: Fast, Clustered, Test Runner -- Now With a New UI
- Rustic Witcher goes open source
Observations/Thoughts
- Don't Use Preludes And Globs
- Async Rust Challenges in Iroh
repr(C)
: Clear, Simple and (Sometimes) Wrong- Once Upon a Lazy Init
- [video] Rust 1.80.0: Top 10 Most Interesting Things & Blog Highlights
- [video] Rust can Compete with Python
- [video] Rust's second most complicated feature explained
- [audio] Rob Ede – Actix Web, Life as an Open Source Maintainer, Supply-chain Security
- [audio] System76 with Jeremy Soller
- [audio] Full-stack development of a B2B payment infrastructure in Rust, with Florent Bécart
Rust Walkthroughs
- Crafting Interpreters with Rust: On Garbage Collection
- Making games play themselves with Rust Part 2: Parsing the Game State
- Why you should use Rust on the backend
- Debugging distributed database mysteries with Rust, packet capture and Polars
Miscellaneous
Crate of the Week
This week's crates are static-keys, a nightly-only mechanism to speed up checks of rarely changed features and bon, yet another crate to autogenerate builders from functions, methods and structs.
Thanks to EvianZhang and Veetaha for the suggestions!
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.
- greptimedb - Improve Error Messages
- greptimedb - Remove
QueryRequest
fromGreptimeRequest
- greptimedb - Merge small IO to optimize for cloud storage
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
434 pull requests were merged in the last week
- compiler: replace ASCII control chars with Unicode Control Pictures
#[naked]
: report incompatible attributes#[naked]
: use an allowlist for allowed options onasm!
in naked functions- add NuttX based targets for RISC-V and ARM
- add
select_unpredictable
to force LLVM to use CMOV - add a label to point to the lacking macro name definition
- add basic Serde serialization capabilities to Stable MIR
- add migration lint for 2024 prelude additions
- always set
result
duringfinish()
in debug builders - bootstrap command refactoring: make command output API more bulletproof (step 7)
- build-manifest: allow building manifests for formats that only have xz compression
- compiler: never
debug_assert
in codegen - do not try to reveal hidden types when trying to prove auto-traits in the defining scope
- do not use global caches if opaque types can be defined
- don't ICE if HIR and middle types disagree in borrowck error reporting
- don't ICE when auto trait has assoc ty in old solver
- don't ICE when encountering error regions when confirming object method candidate
- don't elaborate associated types with Sized bounds in
trait_object_ty
in cfi - don't manually implement
PartialEq
for some types inrustc_type_ir
- don't record trait aliases as marker traits
- exhaustiveness: explain why a given pattern is considered unreachable
- extend rules of dead code analysis for impls for adts to impls for types refer to adts
- fix a span error when parsing a wrong param of function
- fix malformed suggestion for repeated maybe unsized bounds
- fix supertrait associated type unsoundness
- fix: UWP compilation issue with
change_time
refactored type - graciously handle
Drop
impls introducing more generic parameters than the ADT - handle
no_std
targets on std builds - implement
Copy
/Clone
for async closures - implement lint against ambiguous negative literals
- improve
extern "<abi>" unsafe fn()
error message - improve error message when
global_asm!
usesasm!
options - improve spans on evaluated
cfg_attr
s - inject arm32 shims into Windows metadata generation
- isolate the diagnostic code that expects
thir::Pat
to be printable - let InstCombine remove Clone shims inside Clone shims
- make
missing_fragment_specifier
an error in edition 2024 - make sure that args are compatible in
resolve_associated_item
- mark
missing_fragment_specifier
asFutureReleaseErrorReportInDeps
- match exhaustiveness: Expand or-patterns as a separate step
- note closure captures when reporting cast to fn ptr failed
- perform instsimplify before inline to eliminate some trivial calls
- skip assoc type during infer source visitor
- stop using
unsized_const_parameters
in core/std - support ?Trait bounds in supertraits and dyn Trait under a feature gate
- support lists and stylings in more places for
rustc --explain
- tweak "wrong # of generics" suggestions
- miri: add
flock
shim - miri: add
gettid
support - miri: fix
offset_from
behavior on wildcard pointers - miri: better diagnostics for Tree Borrows + int2ptr casts
- miri: show warning when Stacked Borrows skips a reborrow due to 'extern type'
- stabilize
const_waker
- stabilize
is_sorted
- stabilize
offset_of_nested
- stabilize const
{integer}::from_str_radix
i.e.const_int_from_str
- initial implementation of
anonymous_pipe
API - add
elem_offset
and related methods - add
is_multiple_of
for unsigned integer types - implement
unsigned_signed_diff
- allow optimizing
u32::from::<char>
- bitwise and bytewise methods on
NonZero
- implement
unsigned_signed_diff
- optimize empty case in
Vec::retain
- remove generic lifetime parameter of trait
Pattern
- replace
io::Cursor::{remaining_slice, is_empty}
- cargo: dont call wrap in a no-op
source_id::with*
- cargo: fix: remove rustc probe for
--check-cfg
support - cargo: package workspaces
- rustdoc: Add copy code feature
- rustdoc: change title of search results
- rustdoc: use strategic ThinVec/Box to shrink
clean::ItemKind
- rustdoc: word wrap CamelCase in the item list table and sidebar
- rustfmt: implement Style Edition support
- rustfmt: modify ListItem to hold RewriteResult as the item field
- rustfmt: track configs set from cli flags
- clippy:
missing_trait_methods
: lint methods in definition order - clippy:
needless_borrows_for_generic_args
: Fix for &mut - clippy: add
BTreeSet
detection to theset_contains_or_insert
lint - clippy: add possibility to focus on search input using keyboard
- clippy: emit
if_let_mutex
in presence of other mutexes - clippy: fix
while_let_on_iterator
dropping loop label when applying fix - clippy: fix display of configs in clippy doc page
- clippy: fix under loop may dropping loop label when applying fix
- clippy: fix handling of
Deref
inassigning_clones
- clippy: lint casts to
u128
incast_lossless
- clippy: lintcheck: support underscores replacement in URL crate names
- clippy: make
BindInsteadOfMap
astruct
- clippy: make
std_instead_of_core
somewhat MSRV aware - clippy: make restriction lint's use
span_lint_and_then
(i → p) - clippy: suggest
.cast
/.cast_const
/.cast_mut
intransmute_ptr_as_ptr
- rust-analyzer: run unit tests at the crate level not workspace
- rust-analyzer: Invalid RA diagnostic error: expected 2 arguments, found 1
- rust-analyzer: add preliminary support for
+ use<..> precise_capturing
syntax - rust-analyzer: introduce workspace
rust-analyzer.toml
s - rust-analyzer: use spans for builtin and declarative macro expansion errors
- rust-analyzer: don't retry inlay hint and cole lens requests
- rust-analyzer: early exit if unresolved field is an index
- rust-analyzer: explictly show
async
keyword onimpl trait
methods - rust-analyzer: fix builtin includes rejecting raw string literals
- rust-analyzer: fix includes not working with expr fragment inputs
- rust-analyzer: let glob imports override other globs' visibility
- rust-analyzer: support new cargo config get env format
- rust-analyzer: flip the naming of the doc comment to comment assist
Rust Compiler Performance Triage
There were some notable regressions this week. Some of them are being addressed via follow-up PRs (such as the change to whitespace diagnostic reporting), and some via reverts (such as the dead code analysis that tried to flag pub structs without pub constructors). A few regressions have not yet been addressed. See report for details.
Triage done by @pnkfelix. Revision range: 9629b90b..7e3a9718
5 Regressions, 6 Improvements, 6 Mixed; 8 of them in rollups 65 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] Async closures
- [disposition: merge] Add named path bases to cargo (v2)
- [disposition: merge] CPU feature detection in core
Tracking Issues & PRs
Rust
- [disposition: merge] Disallow setting some built-in cfg via set the command-line
- [disposition: merge] Enforce supertrait outlives obligations hold when confirming impl
- [disposition: merge] impl
Default
for collection iterators that don't already have it - [disposition: merge] turn
invalid_type_param_default
into aFutureReleaseErrorReportInDeps
- [disposition: merge] Stabilize unsafe extern blocks (RFC 3484)
- [disposition: merge] Tracking Issue for
std::ffi::c_str
module
Cargo
- [disposition: merge] feat: Add
info
cargo subcommand
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
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2024-07-31 - 2024-08-28 🦀
Virtual
- 2024-07-31 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-01 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-08-06 | Virtual | Women in Rust
- 2024-08-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2024-08-06 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-08-08 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-08-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-08-08 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-08-15 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-08-20 | Virtual (Washington, DC, US) | Rust DC
- 2024-08-21 | Hybrid - Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-08-22 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-08-27 | Virtual | Ardan Labs
- 2024-08-27 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-08-02 | Kampala, UG | Rust Circle Kampala
Europe
- 2024-08-14 | Reading, UK | Reading Rust Workshop
- 2024-08-20 | Aarhus, DK | Rust Aarhus
- 2024-08-21 | Nürnberg, DE | Rust Nuremberg
- 2024-08-26 | Mainz, DE | Fachschaft Mathematik+Informatik der JGU Mainz
North America
- 2024-08-01 | St. Louis, MO, US | STL Rust
- 2024-08-08 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-08-08 | Seattle, WA, US | Seattle Rust User Group
- 2024-08-19 | Minneapolis, MN US | Minneapolis Rust Meetup
- 2024-08-20 | New York, NY, US | Rust NYC
- 2024-08-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-08-21 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-08-28 | Austin, TX, US | Rust ATC
Oceania
- 2024-08-01 | Brisbane, QLD, AU | Rust Brisbane
- 2024-08-27 | Canberra, ACT, AU | Canberra Rust User Group (CRUG)
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
Man, rust crates are so allergic to 1.0 that they'll skip all the way to version 22.
Thanks to Erich Gubler 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