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
Newsletters
Project/Tooling Updates
Observations/Thoughts
- Rust Macros: A Cautionary Tale
- Running teloxide bots cheaply on Fly.io
- Speeding up Ruby by rewriting C… in Ruby
- Memory-safe PNG decoders now vastly outperform C PNG libraries
- State of the Crates 2025
- Comparing Rust Database Crates
Rust Walkthroughs
- Parsing MIDI messages in Rust
- Drag & Drop Images into Bevy 0.15 on the web
- Missing iterable traits and how to introduce them effortlessly
- EuroRust: Introduction to Diesel: basic and advanced concepts in practice
Miscellaneous
- My Rust Story
- November 2024 Rust Jobs Report
- [video] How to Integrate C++ and Rust
- [video] 2024 LLVM Developers' Meeting - Rust ❤️ LLVM
Crate of the Week
This week's crate is include-utils, a more powerful replacement for the standard library's include_str
macro.
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.
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; 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.
No Calls for papers or presentations were submitted this week.x
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
462 pull requests were merged in the last week
dataflow_const_prop
: do not eval a ptr address in SwitchIntfn_sig_for_fn_abi
should return aty::FnSig
, no need for a binderrust_for_linux
: -Zreg-struct-return commandline flag for X86- actually walk into lifetimes and attrs in
EarlyContextAndPass
- add
allocate_bytes
and refactorallocate_str
in InterpCx for raw byte… - add context to "const in pattern" errors
- add lint against function pointer comparisons
- add more info on type/trait mismatches for different crate versions
- avoid
opaque type not constrained
errors in the presence of other errors - avoid fetching the anon const hir node that is already available
- deeply normalize when computing implied outlives bounds
- do not implement unsafe auto traits for types with unsafe fields
- don't suggest restricting bound with unstable traits on stable and mention it's unstable on nightly
- don't use a SyntheticProvider for literally every type
- fix MutVisitor's default implementations to visit Stmt's and BinOp's spans
- fix suggestion when shorthand
self
has erroneous type - gate async fn trait bound modifier on
async_trait_bounds
- handle
--json-output
properly - hide errors whose suggestions would contain error constants or types
- implement checks for tail calls
- improve
TagEncoding::Niche
docs, sanity check, and UB checks - include LLDB and GDB visualizers in MSVC distribution
- introduce
default_field_values
feature - lint against
Symbol::intern
on a string literal - lint: change help for pointers to dyn types in FFI
- make CoercePointee errors translatable
- make sure to record deps from cached task in new solver on first run
- move most tests for
-l
and#[link(..)]
intotests/ui/link-native-libs
- no need to create placeholders for GAT args in
confirm_object_candidate
- only allow
PassMode::Direct
for aggregates on wasm when using the C ABI - parse guard patterns
- reduce false positives on some common cases from if-let-rescope lint
- reimplement
~const
trait specialization - structurally resolve in
adjust_for_branches
- structurally resolve in
probe_adt
- unify
sysroot_target_{bin,lib}dir
handling - use correct
hir_id
for array const arg infers - miri: cleanup: avoid passing byte slice to
anonsocket_read
- miri: fix SC fence logic
- miri: fix weak memory emulation to avoid generating behaviors that are forbidden under C++ 20
- miri: implement
simd_relaxed_fma
- extend Miri to correctly pass mutable pointers through FFI
- remove polymorphization
- introduce
MixedBitSet
- stabilize
const_collections_with_hasher
andbuild_hasher_default_const_new
- stabilize
const_{size,align}_of_val
- stabilize
noop_waker
- stabilize
std::io::ErrorKind::CrossesDevices
- stabilize
std::io::ErrorKind::QuotaExceeded
- add
core::arch::breakpoint
and test - implementation of
fmt::FormattingOptions
- add Extend impls for tuples of arity 1 through 12
- cargo:
docs(fingerprint)
: cargo-rustc extra flags do not affect the metadata - cargo:
feat(build-rs)
: Add the 'error' directive - cargo:
fix(add)
: Don't select yanked versions when normalizing names - cargo:
fix(build-rs)
: Correctly refer to the item in assert - cargo:
fix(build-std)
: determine root crates by target specstd:bool
- cargo:
fix(fingerprint)
: Don't throwaway the cache on RUSTFLAGS changes - cargo:
fix(fix)
: Migrate workspace dependencies - cargo:
test(build-std)
: make mock-std closer to real world - cargo: fix(build-rs)!: remove meaningless
'cargo_cfg_debug_assertions'
- cargo: refactor: use
Path::push
to construct remap-path-prefix - cargo: semVer: add section on RPIT capturing
- rustdoc: remove eq for
clean::Attributes
- rustdoc: rename
issue-\d+.rs
tests to have meaningful names (part 10) - rustdoc: rename
set_back_info
torestore_module_data
- rustdoc: always display first line of impl blocks even when collapsed
- improve code for FileName retrieval in rustdoc
- clippy:
doc_lazy_continuation
: Correctly count indent with backslashes - clippy: extend
precedence
for bitmasking and shift - clippy: new lint for
as *const _
andas *mut _
pointer casts - rust-analyzer: add Configurable Option to Exclude Trigger Characters for Typing Assists
- rust-analyzer: add implict unsafety inlay hints for extern blocks
- rust-analyzer: add typing handler for param list pipe
- rust-analyzer: complete derive helper attributes
- rust-analyzer: complete diagnostics in ty lowering groundwork and serve a first diagnostic 🎉
- rust-analyzer: extend reported unsafe operations
- rust-analyzer: support
AsyncFnX
traits - rust-analyzer: fix parsing of parenthesized type args and RTN
- rust-analyzer: better parser recovery for paths
- rust-analyzer: coerce two
FnDef
s to fn pointers even if they are the same, if they are subtypes - rust-analyzer: disable
<
typing handler again - rust-analyzer: do not report warnings from proc macros, ever
- rust-analyzer: fix a bug when synthetic AST node were searched in the AST ID map and caused panics
- rust-analyzer: fix parser getting stuck for bad asm expressions
- rust-analyzer: fix parsing of dyn T in generic arg on 2015 edition
- rust-analyzer: fix parsing of integer/keyword name refs in various places
- rust-analyzer: fix shadowing of record
enum
variant in patterns - rust-analyzer: fixed another bug with glob imports
- rust-analyzer: map new replacement nodes to their mutable equivalents in
SyntaxEditor
- rust-analyzer: non-exhaustive structs may be empty
- rust-analyzer: panic when displaying generic params with defaults
- rust-analyzer: parse lifetime bounds in lifetime param into TypeBoundList
- rust-analyzer: resolve generic parameters within use captures
- rust-analyzer: temporarily disable completion resolve support for helix and neovim
- rust-analyzer: improve heuristics for on typing semicolon insertion
- rust-analyzer: make bracket typing handler work on more things
- rust-analyzer: migrate
add_turbo_fish
toSyntaxEditor
- rust-analyzer: migrate
introduce_named_generic
Assist to UseSyntaxFactory
- rust-analyzer: migrate
sort_items
Assist to UseSyntaxFactory
- rust-analyzer: vscode: only show status bar item in relevant files
Rust Compiler Performance Triage
A pretty quiet week, with both few PRs landed and no large changes in performance.
Triage done by @simulacrum. Revision range: 490b2cc0..1b3fb316
0 Regressions, 0 Improvements, 7 Mixed; 4 of them in rollups 25 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] Add
--doctest-compilation-args
option to add compilation flags to doctest compilation
Cargo
- [disposition: merge] fix(cargo-rustc): stabilize higher precedence trailing flags
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] Drop type destructuring
- [new] #[must_use = false]
- [new] RFC: Partial Types (v3)
Upcoming Events
Rusty Events between 2024-12-11 - 2025-01-08 🦀
Virtual
- 2024-12-11 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-12-12 | Hybrid: In-Person and Virtual (Seattle, WA, US) | Seattle Rust Meetup
- 2024-12-12 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-12-12 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-12-13 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-12-17 | Virtual (San Francisco, CA, US) | Blockchain Center SF
- 2024-12-17 | Virtual (Tel Aviv-Yafo, IL) | Code Mavens 🦀 - 🐍 - 🐪
- 2024-12-17 | Virtual (Washington, DC, US) | Rust DC
- 2024-12-19 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-12-19 | Virtual (Mexico City, DF, MX) | Rust MX
- 2024-12-20 | Virtual (Jersey City, NJ, US) | Jersey City Classy and Curious Coders Club Cooperative
- 2024-12-24 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-12-26 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-02| Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2025-01-04 | Virtual (Kampala, UG) | Rust Circle Kampala
Asia
- 2024-12-14 | Bangalore/Bengaluru, IN | Rust Bangalore
Europe
- 2024-12-11 | Reading, UK | Reading Rust Workshop
- 2024-12-12 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2024-12-12 | München, DE | Rust Munich
- 2024-12-12 | Vienna, AT | Rust Vienna
- 2024-12-17 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-12-18 | Ghent, BE | Systems Programming Ghent
North America
- 2024-12-12 | Hybrid: In-Person and Virtual (Seattle, WA, US) | Seattle Rust User Group
- 2024-12-12 | Mountain View, CA, US | Hacker Dojo
- 2024-12-16 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-12-17 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-12-26 | Mountain View, CA, US | Hacker Dojo
Oceania
- 2024-12-16 | Collingwood, AU | Rust Melbourne
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
Memory-safe implementations of PNG (png, zune-png, wuffs) now dramatically outperform memory-unsafe ones (libpng, spng, stb_image) when decoding images.
Rust png crate that tops our benchmark shows 1.8x improvement over
libpng
on x86 and 1.5x improvement on ARM.
Thanks to Anton Fetisov 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