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
Newsletters
Project/Tooling Updates
- The Rust to .NET compiler (backend) can now properly compile the "guessing game" from the Rust book
- Cattaca 1.0.0
- BugStalker v0.2.0 - rust debugger
Observations/Thoughts
- How I spent 2 years building my own game engine (Rust, WASM, WebGPU)
- The Inconceivable Types of Rust: How to Make Self-Borrows Safe
- Making robots plan faster with SIMD and Rust
- Learning Rust: Bare Threading
- 999 crates of Rust on the wall
- How-to compile rust faster
- Tock binary size
- Virtual Geometry in Bevy 0.14
- Building Plain Old Data from Scratch
- Latency at the edge with Rust/WebAssembly and Postgres: Part 1, Part 2
- [video] Full-stack development of a B2B payment infrastructure with Rust - with Florent Bécart
Rust Walkthroughs
- [series] Master Hexagonal Architecture in Rust: Anatomy of a Bad Rust Application
- How to build a Custom Benchmarking Harness in Rust
- From Sender to Receiver: Rust’s Approach to Local File Transfers
- Build with Naz - Rust error handling with miette
Miscellaneous
Crate of the Week
This week's crate is hydra, an actor framework inspired by Erlang/Elixir.
Thanks to DTZxPorter for the self-suggestion!
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.
No Calls for participation were submitted this week.
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.
- 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
409 pull requests were merged in the last week
- fix: build on haiku
- unsafe extern blocks
- allow static mut definitions with
#[linkage]
- closures are recursively reachable
rustc_codegen_ssa
: fixget_rpath_relative_to_output
panic when lib only contains file name- avoid follow-up errors if the number of generic parameters already doesn't match
- convert
proc_macro_back_compat
lint to an unconditional error - detect pub structs never constructed and unused associated constants
- detect when user is trying to create a lending
Iterator
and give a custom explanation - directly add extension instead of using
Path::with_extension
- don't drop
Unsize
candidate in intercrate mode - don't trigger
unsafe_op_in_unsafe_fn
for deprecated safe fns - don't walk the bodies of free constants for reachability
- don't warn on fields in the
unreachable_pub
lint - enable GVN for
AggregateKind::RawPtr
- fix ICE caused by ignoring EffectVars in type inference
- fix ICE due to
unwrap
inprobe_for_name_many
- improve renaming suggestion for names with leading underscores
- interpret: do not ICE on padded non-pow2 SIMD vectors
- make TLS accessors closures that return pointers
- make deleting on LinkedList aware of the allocator
- make html rendered by rustdoc allow searching non-English identifier / alias
- mark binding undetermined if target name exist and not obtained
- match ergonomics 2024: align implementation with RFC
- orphanck (old solver): Consider opaque types to never cover type parameters
- parse unsafe attributes
- raise
DEFAULT_MIN_STACK_SIZE
to at least 64KiB - resolve: mark it undetermined if single import has no bindings
- scalarInt: size mismatches are a bug, do not delay the panic
- set
has_unconstrained_ty_var
when generalizing aliases in bivariant contexts - silence follow-up errors directly based on error types and regions
- split smir
Const
intoTyConst
andMirConst
- store the types of
ty::Expr
arguments in thety::Expr
- when
derive
ing, account for HRTB onBareFn
fields - winnow private method candidates instead of assuming any candidate of the right name will apply
- add
SingleUseConsts
mir-opt pass - miri:
simd_bitmask
: nicer error when the mask is too big - miri:
simd_bitmask
: work correctly for sizes like 24 - miri:
simd_select_bitmask
: fix intrinsic name in error - miri: add support for
pclmulqdq
intrinsic - miri: don't panic if time computaton overflows
- miri: fix futex with large timeout ICE
- miri: fix stage in contributing
- stabilize order of MonoItems in CGUs and disallow
query_instability
lint forrustc_monomorphize
- stabilize
Option::take_if
- stabilize
binary_heap_as_slice
- stabilize
error_in_core
- Allow
core_intrinsics
when activated (RFC #2011) - add function
core::iter::chain
offset_of
: allow (unstably) taking the offset of slice tail fields- add
FRAC_1_SQRT_2PI
constant to f16/f32/f64/f128 - add
size_of
andsize_of_val
andalign_of
andalign_of_val
to the prelude - hashbrown: feat: borsh serde
- portable SIMD: implement special swizzles for masks and remove {
to
,from
}_bitmask_vector
- regex: escape invalid UTF-8 bytes in debug output for
Match
- cargo lints: Add
unknown_lints
to lints list - cargo toml: Convert warnings that
licence
andreadme
files do not exist into errors - cargo toml: remove
lib.plugin
key support and make it warning - cargo: proc-macro example from dep no longer affects feature resolution
- cargo: remove
__CARGO_GITOXIDE_DISABLE_LIST_FILES
env var - cargo: using
--release/debug
and--profile
together becomes an error - cargo: rename --out-dir to --artifact-dir
- rustdoc-search: use lowercase, non-normalized name for type search
- rustdoc: add support for --remap-path-prefix
- rustdoc: include trailing commas in wrapped function declarations
- clippy:
lint_groups_priority
: ignore lints & groups at the same level - clippy:
match_same_arms
: add a test case with lifetimes - clippy:
overly_complex_bool_expr
: Fix false positive on never type - clippy: add
needless_maybe_sized
lint - clippy: add required parentheses around method receiver
- clippy: dedup
nonminimal_bool_methods
diags - clippy: don't lint blocks in closures for
blocks_in_conditions
- clippy: fix
to_string_in_format_args
with macro call receiver - clippy: fix false positive for
needless_character_iteration
lint - clippy: handle const effects inherited from parent correctly in
type_certainty
- clippy: lint
manual_unwrap_or_default
forResult
as well - clippy: make
for_each_expr
visit closures by default, rename the old versionfor_each_expr_without_closures
- clippy: only run
suboptimal_flops
on inherent method calls - rust-analyzer: add preference modifier for workspace-local crates when using auto import
- rust-analyzer: add version info to status bar item
- rust-analyzer: changed
package.json
so vscode extension settings have submenus - rust-analyzer: TOML based config for rust-analyzer
- rust-analyzer: compute native diagnostics in parallel
- rust-analyzer: hide double underscored symbols from symbol search
- rust-analyzer: do not resolve prelude within block modules
- rust-analyzer: ensure that the parent of a
SourceRoot
cannot be itself - rust-analyzer: fix generated markers not being patchable in
package.json
- rust-analyzer: fix renaming imports of foreign items touching foreign sources
- rust-analyzer: highlight unlinked files consistently with inactive files
- rust-analyzer: incorrect formatting of hover actions
- rust-analyzer: remove extra parse cache from Semantics again
- rust-analyzer: try caching macro calls more aggressively in Semantics
Rust Compiler Performance Triage
This week saw more regressions than wins, caused mostly by code being reorganized within the compiler and a new feature being implemented. There have also been some nice improvements caused by better optimizing spans.
Triage done by @kobzol. Revision range: 1d52972d..b5b13568
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.6% | [0.2%, 2.7%] | 105 |
Regressions ❌ (secondary) |
1.0% | [0.1%, 6.9%] | 74 |
Improvements ✅ (primary) |
-0.5% | [-1.0%, -0.2%] | 20 |
Improvements ✅ (secondary) |
-1.4% | [-8.8%, -0.2%] | 32 |
All ❌✅ (primary) | 0.5% | [-1.0%, 2.7%] | 125 |
5 Regressions, 3 Improvements, 4 Mixed; 5 of them in rollups 59 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] UnsafePinned: allow aliasing of pinned mutable references
- [disposition: postpone] RFC: make Cargo embed dependency versions in the compiled binary
Tracking Issues & PRs
Rust
- [disposition: close] Should we allow StorageLive on a live local?
- [disposition: merge] Tracking Issue for
hint::assert_unchecked
- [disposition: merge] Collect relevant item bounds from trait clauses for nested rigid projections
- [disposition: close] conflicting impl since nightly-2024-05-01
- [disposition: merge] Document behavior of create_dir_all wrt. empty path
Cargo
- [disposition: merge] Include vcs_info even if workspace is dirty
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
- [updated] fix links of I/O safety RFC
- [new] RFC: Return Type Notation
Upcoming Events
Rusty Events between 2024-06-12 - 2024-07-10 🦀
Virtual
- 2024-06-12 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2024-06-13 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-06-13 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-06-16 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-06-18 | Virtual (Washington, DC, US) | Rust DC
- 2024-06-19 | Hybrid - Virtual and In-person (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
- 2024-06-25 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-06-27 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-07-02 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 2024-07-03 | Virtual | Training 4 Programmers LLC
- 2024-07-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-07-04 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-07-06 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2024-07-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-07-10 | Virtual | Centre for eResearch
Asia
- 2024-06-22 | Bangalore, IN | Rust Bangalore
- 2024-06-30 | Kyoto, JP | Kyoto Rust
Europe
- 2024-06-12 | Reading, UK | Reading Rust Workshop
- 2024-06-18 | Frankfurt/Main, DE | Rust Frankfurt Meetup
- 2024-06-19 - 2024-06-24 | Zürich, CH | RustFest Zürich
- 2024-06-20 | Aarhus, DK | Rust Aarhus
- 2024-06-25 | Gdańsk, PL | Rust Gdansk
- 2024-06-27 | Berlin, DE | Rust Berlin
- 2024-06-27 | Copenhagen, DK | Copenhagen Rust Community
North America
- 2024-06-12 | Detroit, MI, US | Detroit Rust
- 2024-06-13 | Spokane, WA, US | Spokane Rust
- 2024-06-14 | Spokane, WA, US | Spokane Rust
- 2024-06-17 | Minneapolis, MN US | Minneapolis Rust Meetup
- 2024-06-18 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-06-19 | Hybrid - Vancouver, BC, CA | Vancouver Rust
- 2024-06-20 | Seattle, WA, US | Seattle Rust User Group
- 2024-06-24 | Somerville, MA, US | Boston Rust Meetup
- 2024-06-26 | Austin, TX, US | Rust ATC
- 2024-06-27 | Nashville, TN, US | Music City Rust Developers
- 2024-07-05 | Boston, MA, US | Boston Rust Meetup
Oceania
- 2024-06-14 | Melbourne, VIC, AU | Rust Melbourne
- 2024-06-20 | Auckland, NZ | Rust AKL
- 2024-06-25 | 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
I like explicit but I hate noise...
– dlevac discussing error handling on /r/golang
Thanks to robin 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