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
- The Embedded Rustacean Issue #15
- This Week in Bevy: Foundations, Meetups, and more Bevy Cheatbook updates
Project/Tooling Updates
- rustc_codegen_gcc: Progress Report #31
- Slint 1.5: Embracing Android, Improving Live-Preview, and introducing Pythonic Slint
- yaml-rust2's first real release
- testresult 0.4.0 released. The crate provides the
TestResult
type for concise and precise test failures. - Revolutionizing PostgreSQL Database Comparison: Introducing pgdatadiff in Rust — Unleash Speed, Safety, and Scalability
Observations/Thoughts
- SemVer in Rust: Breakage, Tooling, and Edge Cases — FOSDEM 2024 annotated talk
- Go's Errors: How I Learned to Love Rust
- Strongly-typed IDs in SurrealDB
- Iterators and traversables
- Using PostHog with Rust
- Using Rust on ESP32 from Windows
- Compiling Rust to WASI
- Achieving awful compression with digits of pi
- Zig, Rust, and other languages
- What part of Rust compilation is the bottleneck?
- Lambda on hard mode: Inside Modal's web infrastructure
- Embedded Rust Bluetooth on ESP: BLE Advertiser
- [video] Diplomat - Idiomatic Multi-Language APIs - Robert Bastian - Rust Zürisee March 2024
Rust Walkthroughs
- A Short Introduction to Rust and the Bevy Game Engine
- [video] Strings and memory reallocation in Rust
Research
Miscellaneous
- RustNL 2024 schedule announced
- Fighting back: Turning the Tables on Web Scrapers Using Rust
- The book "Code Like a Pro in Rust" is released
- Red Hat's Long, Rust'ed Road Ahead For Nova As Nouveau Driver Successor
Crate of the Week
This week's crate is heck, a no_std
crate to perform case conversions.
Thanks to Edoardo Morandi 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:
- 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.
- Rama — add Form support (IntroResponse + FromRequest)
- Rama — rename *Filter matchers to *Matcher
- Rama — Provide support for boxed custom matchers in layer enums
- Rama — use workspace dependencies for common workspace dep versionning
- Rama — add open-telemetry middleware and extended prometheus support
- Space Acres - Packaging for MacOS
- Space Acres - Implement Loading Progress
- Space Acres - Show more lines of logs when the app is "Stopped with error"
- Space Acres - Tray Icon Support
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Braintree
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Fiserv
- Hyperswitch - [REFACTOR]: Remove Default Case Handling - Globepay
- ZeroCopy - Fix cfgs in rustdoc
- ZeroCopy - Audit uses of "C-like" and prefer "fieldless"
- ZeroCopy - in zerocopy-derive UI tests, detect whether we're building with
RUSTFLAGS='-Wwarnings'
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.
- RustFest Zürich 2024 | Closes 2024-03-31 | Zürich, Switzerland | Event date: 2024-06-19 - 2024-06-24
- Oxidize 2024 | Closes 2024-03-24 | Berlin, Germany | Event date: 2024-05-28 - 2024-05-30
- RustConf 2024 | Closes 2024-04-25 | Montreal, Canada | Event date: 2024-09-10
- EuroRust 2024| Closes 2024-06-03 | Vienna, Austria & online | Event on 2024-10-10
- Scientific Computing in Rust 2024| Closes 2024-06-14 | online | Event date: 2024-07-17 - 2024-07-19
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
498 pull requests were merged in the last week
- BOLT Use CDSort and CDSplit
NormalizesTo
: return nested goals to calleradd_retag
: ensure box-to-raw-ptr casts are preserved for Mirif16
andf128
step 3: compiler support & feature gate- add
-Z external-clangrt
- add
wasm_c_abi future-incompat
lint - add missing
try_visit
calls in visitors - check library crates for all tier 1 targets in PR CI
- copy byval argument to alloca if alignment is insufficient
- coverage: initial support for branch coverage instrumentation
- create some minimal HIR for associated opaque types
- delay expand macro bang when there has indeterminate path
- delegation: fix ICE on duplicated associative items
- detect allocator for box in
must_not_suspend
lint - detect calls to
.clone()
on T: !Clone types on borrowck errors - detect when move of !Copy value occurs within loop and should likely not be cloned
- diagnostics: suggest
Clone
bounds when noopclone()
- do not eat nested expressions' results in
MayContainYieldPoint
format args visitor - don't create
ParamCandidate
when obligation contains errors - don't ICE when non-self part of trait goal is constrained in new solver
- don't show suggestion if slice pattern is not top-level
- downgrade const eval dangling ptr in final to future incompat lint
- enable PR tracking review assignment for rust-lang/rust
- enable creating backtraces via -Ztreat-err-as-bug when stashing errors
- enable frame pointers for the standard library
- ensure RPITITs are created before def-id freezing
- fix 32-bit overflows in LLVM composite constants
- fix ICE in diagnostics for parenthesized type arguments
- fix
long-linker-command-lines
failure caused byrust.rpath=false
- fix attribute validation on associated items in traits
- fix stack overflow with recursive associated types
- interpret: ensure that Place is never used for a different frame
- make incremental sessions identity no longer depend on the crate names provided by source code
- match lowering: don't collect test alternatives ahead of time
- more eagerly instantiate binders
- never patterns: suggest
!
patterns on non-exhaustive matches - only generate a ptrtoint in AtomicPtr codegen when absolutely necessary
- only invoke
decorate
if the diag can eventually be emitted - pass the correct DefId when suggesting writing the aliased Self type out
- pattern analysis: Store field indices in
DeconstructedPat
to avoid virtual wildcards - provide structured suggestion for
#![feature(foo)]
- register LLVM handlers for bad-alloc / OOM
- reject overly generic assoc const binding types
- represent
Result<usize, Box<T>>
as ScalarPair(i64, ptr) - split
refining_impl_trait
lint into_reachable, _internal
variants - stabilize
imported_main
- stabilize associated type bounds (RFC #2289)
- stop walking the bodies of statics for reachability, and evaluate them instead
- ungate the
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES
lint - unix time module now return result
- validate
builder::PATH_REMAP
- miri: add some chance to reuse addresses of previously freed allocations
- avoid lowering code under dead SwitchInt targets
- use
UnsafeCell
for fast constant thread locals - add
CStr::bytes
iterator - add
as_(mut_)ptr
andas_(mut_)slice
to raw array pointers - implement
{Div,Rem}Assign<NonZero<X>>
onX
- fix unsoundness in
Step::forward_unchecked
for signed integers - implement
Duration::as_millis_{f64,f32}
- optimize
ptr::replace
- safe Transmute: Require that source referent is smaller than destination
- safe Transmute: Use 'not yet supported', not 'unspecified' in errors
- hashbrown: fix index calculation in panic guard of
clone_from_impl
- cargo tree: Control
--charset
via auto-detecting config value - cargo toml: Flatten manifest parsing
- cargo: add 'open-namespaces' feature
- cargo fix: strip feature dep when dep is dev dep
- cargo: prevent dashes in lib.name
- cargo: expose source/spans to Manifest for emitting lints
- rustdoc-search: depth limit
T<U>
→U
unboxing - rustdoc-search: search types by higher-order functions
- rustdoc: add
--test-builder-wrapper
arg to support wrappers such asRUSTC_WRAPPER
when building doctests - rustdoc: do not preload fonts when browsing locally
- rustfmt: fix: ICE with expanded code
- rustfmt: initial work on formatting headers
- clippy:
cast_lossless
: Suggest type alias instead of the aliased type - clippy:
else_if_without_else
: Fix duplicate diagnostics - clippy:
map_entry
: call the visitor on the local'selse
block - clippy:
option_option
: Fix duplicate diagnostics - clippy:
unused_enumerate_index
: trigger on method calls - clippy:
use_self
: Make it aware of lifetimes - clippy: don't emit
doc_markdown
lint for missing backticks if it's inside a quote - clippy: fix
dbg_macro
false negative when dbg is inside some complex macros - clippy: fix
empty_docs
trigger in proc-macro - clippy: fix span calculation for non-ascii in
needless_return
- clippy: handle false positive with
map_clone
lint - clippy: lint when calling the blanket
Into
impl from aFrom
impl - clippy: move
iter_nth
tostyle
, add machine applicable suggestion - clippy: move
readonly_write_lock
to perf - clippy: new restriction lint:
integer_division_remainder_used
- rust-analyzer: distinguish integration tests from crates in test explorer
- rust-analyzer: apply
#[cfg]
to proc macro inputs - rust-analyzer: implement ATPIT
- rust-analyzer: support macro calls in eager macros for IDE features
- rust-analyzer: syntax highlighting improvements
- rust-analyzer: fix panic with impl trait associated types in where clause
- rust-analyzer: don't auto-close block comments in strings
- rust-analyzer: fix wrong where clause rendering on hover
- rust-analyzer: handle attributes when typing curly bracket
- rust-analyzer: ignore some warnings if they originate from within macro expansions
- rust-analyzer: incorrect handling of
use
and panic issue inextract_module
- rust-analyzer: make inlay hint resolving work better for inlays targetting the same position
- rust-analyzer: refactor extension to support arbitrary shell command runnables
- rust-analyzer: show compilation progress in test explorer
- rust-analyzer: use
--workspace
and--no-fail-fast
in test explorer
Rust Compiler Performance Triage
Even though the summary might not look like it, this was actually a relatively quiet week, with a few small regressions. The large regression that is also shown in the summary table was caused by extending the verification of incremental compilation results. However, this verification is not actually fully enabled by default, so these regressions are mostly only visible in our benchmarking suite, which enables the verification to achieve more deterministic benchmarking results. One small regression was also caused by enabling frame pointers for the Rust standard library, which should improve profiling of Rust programs.
Triage done by @kobzol. Revision range: e919669d..21d94a3d
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
2.5% | [0.4%, 7.8%] | 207 |
Regressions ❌ (secondary) |
2.9% | [0.2%, 8.3%] | 128 |
Improvements ✅ (primary) |
- | - | 0 |
Improvements ✅ (secondary) |
-1.0% | [-1.3%, -0.4%] | 4 |
All ❌✅ (primary) | 2.5% | [0.4%, 7.8%] | 207 |
4 Regressions, 1 Improvements, 6 Mixed; 4 of them in rollups 67 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 raw slice len() method (slice_ptr_len, const_slice_ptr_len)
- [disposition: merge] downgrade ptr.is_aligned_to crate-private
- [disposition: merge] Stabilize
unchecked_{add,sub,mul}
- [disposition: merge] transmute: caution against int2ptr transmutation
- [disposition: merge] Normalize trait ref before orphan check & consider ty params in alias types to be uncovered
Cargo
- [disposition: merge] release cargo test helper crate to crates-io
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-03-20 - 2024-04-17 🦀
Virtual
- 2024-03-20 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-03-20 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-03-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-26 | Virtual + In Person (Barcelona, ES) | BcnRust
- 2024-03-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-03-28 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-02 | Virtual (Buffalo, NY, US) | Buffalo Rust
- 2024-04-03 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-04-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-04-04 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-04-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-04-11 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-11 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-04-16 | Virtual (Washinigton, DC, US) | Rust DC
- 2024-04-17| Virtual (Vancouver, BC, CA) | Vancouver Rust
Africa
- 2024-04-05 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-03-30 | New Delhi, IN | Rust Delhi
Europe
- 2024-03-20 | Girona, ES | Rust Girona
- 2024-03-20 | Lyon, FR | Rust Lyon
- 2024-03-20 | Oxford, UK | Oxford Rust Meetup Group
- 2024-03-21 | Augsburg, DE | Rust Meetup Augsburg
- 2024-03-21 | Lille, FR | Rust Lille
- 2024-03-21 | Vienna, AT | Rust Vienna
- 2024-03-23 | Stockholm, SE | Stockholm Rust
- 2024-03-25 | London, UK | Rust London User Group
- 2024-03-26 | Barcelona, ES + Virtual | BcnRust
- 2024-03-26 - 2024-03-28 | London, UK | Rust Nation UK
- 2024-03-28 | Berlin, DE | Rust Berlin
- 2024-04-10 | Cambridge, UK | Cambridge Rust Meetup
- 2024-04-10 | Oslo, NO | Rust Oslo
- 2024-04-11 | Bordeaux, FR | Rust Bordeaux
- 2024-04-11 | Reading, UK | Reading Rust Workshop
- 2024-04-16 | Bratislava, SK | Bratislava Rust Meetup Group
- 2024-04-16 | Munich, DE + Virtual | Rust Munich
North America
- 2024-03-21 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-03-21 | Nashville, TN, US | Music City Rust Developers
- 2024-03-21 | Seattle, WA, US | Seattle Rust User Group
- 2024-03-21 | Spokane, WA, US | Spokane Rust Meetup | Spokane Rust Website
- 2024-03-22 | Somerville, MA, US | Boston Rust Meetup
- 2024-03-26 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-03-27 | Austin, TX, US | Rust ATX
- 2024-03-27 | Hawthorne (Los Angeles), CA, US | Freeform
- 2024-03-31 | Boston, MA, US | Boston Rust Meetup
- 2024-04-04 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-04-11 | Seattle, WA, US | Seattle Rust User Group
- 2024-04-16 | San Francisco, CA, US | San Francisco Rust Study Group
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 10 years we went from “Rust will never replace C and C++” to “New C/C++ should not be written anymore, and you should use Rust”. Good job.
Thanks to Dennis Luxen 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