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
Project/Tooling Updates
- ratatui - v0.27.0
- Introduction - ChoRus
- uuid now properly supports version 7 counters
- Godot-Rust - June 2024 update
- piggui v0.2.0
- git-cliff 2.4.0 is released!
Observations/Thoughts
- Claiming, auto and otherwise
- Ownership
- Puzzle: Sharing declarative args between top level and subcommand using Clap
- Will Rust be alive in 10 years?
- Why WebAssembly came to the Backend (Wasm in the wild part 3)
- in-place construction seems surprisingly simple?
- Igneous Linearizer
- Life in the FastLanes
- Rust's concurrency model vs Go's concurrency model: stackless vs stackfull coroutines
Rust Walkthroughs
- Master Rust by Playing Video Games!
- Tokio Waker Instrumentation
- Build with Naz : Comprehensive guide to nom parsing
- Running a TLC5940 with an ESP32 using the RMT peripheral
- Rust Data-Structures: What is a CIDR trie and how can it help you?
- Rust patterns: Micro SDKs
- [series] The Definitive Guide to Error Handling in Rust (part 1): Dynamic Errors
Research
Miscellaneous
Crate of the Week
This week's crate is cargo-binstall, a cargo subcommand to install crates from binaries out of their github releases.
Thanks to Jiahao XU 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.
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.
- 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
428 pull requests were merged in the last week
hir_typeck
: be more conservative in making "note caller chooses ty param" noterustc_type_ir
: Omit somestruct
fields from Debug output- account for things that optimize out in inlining costs
- actually taint
InferCtxt
when a fulfillment error is emitted - add
#[rustc_dump_{predicates,item_bounds}]
- add hard error and migration lint for unsafe attrs
- allow "C-unwind" fn to have C variadics
- allow constraining opaque types during subtyping in the trait system
- allow constraining opaque types during various unsizing casts
- allow tracing through
item_bounds
query invocations on opaques - ban
ArrayToPointer
andMutToConstPointer
from runtime MIR - change a
DefineOpaqueTypes::No
toYes
in diagnostics code - collect attrs in const block expr
- coverage: add debugging flag
-Zcoverage-options=no-mir-spans
- coverage: overhaul validation of the
#[coverage(..)]
attribute - do not allow safe/unsafe on static and fn items
- don't ICE when encountering an extern type field during validation
- fix: break inside async closure has incorrect span for enclosing closure
- E0308: mismatched types, when expr is in an arm's body, don't add semicolon ';' at the end of it
- improve conflict marker recovery
- improve tip for inaccessible traits
- interpret: better error when we ran out of memory
- make async drop code more consistent with regular drop code
- make edition dependent
:expr
macro fragment act like the edition-dependent:pat
fragment does - make pretty printing for
f16
andf128
consistent - match lowering: expand or-candidates mixed with candidates above
- show notice about "never used" of Debug for
enum
- stop sorting
Span
s'SyntaxContext
, as that is incompatible with incremental - suggest inline const blocks for array initialization
- suggest removing unused tuple fields if they are the last fields
- uplift next trait solver to
rustc_next_trait_solver
- add
f16
andf128
- miri: /miri: nicer error when building miri-script fails
- miri:
unix/foreign_items
: move getpid to the right part of the file - miri: don't rely on libc existing on Windows
- miri: fix ICE caused by seeking past
i64::MAX
- miri: implement LLVM x86 adx intrinsics
- miri: implement LLVM x86 bmi intrinsics
- miri: nicer batch file error when building miri-script fails
- miri: use strict ops instead of checked ops
- save 2 pointers in
TerminatorKind
(96 → 80 bytes) - add
SliceLike
torustc_type_ir
, use it in the generic solver code (+ some other changes) std::unix::fs
: copy simplification for applestd::unix::os::home_dir
: fallback's optimisation- replace
f16
andf128
pattern matching stubs with real implementations - add
PidFd::
{kill
,wait
,try_wait
} - also get
add nuw
fromuN::checked_add
- generalize {
Rc
,Arc
}::make_mut()
to unsized types - implement
array::repeat
- make
Option::as_[mut_]slice
const
- rename
std::fs::try_exists
tostd::fs::exists
and stabilizefs_try_exists
- replace sort implementations
- return opaque type from
PanicInfo::message()
- stabilise
c_unwind
- std: refactor the thread-local storage implementation
- hashbrown: implement XxxAssign operations on HashSets
- hashbrown: replace "ahash" with "default-hasher" in Cargo features
- cargo toml: warn when edition is unset, even when MSRV is unset
- cargo: add
CodeFix::apply_solution
and implClone
- cargo: make
-Cmetadata
consistent across platforms - cargo: simplify checking feature syntax
- cargo: simplify checking for dependency cycles
- cargo test: add auto-redaction for not found error
- cargo test: auto-redact file number
- rustdoc: add support for
missing_unsafe_on_extern
feature - implement
use<>
formatting in rustfmt - rustfmt: format safety keywords on static items
- remove stray println from rustfmt's
rewrite_static
- resolve clippy
f16
andf128 unimplemented!
/FIXME
s - clippy:
missing_const_for_fn
: add machine-applicable suggestion - clippy: add applicability filter to lint list page
- clippy: add more types to
is_from_proc_macro
- clippy: don't lint
implicit_return
on proc macros - clippy: fix incorrect suggestion for
manual_unwrap_or_default
- clippy: resolve
clippy::invalid_paths
onbool::then
- clippy: unnecessary call to min/max method
- rust-analyzer: complete async keyword
- rust-analyzer: check that Expr is none before adding fixup
- rust-analyzer: add
toggleLSPLogs
command - rust-analyzer: add space after specific keywords in completion
- rust-analyzer: filter builtin macro expansion
- rust-analyzer: don't remove parentheses for calls of function-like pointers that are members of a
struct
or union - rust-analyzer: ensure there are no cycles in the
source_root_parent_map
- rust-analyzer: fix IDE features breaking in some attr macros
- rust-analyzer: fix flycheck panicking when cancelled
- rust-analyzer: handle character boundaries for wide chars in
extend_selection
- rust-analyzer: improve hover text in unlinked file diagnostics
- rust-analyzer: only show unlinked-file diagnostic on first line during startup
- rust-analyzer: pattern completions in let-stmt
- rust-analyzer: use
ItemInNs::Macros
to convert ModuleItem to ItemInNs - rust-analyzer: remove panicbit.cargo extension warning
- rust-analyzer: simplify some term search tactics
- rust-analyzer: term search: new tactic for associated item constants
Rust Compiler Performance Triage
Mostly a number of improvements driven by MIR inliner improvements, with a small number benchmarks having a significant regression due to improvements in sort algorithms, which are runtime improvements at the cost of usually slight or neutral compile time regressions, with outliers in a few cases.
Triage done by @simulacrum. Revision range: c2932aaf..c3d7fb39
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week: * Change crates.io policy to not offer crate transfer mediation * UnsafePinned: allow aliasing of pinned mutable references
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] RFC: Return Type Notation
- [disposition: merge] Add a general mechanism of setting RUSTFLAGS in Cargo for the root crate only
- [disposition: close] Allow specifying dependencies for individual artifacts
Tracking Issues & PRs
Rust
- [disposition: merge]
#![crate_name = EXPR]
semantically allowsEXPR
to be a macro call but otherwise mostly ignores it - [disposition: merge] Add nightly style guide section for
precise_capturing
use<>
syntax - [disposition: merge] Tracking issue for PanicInfo::message
- [disposition: merge] Tracking issue for Cell::update
- [disposition: \<unspecified>] Tracking issue for core::arch::{x86, x86_64}::has_cpuid
- [disposition: merge] Syntax for precise capturing:
impl Trait + use<..>
- [disposition: merge] Remove the
box_pointers
lint. - [disposition: merge] Re-implement a type-size based limit
- [disposition: merge] Tracking Issue for
duration_abs_diff
- [disposition: merge] Check alias args for WF even if they have escaping bound vars
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team Tracking Issues or PRs entered Final Comment Period this week.
Language Reference
- No Language Reference Tracking Issues or PRs 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
- [new] Cargo structured syntax for feature dependencies on crates
- [new] Mergeable rustdoc cross-crate info
- [new] Add "crates.io: Crate Deletions" RFC
Upcoming Events
Rusty Events between 2024-06-26 - 2024-07-24 🦀
Virtual
- 2024-06-27 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-07-02 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 2024-07-02 | Hybrid - Virtual and In-person (Los Angeles, CA, US) | Rust Los Angeles
- 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 | Rust for Lunch
- 2024-07-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-07-10 | Virtual | Centre for eResearch
- 2024-07-11 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-07-11 | Hybrid - Virtual and In-person (Mexico City, DF, MX) | Rust MX
- 2024-07-11 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-07-11 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-07-16 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-07-17 | Hybrid - Virtual and In-person (Vancouver, BC, CA) | Vancouver Rust
- 2024-07-18 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-07-23| Hybrid - Virtual and In-Person (München/Munich, DE) | Rust Munich
- 2024-07-24 | Virtual | Women in Rust
Asia
- 2024-06-30 | Kyoto, JP | Kyoto Rust
- 2024-07-03 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-06-27 | Berlin, DE | Rust Berlin
- 2024-06-27 | Copenhagen, DK | Copenhagen Rust Community
- 2024-07-10 | Reading, UK | Reading Rust Workshop
- 2024-07-11 | Prague, CZ | Rust Prague
- 2024-07-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-07-16 | Mannheim, DE | Hackschool - Rhein-Neckar
- 2024-07-23| Hybrid - Virtual and In-Person (München/Munich, DE) | Rust Munich
North America
- 2024-06-26 | Austin, TX, US | Rust ATC
- 2024-06-27 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-06-27 | Nashville, TN, US | Music City Rust Developers
- 2024-06-27 | St. Louis, MO, US | STl Rust
- 2024-07-02 | Hybrid - Los Angeles, CA, US | Rust Los Angeles
- 2024-07-05 | Boston, MA, US | Boston Rust Meetup
- 2024-07-11 | Hybrid - Mexico City, DF, MX | Rust MX
- 2024-07-11 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-07-17 | Hybrid - Vancouver, BC, CA | Vancouver Rust
- 2024-07-18 | Nashville, TN, US | Music City Rust Developers
- 2024-07-24 | Austin, TX, US | Rust ATC
Oceania
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
Rust has no theoretical inconsistencies... a remarkable achievement...
– Simon Peyton-Jones on YouTube
Thanks to ZiCog for the suggestion and Simon Farnsworth for the improved link!
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