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 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.
Updates from Rust Community
Official
- 2022 Annual Rust Survey Results
- Security advisory for Cargo (CVE-2023-38497)
- Announcing Rust 1.71.1
- Rotating Rust compiler team leadership
Foundation
Newsletters
Project/Tooling Updates
Observations/Thoughts
- No telemetry in the Rust compiler: metrics without betraying user privacy
- A failed experiment with Rust static dispatch
- nesting allocators
- Allocator trait 1: Let’s talk about the Allocator trait
- How to improve Rust compiler’s CI in 2023
- Rust Pointer Metadata
- Parse Prometheus Exposition format in Rust using Pest
- Client-Side Server with Rust: A New Approach to UI Development
- [video] Andreas Monitzer - Bevy-ECS explained - Rust Vienna June 2023
Rust Walkthroughs
- Handling Rust enum variants with kinded crate
- Let's Build a Cargo Compatible Build Tool - Part 1
- Instrumenting Axum projects
- Rust Server Components
- Optimizing Rust Enum
Debug
-ing with Perfect Hashing - Running a Bevy game in SvelteKit
- ESP32 Standard Library Embedded Rust: Timers
Miscellaneous
- Shuttle Launchpad #5: Our first foray into traits!
- [video] Rust API design: the curious case of Result
- [video] A Tour of Iced 0.10
- [video] 5 programs you can't compile with Rust
- [video] Rich Terminal Interfaces with Ratatui
- [video] Build a Cross Platform Mobile SDK in Rust
Crate of the Week
This week's crate is deep_causality, a hyper-geometric computational causality library.
Thanks to Marvin Hansen for the self-suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
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.
- zerocopy - Install OpenSSF Scorecard and consider adopting its recommendations
- Ockam - Add icons to the menu items in Tauri system tray app 1
- Ockam - Improve docs of
ockam completion
clap command to specify how to use it - Ockam - Remove unused
Error
enum members and avoid appearing of such members in the future 1 - Hyperswitch - Add Create Merchant and Create Merchant Key Store in a DB transaction
- Hyperswitch - Use proxy exclusion instead of a separate proxied client
- Hyperswitch - Schedule webhook for retry
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
417 pull requests were merged in the last week
- WASI threads, implementation of wasm32-wasi-preview1-threads target
- set
max_atomic_width
for AVR to 16 - set
max_atomic_width
for sparc-unknown-linux-gnu to 32 - re-enable atomic loads and stores for all RISC-V targets
- account for
Rc
andArc
when suggesting to clone - account for macros when suggesting a new
let
binding - avoid invalid NaN lint machine-applicable suggestion in const context
- avoid wrong code suggesting for attribute macro
- change default panic handler message format
- parser: more friendly hints for handling
async move
in the 2015 edition - coverage: consolidate FFI types into one module
- coverage: replace
ExpressionOperandId
withenum Operand
- detect trait upcasting through
struct
tail unsizing in new solver select - don't ICE on higher ranked hidden types
- fix ICE failed to get layout for ReferencesError
- fix invalid slice coercion suggestion reported in turbofish
- fix suggestion spans for expr from macro expansions
- fix the span in the suggestion of remove question mark
- fix wrong span for trait selection failure error reporting
- expand, rename and improve
incorrect_fn_null_checks
lint - improve
invalid_reference_casting
lint - improve diagnostic for wrong borrow on binary operations
- improve spans for indexing expressions
- infer type in irrefutable slice patterns with fixed length as array
- interpret: fix alignment handling for Repeat expressions
- make
Debug
representations of[Lazy, Once]*[Cell, Lock]
consistent withMutex
andRwLock
- make
unconditional_recursion
warning detect recursive drops - make lint missing-copy-implementations honor negative
Copy
impls - make test harness lint about unnnameable tests
- only consider places with the same local in
each_borrow_involving_path
- only unpack tupled args in inliner if we expect args to be unpacked
- const validation: point at where we found a pointer but expected an integer
- optimize
Iterator
implementation for&mut impl Iterator + Sized
- perform OpaqueCast field projection on HIR, too
- remove
constness
fromTraitPredicate
- resolve before canonicalization in new solver, ICE if unresolved
- resolve visibility paths as modules not as types
- reword
confusable_idents
lint - rework upcasting confirmation to support upcasting to fewer projections in target bounds
- specify macro is invalid in certain contexts
- steal MIR for CTFE when possible
- strip unexpected debuginfo from
libLLVM.so
andlibrustc_driver.so
when not requesting any debuginfo - suggests turbofish in patterns
- add allocation to SMIR
- add missing rvalues to SMIR
- add trait decls to SMIR
- miri-script and cargo-miri cleanups
- miri-script: simplify flag computation a bit
- miri: fix error on dangling pointer inbounds offset
- miri: add some SB and TB tests
- miri: avoid infinite recursion for auto-fmt and auto-clippy
- miri: tree borrows: consider some retags as writes for the purpose of data races
- do not run ConstProp on
mir_for_ctfe
- add a new
compare_bytes
intrinsic instead of callingmemcmp
directly - some parser and AST cleanups
- convert builtin "global" late lints to run per module
- use parking lot's rwlock even without parallel-rustc
parent_module_from_def_id
does not need to be a queryrustc_data_structures
: Simplifybase_n::push_str
rustc_span
: Hoist lookup sorted by words out of the loopcg_llvm
: stop identifying ADTs in LLVM IR- filter out short-lived LLVM diagnostics before they reach the rustc handler
- stabilize
abi_thiscall
- impl
SliceIndex<str>
for(Bound<usize>, Bound<usize>)
- implement RefUnwindSafe for Backtrace
- implement
Option::take_if
unix/kernel_copy.rs: copy_file_range_candidate
allows empty output files- regex-automata: fix incorrect offsets reported by reverse inner optimization
- regex: fix memory usage regression for RegexSet with capture groups
- cargo: bail out an error when using cargo: in custom build script
- cargo: display crate version on timings graph
- cargo: don't attempt to read a token from stdin if a cmdline token is provided
- cargo: fix CVE-2023-38497 for master
- cargo: fix printing multiple warning messages for unused fields in registries table
- cargo: refactor: migrate to
tracing
- rustfmt: fix: add parenthesis around
..
closure if it's a method call receiver - clippy:
ptr_as_ptr
: Take snippet instead of pretty printing type - clippy:
redundant_type_annotations
: only pass certain def kinds totype_of
- clippy:
unnecessary_mut_passed
: don't lint in macro expansions - clippy:
unwrap_used
: Do not lint unwrapping on!
or never-like enums - clippy: alphabetically order arms in
methods/mod.rs
match - clippy: fix
suspicious_xor_used_as_pow.rs
performance - clippy: new lint
ignored_unit_patterns
- clippy: new lints:
impossible_comparisons
andredundant_comparisons
- clippy: suppress
question_mark
warning ifquestion_mark_used
is not allowed - rust-analyzer: allow match to matches assist to trigger on non-literal bool arms
- rust-analyzer: skip
doc(hidden)
default members - rust-analyzer: don't provide
generate_default_from_new
when impl self ty is missing - rust-analyzer: exclude non-identifier aliases from completion filtering text
- rust-analyzer: added remove unused imports assist
- rust-analyzer: fix unsized
struct
problems in mir eval - rust-analyzer: don't provide
add_missing_match_arms
assist when upmapping match arm list failed - rust-analyzer: remove unwraps from "Generate delegate trait"
- rust-analyzer: strip unused token ids from eager macro input token maps
- rust-analyzer: name change Import to Use in hir-def, add unused placeholder variants for UseId
- rust-analyzer: set the default status bar action to openLogs
- rust-analyzer: use the warning color when rust-analyzer is stopped
Rust Compiler Performance Triage
Overall a very positive last week, primarily due to an upgrade to LLVM 17 and some changes to lint execution. Memory usage is down 4-7% over the last week and wall times are down 3-5%.
Triage done by @simulacrum. Revision range: 828bdc2c..443c3161
2 Regressions, 7 Improvements, 2 Mixed; 2 of them in rollups 64 artifact comparisons made in total
Full report 7/22-8/1, Full report 8/1-8/8.
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
- [disposition: merge] Specialize count for range iterators
- [disposition: merge] Accept additional user-defined classes in fenced code blocks
- [disposition: merge] Warn on inductive cycle in coherence leading to impls being considered not overlapping
- [disposition: close] Named format arguments can be used as positional
- [disposition: merge] Tracking Issue for
const_collections_with_hasher
- [disposition: merge] Document soundness of Integer -> Pointer -> Integer conversions in
const
contexts. - [disposition: merge] Allow explicit
#[repr(Rust)]
- [disposition: merge] Tracking issue for thread local Cell methods
- [disposition: merge] Implement From\<OwnedFd/Handle> for ChildStdin/out/err object
New and Updated RFCs
Call 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:
- No RFCs issued a call for testing 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.
Upcoming Events
Rusty Events between 2023-08-09 - 2023-09-06 🦀
Virtual
- 2023-08-09 | Virtual (New York, NY, US) | Rust NYC
- 2023-08-10 | Virtual (Berlin, DE) | Berlin.rs
- 2023-08-10 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-08-10 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-08-15 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-08-15 | Virtual (Washington, DC, US) | Rust DC
- 2023-08-16 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-08-17 | Virtual (Linz, AT) | Rust Linz
- 2023-08-17 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-08-22 | Virtual (Dublin, IE) | Rust Dublin
- 2023-09-05 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-09-05 | Virtual (Munich, DE) | Rust Munich
- 2023-09-06 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-08-09 | Kuala Lumpur, MY | Rust Malaysia
- 2023-08-10 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2023-08-17 | Reading, UK | Reading Rust Workshop
- 2023-08-19 | Augsburg, DE | Rust Rhein-Main
- 2023-08-22 | Helsinki, FI | Finland Rust Meetup
- 2023-08-23 | London, UK | Rust London User Group
- 2023-08-24 | Aarhus, DK | Rust Aarhus
- 2023-08-31 | Augsburg, DE | Rust Meetup Augsburg
- 2023-09-05 | Munich, DE + Virtual | Rust Munich
North America
- 2023-08-10 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-08-10 | Lehi, UT, US | Utah Rust
- 2023-08-15 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-08-15 | Seattle, WA, US | Seattle Rust User Group Meetup
- 2023-08-16 | Cambridge, MA, US | Boston Rust Meetup
- 2023-08-16 | Copenhagen, DK | Copenhagen Rust Community
- 2023-08-17 | Nashville, TN, US | Seattle Rust User Group Meetup
- 2023-08-23 | Austin, TX, US | Rust ATX
- 2023-08-24 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-09-06 | Bellevue, WA, US | The Linux Foundation
Oceania
- 2023-08-09 | Perth, WA, AU | Rust Perth
- 2023-08-15 | Melbourne, VIC, 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
Claiming Rust won't help you because you're doing so many unsafe things is like claiming protective gear won't help you because you're handling so many dangerous substances.
llogiq feels very smug about his self-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