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
Foundation
Newsletters
Project/Tooling Updates
Observations/Thoughts
- I built a garbage collector for a language that doesn’t need one
- The Case for Rust on the Web
- Learning Async Rust With Entirely Too Many Web Servers
- fn main( ) - Rust Type System: P2
- Our latest adventures with bindgen
- Autogenerating Rust-JS bindings with UniFFI
- Corrode Rust Consulting
- Why you should consider Rust for your Lambdas
- Explaining Rust’s Deref trait
Miscellaneous
- [DE] Programmiersprache Rust gewinnt im Arbeitsumfeld an Bedeutung
- [audio] Adopting Rust: present and future of the Rust web ecosystem, with Luca Palmieri
- [video] Physics in Bevy: How to get Rapier in your games
- [video] Open the Rust compiler's puzzle book - weird-exprs.rs
- [video] Causal inference in Rust - deep_causality | Crate of the Week 507
- [video] Dioxus 0.4: Server Functions
- [video] history.txt vs sqlite with Atuin
- [video] The Database of Four Dimensional Reality - SpacetimeDB
- [video] noisy material shaders in bevy
- [video] I spent six months rewriting everything in Rust
- [video] Game Dev Log 4 - Schedules (Entire Series)
- [audio] Episode 092 - Moving to Rust in the Age of AI with Noah Gift
Crate of the Week
This week's crate is agree, a command-line tool implementing Shamir's Secret Sharing.
Thanks to Alexander Weber 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.
- Hyperswitch - add domain type for client secret
- Hyperswitch - deserialization error exposes sensitive values in the logs
- Hyperswitch - move redis key creation to a common module
- Ockam - Check key/secret size before casting as a fixed-length array
- Ockam - Ockam CLI should gracefully handle invalid state when initializing
- Ockam - Use TCP Outlets' "worker address" as identifiers in the Ockam App's tray menu items
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
344 pull requests were merged in the last week
- add csky-unknown-linux-gnuabiv2 target
- add aarch64-unknown-teeos target
riscv-interrupt-{m,s}
calling conventions- set
max_atomic_width
for AVR to 16 - set
max_atomic_width
for sparc-unknown-linux-gnu to 32 - CFI: fix error compiling core with LLVM CFI enabled
- std: Replace condv while loop with
cvar.wait_while
Expr::can_have_side_effects()
is incorrect for struct/enum/array/tuple literalsrustc_data_structures
:base_n
perf: remove unnecessary utf8 checkoffset_of
: guard against invalid use (with unsized fields)- add hotness data to LLVM remarks
- add suggestion to quote inlined format argument as string literal
- allow using external builds of the compiler-rt profile lib
- allowing re-implementation of
mir_drops_elaborated
query - also consider
mem::transmute
with theinvalid_reference_casting
lint - avoid exporting
__rust_alloc_error_handler_should_panic
more than once - better error handling for
rust.codegen-backends
on deserialization - bubble up nested goals from equation in
predicates_for_object_candidate
- check for non-defining uses of RPIT
- convert Const to Allocation in smir
- core/any: remove Provider trait, rename Demand to Request
- correctly lower
impl const
to bind to host effect param - cover ParamConst in smir
- coverage: don't convert filename/symbol strings to
CString
for FFI - coverage: store BCB counter info externally, not directly in the BCB graph
- detect method not found on arbitrary self type with different mutability
- detect missing
;
that parses as function call - don't use
type_of
to determine if item has intrinsic shim - downgrade
internal_features
to warn - fixed
*const [type error] does not implement the Copy trait
- generate better function argument names in
global_allocator
expansion - interpret: remove incomplete protection against invalid where clauses
- interpret: use ConstPropNonsense for more const-prop induced issues
- issue numbers are enforced on active features; remove FIXME
- llvm-wrapper: adapt for LLVM API changes
- make Const more useful in smir
- make
unconditional_recursion
warning detect recursive drops - make the provisional cache slightly less broken
- map RPIT duplicated lifetimes back to fn captured lifetimes
- migrate a trait selection error to use diagnostic translation
- normalize in
trait_ref_is_knowable
in new solver - only check outlives goals on impl compared to trait
- only resolve target type in
try_coerce
in new solver - open pidfd in child process and send to the parent via
SOCK_SEQPACKET+CMSG
- record binder for bare trait object in LifetimeCollectVisitor
- remove constness from
ImplSource::Param
- remove redundant calls to
resolve_vars_with_obligations
- rename method in
opt-dist
- respect
#[expect]
the same way#[allow]
is with thedead_code
lint - restrict linker version script of proc-macro crates to just its two symbols
- select obligations before processing wf obligation in
compare_method_predicate_entailment
- simplify handling of valtrees for unsized types
- store the laziness of type aliases in their
DefKind
- structurally normalize weak and inherent in new solver
- style fix and refactor on resolve diagnostics
- suggest using
Arc
on!Send
/!Sync
types - TAITs do not constrain generic params
- tests: uncomment now valid GAT code behind FIXME
- unlock trailing where-clauses for lazy type aliases
- use the correct
llvm-profdata
binary inopt-dist
- warn when
#[macro_export]
is applied on decl macros - push DiscriminantKind implementation fact unconditionally
- add trait decls to SMIR
- add impl trait declarations to SMIR
- stabilize
abi_thiscall
- miri: add checked float-to-int helper function
- miri: add gamma function shims
- miri: llvm.prefetch is not a math function
- miri: replace AsAny hack by trait upcasting :)
- tell LLVM that the negation in
<*const T>::sub
cannot overflow - implement
Option::take_if
- avoid using
ptr::Unique
inLinkedList
code - rename copying
ascii::Char
methods fromas_
toto_
- better
Debug
forVars
andVarsOs
- make ExitStatus implement Default
- partially stabilize
int_roundings
- add
Iterator::map_windows
- add a new
compare_bytes
intrinsic instead of callingmemcmp
directly - add gamma function to
f32
andf64
- cargo-credential: reset stdin & stdout to the Console
- cargo: Make
--help
easier to browse - cargo: enable ansi color only in terminal
- cargo: bail out an error when using cargo: in custom build script
- cargo: fix cargo remove incorrectly removing used patches
- cargo: fix panic when enabling http.debug for certain strings
- cargo: fix: preserve jobserver file descriptors on rustc invocation to get
TargetInfo
- cargo: prompt the use of
--nocapture
flag ifcargo test
process is terminated via a signal - rustfmt: don't flatten blocks that have labels
- rustfmt: enable rustfmt to compile when using the
generic-simd
feature - rustfmt: improve formatting of empty
macro_rules!
definitions - rustfmt: improve the
--file-lines
help - rustfmt: refactor ABI formatting
- clippy:
iter_overeager_cloned
: detect.cloned().filter()
and.cloned().find()
- clippy:
filter_map_bool_then
: Don't ICE on late bound regions - clippy:
manual_retain
: add lint case forbinary_heap
- clippy:
redundant_guards
: don't lint on float literals - clippy:
redundant_locals
: fix FPs on mutated shadows - rust-analyzer: add check.ignore to list cargo check diagnostics to ignore
(dead_code, unused_imports,
...) - rust-analyzer: add mir lower support for tuple destructing assignment
- rust-analyzer: display fully qualified associated types correctly
- rust-analyzer: don't use control flow when extracted fn contains tail expr of original fn
- rust-analyzer: fix pinned version of lsp-types
- rust-analyzer: fix
only_types
config filtering out traits from world symbols - rust-analyzer: fix float parser hack creating empty NameRef tokens
- rust-analyzer: fix parser being stuck in eager macro inputs
- rust-analyzer: handle
#[cfg]
s on generic parameters - rust-analyzer: internal : Deunwrap
convert_named_struct_to_tuple_struct
- rust-analyzer: support doc links that resolve to fields
Rust Compiler Performance Triage
A light week. Main thing to report is we got some improvements from telling LLVM
that the negation in <*const T>::sub
cannot overflow.
Triage done by @pnkfelix. Revision range: 443c3161..e8459109
0 Regressions, 1 Improvements, 4 Mixed; 1 of them in rollups 49 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
Tracking Issues & PRs
- [disposition: merge] Cleaner assert_eq! & assert_ne! panic messages
- [disposition: merge] Report monomorphization time errors in dead code, too
- [disposition: merge] Allow explicit
#[repr(Rust)]
- [disposition: merge] style-guide: Add section on bugs, and resolving bugs
- [disposition: merge] Lower
Or
pattern without allocating place
New and Updated RFCs
- [new] Unified String Literals
- [new] RFC:
scheduled_removal
Parameter fordeprecated
Attribute - [new] crABI v1
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-16 - 2023-09-13 🦀
Virtual
- 2023-08-16 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-08-17 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-08-22 | Virtual (Dublin, IE) | Rust Dublin
- 2023-08-23 | Virtual (Linz, AT) | Rust Linz
- 2023-08-24 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 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
- 2023-09-07 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-09-12 - 2023-09-15 | Virtual (Albuquerque, NM, US) | RustConf
- 2023-09-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-09-13 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-09-14 | Virtual (Nuremberg, DE) | Rust Nuremberg
Asia
- 2023-09-06 | Tel Aviv, IL | Rust TLV
Europe
- 2023-08-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 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-16 | Cambridge, MA, US | Boston Rust Meetup
- 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-08-30 | Copenhagen, DK | Copenhagen Rust Community
- 2023-09-06 | Bellevue, WA, US | The Linux Foundation
- 2023-09-12 - 2023-09-15 | Albuquerque, NM, US + Virtual | RustConf
Oceania
- 2023-08-24 | Brisbane, QLD, AU | Rust Brisbane
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
It has been
0
days since someone tried and failed to use unsafe to circumvent the lifetime system.
Thanks to mdHMUpeyf8yluPfXI 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