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
Project/Tooling Updates
- Bevy Foundation is now a 501(c)(3) Public Charity
- Development of rustc_codegen_gcc
- Postcard 2.0: Looking for Sponsors!
- Announcing Stable V8 Bindings for Rust
- Perpetual 0.4.7, Quantile regression support and improved multi-threading
- git-cliff 2.6.0 is released! (a highly customizable changelog generator)
- Fjall 2.0, LSM-based safe Rust key-value storage engine
Observations/Thoughts
- "Truly Hygienic" Let Statements in Rust
- One year of Rust in production
- Rust panics under the hood, and implementing them in .NET
- [video] Miguel Raz - Building a compile-time SIMD optimized smoothing filter
- [video] Rust LLM Frameworks have a Bright Future
- [audio] What Are You Syncing About?
- [audio] You might not need Arc
Rust Walkthroughs
- The Watermelon Operator
- Fast Unorm Conversions
- A small trick for simple Rust/C++ interop
- [video] Decrusting the quickcheck crate
- [video] Build low poly terrain from planes meshes in Bevy
- [video] Build with Naz : Rust lifetimes
- [video] Backend in Rust 02 - JWT Authentication, Sea ORM, Axum, Rust
Miscellaneous
- Eliminating Memory Safety Vulnerabilities at the Source
- Committing to Rust in the kernel
- How to Learn Rust in 2024: A Complete Beginner’s Guide to Mastering Rust Programming
Crate of the Week
This week's crate is perpetual, a self-generalizing gradient boosting implementation.
Thanks to Mutlu Simsek 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.
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
400 pull requests were merged in the last week
- add arm64e-apple-tvos target
- parser: recover from
:::to:: read_volatile __rust_no_alloc_shim_is_unstableinalloc_zeroed- add
unqualified_local_importslint - add recursion limit to FFI safety lint
- apply
EarlyOtherwiseBranchto scalar value - assert that
explicit_super_predicates_ofandexplicit_item_super_predicatestruly only contains bounds for the type itself - bail if there are too many non-region infer vars in the query response
- call
module_name_to_strinstead of just unwrapping - change
download-ci-llvmdefault fromif-unchangedtotrue - check params for unsafety in THIR
- compiler: accept "improper" ctypes in extern "rust-cold" fn
- compiler: factor out
OVERFLOWING_LITERALSimpl - correct outdated object size limit
- disallow hidden references to mutable static
- do not ICE with incorrect empty suggestion
- do not expect infer/bound/placeholder/error in v0 symbol mangling
- don't ICE in
opaque_hidden_inferred_boundlint for RPITIT in trait with no default method body - don't call
extern_cratewhen local crate name is the same as a dependency and we have a trait error - don't call
ty::Const::normalizein error reporting - encode
coroutine_by_move_body_def_idin crate metadata - ensure that
keyword_identlint doesn't trigger on'r#kwlifetime - fix
break_last_token - fix anon const def-creation when macros are involved take 2
- fix circular
fn_sigqueries to correct number of args for methods - fix fluent diagnostics
- further improve diagnostics for expressions in pattern position
- gate
repr(Rust)correctly on non-ADT items - get rid of niche selection's dependence on fields's order
- handle unsized consts with type
strin v0 symbol mangling - implement Return Type Notation (RTN)'s path form in where clauses
- improve handling of raw-idents in check-cfg
- normalize consts in writeback when GCE is enabled
- relate receiver invariantly in method probe for
Mode::Path - remove semi-nondeterminism of
DefPathHashordering from inliner - replace calls to
ty::Const::{try_}evalin mir build/pattern analysis - rework
non_local_definitionslint to only use a syntactic heuristic - support 128-bit atomics on s390x
- take more advantage of the
isize::MAXlimit inLayout - use
Vecinrustc_interface::Config::locale_resources - win: open dir for sync access in
remove_dir_all - miri: automatically add/remove labels when github review (requests) are used
- miri: refactor fd read/write
- add
extern "C-cmse-nonsecure-entry" fn - don't alloca for unused locals
- perf: skip normalizing param env if it is already normalized
- begin experimental support for pin reborrowing
RepeatN: use MaybeUninit- add
Thread::{into_raw, from_raw} - add
Vec::as_non_null - add
new_cyclic_infor Rc and Arc - add
str.as_str()for easy Deref to string slices - avoid re-validating UTF-8 in
FromUtf8Error::into_utf8_lossy - delay uncapping the
max_read_sizeinFile::read_to_end - add
Lazy{Cell,Lock}::get[_mut]andforce_mut - make unstable
Result::flattena const fn - mark
char::make_ascii_uppercaseandchar::make_ascii_lowercaseas const - mark
u8::make_ascii_uppercaseandu8::make_ascii_lowercaseas const - pass
fmt::Argumentsby reference toPanicInfoandPanicMessage - stabilize const
MaybeUninit::as_mut_ptr - remove uneeded
PartialOrdbound incmp::Ord::clamp - std: implement the
randomfeature (alternative version) - support
char::encode_utf16in const scenarios - support
char::encode_utf8in const scenarios - futures: fix issues with
AsyncBufRead::read_lineandAsyncBufReadExt::lines - hashbrown: implement Clone and Debug for HashTable's Iter
struct - hashbrown: implement
Debug,FusedIteratorandIterator::foldfor allHashTableiterators - hashbrown: re-introduce a way to get the allocation size of a table
- cargo: complete: Upgrade
clap_complete - cargo: complete: Harden
--targetcompletions - cargo: resolve: Don't list transitive, incompatible dependencies as available
- cargo: resolve: Improve multi-MSRV workspaces
- cargo: add a
--dry-runflag to theinstallcommand - cargo: add custom completer for
cargo build --example=<TAB> - cargo: add custom completer for
cargo help <TAB> - cargo: add custom completer for completing benchmark names
- cargo: add custom completer for completing target triple
- cargo: add custom completer for completing test names
- cargo: suggest
cargo infocommand in thecargo searchresult - rustdoc: use the correct span for doctests
- clippy: ignore
missing_panics_docin const context - clippy: fix
if_then_some_else_nonesugg missing closure intro - clippy: generate versions HTML directly (nice poem, @xFredNet)
- clippy: initial impl of
unnecessary_first_then_check - clippy: lint comparison to empty slice using
PartialEqmethods - clippy: unused trait imports (formerly anonymous trait import)
- clippy: use contiguous spans for
empty_line_after_*suggestion - rust-analyzer: don't lint names of
#[no_mangle]extern fns - rust-analyzer: add diagnostics for
unsafe_op_in_unsafe_fn - rust-analyzer: implement
expr_2021 - rust-analyzer: support the
${concat(...)}metavariable expression - rust-analyzer: always cache macro expansions' root node in Semantics
- rust-analyzer: don't complete
;when in closure return expression - rust-analyzer: extend
type_variable_tablewhen modifying index is larger than the table size - rust-analyzer: get rid of
$cratein expansions shown to the user - rust-analyzer: handle errors and lints from external macros
- rust-analyzer: handle lint attributes that are under
#[cfg_attr] - rust-analyzer: remove check that text of
parse_expr_from_str()matches the produced parsed tree - rust-analyzer: support expect in attribute completion and hover
- rust-analyzer: when checking for forbidden expr kind matches, account for rawness
Rust Compiler Performance Triage
Not too much happened this week. Most regressions of note were readily justified as removing sources of unpredictable/inconsistent behavior from code-generation. There was one notable improvement, from PR #130561: avoiding redoing a redundant normalization of the param-env ended up improving compile times for 93 primary benchmarks by -1.0% on average.
Triage done by @pnkfelix. Revision range: 170d6cb8..749f80ab Revision range: 506f22b4..4cadeda9
(there are two revision ranges to manually work around a rustc-perf website issue.)
2 Regressions, 2 Improvements, 7 Mixed; 4 of them in rollups 62 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] RFC: Allow boolean literals as
cfgpredicates - [disposition: merge] Trait method impl restrictions
- [disposition: merge] Supertrait item shadowing v2
- [disposition: merge] Move
rustdoc-typescrate to T-Rustdoc ownership.
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking Issue for const_ptr_write
- [disposition: merge] Tracking Issue for PanicHookInfo::payload_as_str()
- [disposition: merge] Tracking Issue for const_replace
- [disposition: merge] ptr::add/sub: do not claim equivalence with
offset(c as isize) - [disposition: merge] Allow dropping
dyn Traitprincipal - [disposition: merge] Stabilize expr_2021 fragment specifier in all editions
- [disposition: merge] Make deprecated_cfg_attr_crate_type_name a hard error
- [disposition: merge] atomics: allow atomic and non-atomic reads to race
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- [disposition: merge] Meeting proposal: rename "object safety" to "dyn compatibility"
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
Upcoming Events
Rusty Events between 2024-09-25 - 2024-10-23 🦀
Virtual
- 2024-09-25 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2024-09-26 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-09-26 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-02 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2024-10-02 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-10-02 | Virtual (Vancouver, BC, CA) | Vancouver Postgres
- 2024-10-03 | Virtual | Women in Rust
- 2024-10-03 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-10-10 | Virtual | Women in Rust
- 2024-10-10 | Virtual (Barcelona, ES) | BcnRust + Codurance
- 2024-10-10 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-10-10 | Virtual (Girona, ES) | Rust Girona
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-14 | Virtual | Women in Rust
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17 | Virtual | Women in Rust
- 2024-10-17| Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-22 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-10-05 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-09-30 | Singapore, SG | Singapore Rust Meetup
- 2024-10-09 | Subang Jaya / Kuala Lumpur, Selangor, MY | Rust Malaysia
- 2024-10-17 - 2024-10-18 | Beijing, CN | Global Open-Source Innovation Meetup (GOSIM)
- 2024-10-19 | Bangalore/Bengaluru, IN | Rust Bangalore
Europe
- 2024-09-26 | Aarhus, DK | Rust Aarhus
- 2024-09-26 | Augsburg, DE | Rust Meetup Augsburg
- 2024-09-26 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-09-26 | Prague, CZ | Rust Prague
- 2024-09-27 | Mannheim, DE | Hackerstolz e.V.
- 2024-10-02 | Oxford, UK | Oxfrod Rust Meetup Group
- 2024-10-02 | Stockholm, SE | Stockholm Rust
- 2022-10-03 | Nürnberg, DE | Rust Nurnberg DE
- 2024-10-03 | Oslo, NO | Rust Oslo
- 2024-10-09 | Reading, UK | Reading Rust Workshop
- 2024-10-10 - 2024-10-11 | Virtual and In-Person (Vienna, AT) | Euro Rust
- 2024-10-15 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
North America
- 2024-09-25 | Austin, TX, US | Rust ATX
- 2024-09-26 | Nashville, TN, US | Music City Rust Developers
- 2024-09-27 | Cambridge, MA, US | Boston Rust Meetup
- 2024-10-03 | Boston, MA, US | SquiggleConf
- 2024-10-03 | St. Louis, MO, US | STL Rust
- 2024-10-04 | Mexico City, DF, MX | Rust MX
- 2024-10-08 | Detroit, MI, US | Detroit Rust
- 2024-10-15 | Virtual (Washington, DC, US) | Rust DC
- 2024-10-16 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-10-17| Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-10-23 | Austin, TX, US | Rust ATX
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
New users feel like iteration times are so slow and it takes forever to get going with Rust. But if there's a library available, I feel like I'm roughly as productive with Rust as I am with Ruby, if not more, when I think about the whole amount of work I'm doing. I haven't really figured out how to talk about that without sounding purely like a zealot, but yeah, I feel like Rust is actually very, very productive, even though many people don't see it that way initially.
– Steve Klabnik at Oxidize Conference
Thanks to Brian Kung 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