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
- An update on Apple M1/M2 GPU drivers
- Announcing Toasty, an async ORM for Rust
- gitoxide - October 2024
- Glues v0.4 - MongoDB support and Vim editing features
- Meilisearch 1.11 - AI-powered search & federated search improvements
Observations/Thoughts
- Toward safe transmutation in Rust
- The performance of the Rust compiler
- A new approach to validating test suites
- Why You Shouldn't Arc a HashMap in Rust
- Implementing the Tower Service Trait
- Best Practices for Derive Macro Attributes in Rust
- Trimming down a rust binary in half
- A deep look into our new massive multitenant architecture
- Unsafe Rust Is Harder Than C
- Generators with UnpinCell
- Which LLM model is best for generating Rust code?
- Learnings from Contributing to the Rust Project
- Dyn Box Vs. Generics: What is the best approach for achieving conditional generics in Rust?
Rust Walkthroughs
Miscellaneous
- Rust Prism
- [audio] Rust vs. C++ with Steve Klabnik and Herb Sutter
- [audio] What's New in Rust 1.76, 1.77, and 1.78
- [video] Talk on Chrome's new Rust font stack, fontations
- [video] Architecting a Rust Game Engine (with Alice Cecile)
- [video] Gitoxide: What it is, and isn't - Sebastian Thiel
Crate of the Week
This week's crate is tower-http-client, a library of middlewares and various utilities for HTTP-clients.
Thanks to Aleksey Sidorov 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
447 pull requests were merged in the last week
- add wasm32v1-none target
- AIX: use /dev/urandom for random implementation
rustc_target
: Add pauth-lr aarch64 target feature- add a note for
?
on aimpl Future<Output = Result<..>>
in sync function - add support for
~const
item bounds - consider param-env candidates even if they have errors
- const stability checks v2
- coverage: consolidate creation of covmap/covfun records
- coverage: don't rely on the custom traversal to find enclosing loops
- coverage: emit LLVM intrinsics using the normal helper method
- coverage: pass coverage mappings to LLVM as separate structs
- deeply normalize
TypeTrace
when reporting type error in new solver - deny calls to non-
#[const_trait]
methods in MIR constck - do not remove
.cargo
directory - don't stage-off to previous compiler when CI rustc is available
- emit future-incompatibility lint when calling/declaring functions with vectors that require missing target feature
- enable LSX feature for LoongArch Linux targets
- error on alignments greater than
isize::MAX
- expand: stop using artificial
ast::Item
for macros loaded from metadata - fixup Windows verbatim paths when used with the
include!
macro - hashStable for
rustc_feature::Features
: stop hashing compile-time constant - lint against getting pointers from immediately dropped temporaries
- move
cmp_in_dominator_order
out of graph dominator computation - pass constness with span into
lower_poly_trait_ref
- prevent overflowing
enum
cast from ICEing - refactor change detection for rustdoc and download-rustc
- replace an FTP link in comments with an equivalent HTTPS link
- replace some LLVMRust wrappers with calls to the LLVM C API
- represent
hir::TraitBoundModifiers
as distinct parts in HIR - represent trait constness as a distinct predicate
- round negative signed integer towards zero in
iN::midpoint
- simplify force-recompile logic for "library"
- simplify param handling in
resolve_bound_vars
- taking a raw ref (
&raw (const|mut)
) of a deref of pointer (*ptr
) is always safe - use
Enabled{Lang,Lib}Feature
instead of n-tuples - validate args are correct for
UnevaluatedConst
,ExistentialTraitRef
/ExistentialProjection
- x86 target features: make pclmulqdq imply sse2
- x86-32 float return for 'Rust' ABI: treat all float types consistently
- miri: add option for generating coverage reports
- miri: android: added syscall support
- miri: clear
eval_libc
errors from unix shims - miri: consistently use io error handlers
- miri: fix error returned from
readdir_r
when isolation is enabled, and uses ofraw_os_error
- miri: implement LLVM x86 vpclmulqdq intrinsics
- miri: indicate more explicitly where we close host file/dir handles
- (Big performance change) Do not run lints that cannot emit
- optimize
Rc<T>::default
- specialize
read_exact
andread_buf_exact
forVecDeque
- stabilize
isqrt
feature - stabilize shorter-tail-lifetimes
- support
char::is_digit
in const contexts - remove the
Arc rt::init
allocation for thread info - provide a default impl for
Pattern::as_utf8_pattern
- vectorized
SliceContains
- avoid using imports in
thread_local_inner!
in static - better default capacity for
str::replace
- musl: use
posix_spawn
if a directory change was requested - cargo resolver: Make room for v3 resolver
- cargo complete: Include descriptions in zsh
- cargo env: remove unnecessary clones
- cargo: fingerprint: avoid unnecessary fopen calls
- cargo: added unstable-schema generation for Cargo.toml
- cargo: deprecate
cargo verify-project
- cargo fix: add source replacement info when no matching package found
- cargo fix: trace
config [env]
table in dep-info - cargo test: add fixes in the sat resolver
- rustdoc: Do not consider nested functions as main function even if named
main
in doctests - rustdoc: extend
fake_variadic
to "wrapped" tuples - rustdoc: hash assets at rustdoc build time
- allow type-based search on foreign functions
- clippy:
borrow_deref_ref
: do not trigger on&raw
references - clippy: don't trigger
const_is_empty
for inline const assertions - clippy: fire
large_const_arrays
for computed array lengths - clippy: fix incorrect suggestion for
!(a >= b) as i32 == c
- clippy: fix not working lint anchor (generation and filtering)
- clippy: remove unnecessary
filter_map
usages - clippy: stop linting
unused_io_amount
in io traits - rust-analyzer: add text edits to more inlay hints
- rust-analyzer: implement diagnostics pull model
- rust-analyzer: render docs from aliased type when type has no docs
- rust-analyzer: resolve range patterns to their structs
- rust-analyzer: split
macro-error
diagnostic so users can ignore only parts of it - rust-analyzer: support
cfg(true)
andcfg(false)
- rust-analyzer: fix diagnostic enable config being ignored
- rust-analyzer: fix dyn incompatible hint message
- rust-analyzer: fix formatting on welcome page, read only paths setting example
- rust-analyzer: add missing cfg flags for
core
crate - rust-analyzer: allow public re-export of
extern crate
import - rust-analyzer: correctly handle
#""
in edition<2024
- rust-analyzer: don't compute diagnostics for non local files
- rust-analyzer: fix checking for
false labelDetailsSupport
value - rust-analyzer: fix incorrect parsing of use bounds
- rust-analyzer: handle missing time offsets gracefully
- rust-analyzer: implement mixed site hygiene
- rust-analyzer: nail destructuring assignment once and for all
- rust-analyzer: prevent public re-export of private item
- rust-analyzer: properly resolve prelude paths inside modules inside blocks
- rust-analyzer: put leading
|
in patterns underOrPat
- rust-analyzer: turn "Remove
dbg!
" into a quick fix for better prioritization - rust-analyzer: move text-edit into ide-db
- rust-analyzer: only construct a resolver in macro descension when needed
- rust-analyzer: swap query call order in
file_item_tree_query
Rust Compiler Performance Triage
This week saw a lot of activity both on the regressions and improvements side. There was one large regression, which was immediately reverted. Overall, the week ended up being positive, thanks to a rollup PR that caused a tiny improvement to almost all benchmarks.
Triage done by @kobzol. Revision range: 3e33bda0..c8a8c820
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.7% | [0.2%, 2.7%] | 15 |
Regressions ❌ (secondary) |
0.8% | [0.1%, 1.6%] | 22 |
Improvements ✅ (primary) |
-0.6% | [-1.5%, -0.2%] | 153 |
Improvements ✅ (secondary) |
-0.7% | [-1.9%, -0.1%] | 80 |
All ❌✅ (primary) | -0.5% | [-1.5%, 2.7%] | 168 |
6 Regressions, 6 Improvements, 4 Mixed; 6 of them in rollups 58 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
- [disposition: merge] Decide whether blocks inside
asm
goto should default to safe - [disposition: merge] #[inline(never)] does not work for async functions
- [disposition: not specified] Add LowerExp and UpperExp implementations to NonZero
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
- [new] RFC: Labeled match
- [new] RFC: Never patterns
- [new] [RFC] Allow packed types to transitively contain aligned types
- [new] [RFC] Target Modifiers
Upcoming Events
Rusty Events between 2024-10-30 - 2024-11-27 🦀
Virtual
- 2024-10-31 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-10-31 | Virtual (Nürnberg, DE) | Rust Nurnberg DE
- 2024-11-01 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-02 | Virtual( Kampala, UG) | Rust Circle Kampala
- 2024-11-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-11-07 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-11-08 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-11-14 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-14 | Virtual and In-Person (Lehi, UT, US) | Utah Rust
- 2024-11-14 | Virtual and In-Person (Seattle, WA, US) | Seattle Rust User Group
- 2024-11-15 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-11-19 | Virtual (Los Angeles, CA, US) | DevTalk LA
- 2024-11-19 | Virtual (Washington, DC, US) | Rust DC
- 2024-11-20 | Virtual and In-Person (Vancouver, BC, CA) | Vancouver Rust
- 2024-11-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-11-21 | Virtual (Rotterdam, NL) | Bevy Game Development
- 2024-11-26 | Virtual (Dallas, TX, US) | Dallas Rust
Europe
- 2024-10-30 | Hamburg, DE | Rust Meetup Hamburg
- 2024-10-31 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-10-31 | Copenhagen, DK | Copenhagen Rust Community
- 2024-11-05 | Copenhagen, DK | Copenhagen Rust Community
- 2024-11-06 | Oxford, UK | Oxford Rust Meetup Group
- 2024-11-06 | Paris, FR | Paris Rustaceans
- 2024-11-12 | Zurich, CH | Rust Zurich
- 2024-11-13 | Reading, UK | Reading Rust Workshop
- 2024-11-14 | Stockholm, SE | Stockholm Rust
- 2024-11-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-11-21 | Edinburgh, UK | Rust and Friends
- 2024-11-21 | Oslo, NO | Rust Oslo
- 2024-11-23 | Basel, CH | Rust Basel
North America
- 2024-10-30 | Chicago, IL, US | Deep Dish Rust
- 2024-10-31 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-11-04 | Brookline, MA, US | Boston Rust Meetup
- 2024-11-07 | Montréal, QC, CA | Rust Montréal
- 2024-11-07 | St. Louis, MO, US | STL Rust
- 2024-11-12 | Ann Arbor, MI, US | Detroit Rust
- 2024-11-14 | Mountain View, CA, US | Hacker Dojo
- 2024-11-15 | Mexico City, DF, MX | Rust MX
- 2024-11-15 | Somerville, MA, US | Boston Rust Meetup
- 2024-11-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-11-23 | Boston, MA, US | Boston Rust Meetup
- 2024-11-25 | Ferndale, MI, US | Detroit Rust
- 2024-11-27 | Austin, TX, US | Rust ATX
Oceania
- 2024-10-31 | Auckland, NZ | Rust AKL
- 2024-11-12 | Christchurch, NZ | Christchurch Rust Meetup 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
An earnest effort to pursue [P1179R1] as a Lifetime TS[P3465R0] will compromise on C++’s outdated and unworkable core principles and adopt mechanisms more like Rust’s. In the compiler business this is called carcinization: a tendency of non-crab organisms to evolve crab-like features. – Sean Baxter on circle-lang.org
Thanks to Collin Richards 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