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
Project/Tooling Updates
- The Rust 2024 Edition takes shape
- Defmt is going to 1.0
- rust-analyzer changelog #270
- git-cliff 2.8.0 is released! (a highly customizable changelog generator)
Observations/Thoughts
- Musings on iterator trait names
- The magic function
- Custom Equatability in Rust: Beyond the Standard Cases
- [audio] Rahul Kumar: Why verify Rust's standard library?
- [audio] Volvo with Julius Gustavsson
Rust Walkthroughs
Crate of the Week
This week's crate is embed_it, a crate that helps you to embed assets into your binary and generates structs / trait implementations for each file or directory.
Thanks to Riberk 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.
RFCs
Rust
Rustup
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
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
408 pull requests were merged in the last week
- support QNX 7.1 with
io-sock+libstd and QNX 8.0 (no_stdonly) - mark all NuttX targets as tier 3 target and support the standard library
- add NuttX support for AArch64 and ARMv7-A targets
- add
#[optimize(none)] - account for mutable borrow in argument suggestion
- add a suggestion to cast
target_featurefn items to fn pointers - add a workaround for parallel rustc crashing when there are delayed bugs
- change
collect_and_partition_mono_itemstuple return type to astruct - codegen: store ScalarPair via memset when one side is undef and the other side can be memset
- compiler: set
target_abi = "ilp32e"on all riscv32e targets - coverage: prepare for upcoming changes to counter creation
- detect missing fields with default values and suggest
.. - do not assume const params are printed after type params
- don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver
- don't drop types with no drop glue when building drops for tailcalls
- don't pick
T: FnPtrnested goals as the leaf goal in diagnostics for new solver - enable
unreachable_publint intestandproc_macrocrates - enable kernel sanitizers for aarch64-unknown-none-softfloat
- fix GDB
OsStringprovider on Windows - fix ICE: multiple never-pattern arm doesn't have
false_edge_start_block - forbid usage of
hir Inferconst/ty variants in ambiguous contexts - handle global trait bounds defining assoc types
- implement
needs-subprocessdirective, and cleanup a bunch of tests to useneeds-{subprocess,threads} - improve check-cfg expected names diagnostic
- make our
DIFlagsmatchLLVMDIFlagsin the LLVM-C API - make the
wasm_c_abifuture compat warning a hard error - point at invalid utf-8 span on user's source code
- properly record metavar spans for other expansions other than TT
- properly report error when object type param default references self
- remove support for the (unstable)
#[start]attribute - remove usages of
QueryNormalizerin the compiler - reword resolve errors caused by likely missing crate in dep tree
- rework dyn trait lowering to stop being so intertwined with trait alias expansion
- shorten linker output even more when
--verboseis not present - show linker output even if the linker succeeds
- simplify
parse_format::Parser::wsby usingnext_if - skip
if-let-rescopelint unless requested by migration - skip suggestions in
derived code - support wasm inline assembly in
naked_asm! - tidy Python improvements
- uplift
clippy::double_neglint asdouble_negations - use
structurally_normalizeinstead of manualnormalizes-togoals in alias relate errors - use identifiers more in diagnostics code
- use short type string in E0308 secondary span label
- miri: many-seeds: do not use more than 8 threads
- miri: pre-intern name when searching module children
- implement
ByteStrandByteStringtypes - implement
VecDeque::pop_front_if&VecDeque::pop_back_if - implement phantom variance markers
- windows x86: Change i128 to return via the vector ABI
- cargo: config: When merging, replace rather than combining specific configuration keys
- cargo: login: Deprecate CLI token
- cargo: fix
shared_std_dependency_rebuildrunning on Windows - cargo: fix broken links in the Cargo book
- cargo: make --allow-dirty imply --allow-staged
- cargo: print globs when workspace members can't be found
- cargo: remove unused
-C link-arg=-fuse-ld=lld - rustdoc: Fix indent of trait items on mobile
- rustfmt: fix:
wrap_commentscreating invalid code blocks - clippy:
arithmetic_side_effects: check adjusted expression types - clippy:
match_bool: fix suggestion if guard is present - clippy:
short_circuit_statement: handle macros and parenthesis better - clippy:
unnecessary_semicolon: do not lint if it may cause borrow errors - clippy: add necessary adjustments to suggestion to remove redundant
.into_iter()calls - clippy: add new lint
doc_overindented_list_items - clippy: add new lint
non_std_lazy_statics - clippy: correct suggestions in
no_std - clippy: don't trigger
needless_late_initwhen the first usage is in macro - clippy: make
unnecessary_map_orwork with ref andDereftoOption/Result - clippy: new lint
sliced_string_as_bytes - clippy: proper applicability for
obfuscated_if_else - clippy: suggest using
Vec::extend()insame_item_push - clippy: trigger
obfuscated_if_elsefor.then(..).unwrap_or(..) - rust-analyzer: check cfg when collecting macro defs
- rust-analyzer: explicitly add buildfiles when constructing ProjectFolders
- rust-analyzer: implement
arbitrary-self-types - rust-analyzer: implement
default-field-values - rust-analyzer: provide a config to control auto-insertion of
awaitanditer() - rust-analyzer: support safe functions marked with
#[target_feature(..)] - rust-analyzer: don't complete
doc(hidden) enumvariants and use trees - rust-analyzer: don't suggest
into_iter().method()on iterators - rust-analyzer: fix
ItemScopenot recording glob imports - rust-analyzer: fix a missing standard token in semantic highlighting
- rust-analyzer: fix flycheck panicking with "once" invocation strategy
- rust-analyzer: fix flyimport not filtering via stability of import path
- rust-analyzer: fix syntactic highlighting for renames
- rust-analyzer: in completion's expand, consider recursion stop condition (when we're not inside a macro call anymore) after the recursive call instead of before it
- rust-analyzer: prevent infinite recursion of bounds formatting
- rust-analyzer: report calling unsafe fn pointer as unsafe
- rust-analyzer: sort completion items that skip
awaitanditer()behind those that don't - rust-analyzer: goto
Display::fmtwhen invoked onto_string - rust-analyzer: increase
AUTODEREF_RECURSION_LIMITto 20 - rust-analyzer: keep already computed inlay hint properties instead of late resolving them
- rust-analyzer: make niches into nices
- rust-analyzer: only collect implicit visibile use symbols if they have renames
- rust-analyzer: prioritize formatting thread tasks in
main_loop - rust-analyzer: split out
ExpressionStorefromBody - rust-analyzer: use
strict_provenance
Rust Compiler Performance Triage
Relatively quiet week, with one large-ish regression that will be reverted. #132666 produced a nice perf. win, by skipping unnecessary work. This PR actually reversed a regression caused by a previous PR.
Triage done by @kobzol.
Revision range: 9a1d156f..f7538506
Summary:
| (instructions:u) | mean | range | count |
|---|---|---|---|
| Regressions ❌ (primary) |
0.5% | [0.2%, 2.2%] | 42 |
| Regressions ❌ (secondary) |
2.1% | [0.1%, 11.6%] | 56 |
| Improvements ✅ (primary) |
-0.8% | [-4.2%, -0.1%] | 107 |
| Improvements ✅ (secondary) |
-1.2% | [-4.0%, -0.1%] | 77 |
| All ❌✅ (primary) | -0.5% | [-4.2%, 2.2%] | 149 |
2 Regressions, 3 Improvements, 2 Mixed; 4 of them in rollups 45 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
Rust
- std: print a backtrace on stackoverflow
- Stabilize const_slice_flatten
- Derive
CopyandHashforIntErrorKind - Tracking Issue for map_many_mut
- Tracking Issue for
const_vec_string_slice - Tracking Issue for
const_mut_cursor - Stabilize
const_is_char_boundaryandconst_str_split_at. - Tracking Issue for
NonZero*::count_ones - Stabilize
const_black_box - Make cenum_impl_drop_cast a hard error
- Tracking Issue for
once_wait - [rustdoc] Add sans-serif font setting
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team Proposals 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 2025-01-29 - 2025-02-26 🦀
Virtual
- 2025-01-30 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2025-01-30 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2025-01-30 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-01-31 | Virtual (Delhi, IN) | Hackathon Raptors Association
- 2025-01-31 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2025-02-01 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2025-02-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2025-02-04 | Virtual (London, GB) | Women in Rust
- 2025-02-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2025-02-06 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2025-02-07 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2025-02-11 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2025-02-13 | Virtual (Berlin, DE) | Rust Berlin
- 2025-02-14 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2025-02-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2025-02-20 | Hybrid (Redmond, WA, US) | Seattle Rust User Group
- 2025-02-21 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2025-02-25 | Virtual (Dallas, TX, US) | Dallas Rust User Meetup
- 2025-02-25 | Virtual (London, UK) | Women in Rust
- 2025-02-25 | Virtual (Washington, DC, US) | Rust DC
Asia
- 2025-02-24 | Tel Aviv-Yafo, IL | Rust 🦀 TLV
Europe
- 2025-01-30 | Augsburg, DE | Rust Meetup Augsburg
- 2025-01-30 | Berlin, DE | Rust Berlin
- 2025-01-30 | Copenhagen, DK | Copenhagen Rust Community
- 2025-02-01 | Brussels, BE | FOSDEM 2025
- 2025-02-01 | Helsinki, FI | Finland Rust-lang Group
- 2025-02-01 | Nürnberg, DE | Rust Nuremberg
- 2025-02-05 | Oxford, UK | Oxford Rust Meetup Group
- 2025-02-06 | Gdansk, PL | Rust Gdansk
- 2025-02-12 | Reading, UK | Reading Rust Workshop
- 2025-02-14 | Edinburgh, UK | Rust and Friends
- 2025-02-18 | Leipzig, SN, DE | Rust - Modern Systems Programming in Leipzig
- 2025-02-19 - 2025-02-20 | London, UK | Rust Nation UK
- 2025-02-20 | Bern, CH | Rust Bern
- 2025-02-21 | London, UK | Rust Global: London 2025
- 2025-02-22 | Stockholm, SE | Stockholm Rust
North America
- 2025-01-31 | Detroit, MI, US | Detroit Rust
- 2025-02-03 | Boston, MA, US | Boston Rust Meetup
- 2025-02-06 | Mountain view, CA, US | Hacker Dojo
- 2025-02-06 | Saint Louis, MO, US | STL Rust
- 2025-02-11 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2025-02-14 | Boston, MA, US | Boston Rust Meetup
- 2025-02-18 | San Francisco, CA, US | San Francisco Rust Study Group
- 2025-02-20 | Nashville, TN, US | Music City Rust Developers
- 2025-02-20 | Redmond, WA, US | Seattle Rust User Group
- 2025-02-21 | México City, MX | Rust MX
- 2025-02-22 | Boston, MA, US | Boston Rust Meetup
- 2025-02-26 | Austin, TX, US | Rust ATX
Oceania
- 2025-02-04 | Auckland, NZ | Rust AKL
- 2025-02-04 | Sydney, AU | Rust Sydney
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 have experience in multiple styles of MMA gained from fighting the borrow checker, if that counts.
– Richard Neumann on rust-users
Thanks to Jonas Fassbender for the suggestion!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, U007D, joelmarcey, mariannegoldin, bennyvasquez, bdillo
Email list hosting is sponsored by The Rust Foundation