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
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #188
- Pavex DevLog #5: redesigning our runtime types
- Bevy XPBD: A physics engine for the Bevy game engine
- complgen: Generate {bash,fish,zsh} completions from a single EBNF-like grammar
- projectable: a command line TUI file manager
Observations/Thoughts
- How To Wrap Your Errors With Enums When Using Error-Stack
- Exploring Graphs in Rust. Yikes
- Writing a Linked List in Rust: A Walkthrough
- Tree-Structured Concurrency
- Rust Notes on Temporary values (usage of Mutex) - 4
- Method Overloading (kinda), and Advanced Trait Usage
- Unlocking Possibilities: 4 Reasons Why ESP32 and Rust Make a Winning Combination
- The magic of dependency resolution
- Writing E2E Tests for Axum & GraphQL
- Detailed web-based 3D rendering of mining spatial data
- [video] Choose the Right Option
- [video] 4 levels of Rust error handling
Rust Walkthroughs
- Build a Ray Tracer, pt. 4 - The Next Dimension
- Nine Rules for Running Rust on the Web and on Embedded: Practical Lessons from Porting range-set-blaze to no_std and WASM
- Full Stack Rust Workshop: Shuttle, Actix Web, SQLx & Diouxus
- Intercepting Allocations with the Global Allocator
- A compressed indexable bitset
- A persistent task queue in Rust
- How I finally understood async/await in Rust (part 2: how does a pending future get woken?)
Miscellaneous
- Verify Rust code in VS Code with the Kani VS Code extension
- Reduce memory footprint by about 600% for M.E.D. — Performance Matters
- New MeetUp Group in Canada: Rust Halifax
Crate of the Week
This week's crate is rustypaste, a minimal file upload/pastebin service.
Thanks to orhun 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.
- diesel - Most wanted missing features in diesel 1
- diesel - Most wanted missing guide topic 1
- css-inline - C bindings
- mfcc-rust - create npy files for testing the input and output of cacheable functions
- mfcc-rust - make all functions generic over f32 and f64
- mfcc-rust - migrate mfcc to depend on mel_spectrogram
- ockam - Change argument for
ockam credential issue
command from Identity to IdentityIdentifier 2 - ockam - Use a background node for
ockam project enroll
1 - ockam -
ockam project ticket
should return a proper error message 1 - RustQuant - Logistic regression is too slow (specifically the matrix inversions).
- RustQuant - Implement a user interface (TUI or GUI).
- RustQuant - Implement a Postgres interface. 1
- RustQuant - Pricing model calibration module.
- RustQuant - Add/improve documentation (esp. math related docs).
- RustQuant - Increase test coverage (chore). 1
- RustQuant - Compute returns from Yahoo finance data reader.
- mirrord - mirrord shows
loopcrashbackoff
pods as possible targets 1 - mirrord - Log problem in layer and exit when agent image is not found 1
- Hyperswitch - Implement Code coverage for local system using Makefile
- Hyperswitch - Add scoped error enum for customer error
- Hyperswitch - move redis key creation to a common module
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
410 pull requests were merged in the last week
- support embedding LLVM bitcode on AIX
- support for native WASM exceptions
fix(resolve)
: skip assertion judgment when NonModule is dummythir
: AddBecome
expression kind- account for late-bound vars from parent arg-position impl trait
- add
-Zremark-dir
unstable flag to write LLVM optimization remarks to YAML - add bidirectional where clauses on RPITIT synthesized GATs
- add check for
ConstKind::Value(_)
toin_operand()
- avoid calling queries during query stack printing
- better messages for next on a iterator inside for loops
- detect actual span for getting unexpected token from parsing macros
- don't perform selection if inherent associated types are not enabled
- don't suggest
move
for borrows that aren't closures - encode item bounds for
DefKind::ImplTraitPlaceholder
- error when RPITITs' hidden types capture more lifetimes than their trait definitions
- export AnalysisResults trait in
rustc_mir_dataflow
- fix
dropping_copy_types
lint from linting in match-arm with side-effects - fix associated items effective visibility calculation for type privacy lints
- fix type privacy lints error message
- fix unset
e_flags
in ELF files generated for AVR targets - implement deep normalization via the new solver
- implement most of MCP510
- implement proposed API for
proc_macro_span
- implement selection via new trait solver
- lint/ctypes: ext. abi fn-ptr in internal abi fn
- make associated type bounds in supertrait position implied
- make compiletest aware of targets without dynamic linking
- make the
Elaboratable
trait take clauses - normalize opaques with late-bound vars again
- normalize types when applying uninhabited predicate
- privacy: type privacy lints fixes and cleanups
- properly implement
variances_of
for RPITIT GAT - refactor metadata emission to avoid visiting HIR
- resolve: remove artificial import ambiguity errors
- simplify computation of killed borrows
- suggest
slice::swap
formem::swap(&mut x[0], &mut x[1])
borrowck error - add suggestion for bad block fragment error
- use structured suggestion when telling user about
for<'a>
- mark wrapped intrinsics as
inline(always)
- make
simd_shuffle_indices
use valtrees - make
UnwindAction::Continue
explicit in MIR dump - mir opt + codegen: handle subtyping
- miri: cargo-miri: better error message when RUSTC is not set
- miri: make
--quiet
actually do something - miri: optional semantics for
Unique
- shrink error variants for layout and
fn_abi
- a mish-mash of micro-optimizations
- codegen_gcc: add support for
#[cold]
attribute - allow comparing
Box
es with different allocators - make
rustc_on_unimplemented
std-agnostic - stabilize
const_cstr_methods
- cargo: add READMEs for the credential helpers
- cargo: don't try to compile cargo-credential-gnome-secret on non-Linux platforms
- rustdoc: fix display of long items in search results
- rustdoc: fix display of long inline cfg labels
- rustdoc: allow whitespace as path separator like double colon
- rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls
- rustfmt: don't skip semicolon if expressions follow
- rustfmt: implement
single_line_let_else_max_width
- rustfmt: rewrite float literals ending in dots with parens in method calls
- rustfmt: switch to tracing for logging
- clippy: new lints:
manual_try_fold
,needless_raw_string_hashes
,redundant_at_rest_pattern
,tuple_array_conversions
,manual_range_patterns
,type_id_on_box
,needless_pub_self
,pub_with_shorthand
andpub_without_shorthand
- clippy:
significant_drop_tightening
: fix incorrect suggestion - clippy:
arc_with_non_send_sync
: don't lint if type has nested type parameters - clippy:
let_and_return
: lint'static
lifetimes, don't lint borrows in closures - clippy:
missing_fields_in_debug
: make sure self type is an adt - clippy:
needless_raw_string_hashes
: only reset hashes needed if not following quote - clippy:
option_if_let_else
: suggest.as_ref()
if scrutinee is of type&Option<_>
- clippy:
question_mark
: don't lint inside oftry
block - clippy:
unused_async
: don't lint if function is part of a trait - clippy:
useless_vec
: add more tests and don't lint inside of macros - clippy:
useless_vec
: use the source span for initializer - clippy: don't lint
manual_let_else
in cases where?
would work - clippy: don't lint code from external macros for 8 lints
- clippy: make
eq_op
suggest.is_nan()
- clippy: suggest
is_some_and
overmap().unwrap
- rust-analyzer: check Workspace Edit ResourceOps
- rust-analyzer: disable mir interpreter for targets with different pointer size from host
- rust-analyzer: editor/code: enable
noImplicitOverride
ts option - rust-analyzer: editor/code: use
@tsconfig/strictest
to define type checking rules - rust-analyzer: don't add panics to error jump list by default
- rust-analyzer: fix
self
andsuper
path resolution in block modules - rust-analyzer: fix data layout of reference to nested unsized structs
- rust-analyzer: fix layout of simd types and respect align in mir interpreter
- rust-analyzer: fix overflow checking in shift operator
- rust-analyzer: fix panic in
handle_code_action
- rust-analyzer: fix realloc problem in allocating smaller amounts
- rust-analyzer: fix runnable detection for
#[tokio::test]
- rust-analyzer: follow raw pointers in autoderef chain when resolving methods with custom receiver
- rust-analyzer: map our diagnostics to rustc and clippy's ones
- rust-analyzer: support
#[derive_const(Trait)]
Rust Compiler Performance Triage
A quiet week, with a mixed set of improvements and regressions. Overall slightly more improvements than regressions.
Triage done by @simulacrum. Revision range: b5e51db16..52d8c490
4 Regressions, 4 Improvements, 2 Mixed; 0 of them in rollups
51 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
- [disposition: merge] RFC: Start working on a Rust specification
Tracking Issues & PRs
- [disposition: merge] Enable coinduction support for Safe Transmute
- [disposition: close] feat: split
unsafe_code
lint into lint group - [disposition: merge] Correct the Android stat struct definitions
New and Updated RFCs
- [new] Create a Testing sub-team
- [new] Add
f16
andf128
float types - [new] RFC: Nested Cargo packages
- [new] Additional float types
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-07-05 - 2023-08-02 🦀
Virtual
- 2023-07-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-07-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-07-06 | Virtual (Ciudad de México, MX) | Rust MX
- 2023-07-11 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-07-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-07-11 - 2023-07-13 | Virtual (Europe) | Mainmatter
- 2023-07-13 - 2023-07-14 | Virtual | Scientific Computing in Rust
- 2023-07-13 | Virtual (Edinburgh, UK) | Rust Edinburgh
- 2023-07-13 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-07-18 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-07-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-07-20 | Virtual (Tehran, IR) | Iran Rust Meetup
- 2023-07-25 | Virtual (Dallas, TX, US) | Dallas Rust
Asia
- 2023-07-08 | Bangalore, IN | Rust India
Europe
- 2023-07-05 | Lyon, FR | Rust Lyon
- 2023-07-11 | Breda, NL | Rust Nederland
- 2023-07-13 | Berlin, DE | Rust Berlin
- 2023-07-13 | Reading, UK | Reading Rust Workshop
- 2023-07-21 | Nuremberg, DE | Rust Nuremberg
North America
- 2023-07-07 | Chicago, IL, US | Deep Dish Rust
- 2023-07-12 | Austin, TX, US | Rust ATX
- 2023-07-12 | Waterloo, ON, CA | Rust KW
- 2023-07-13 | Lehi, UT, US | Utah Rust
- 2023-07-13 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-07-13 | Seattle, WA, US | Seattle Rust User Group
- 2023-07-18 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-07-11 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-07-11 | 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
I'm not here to tell you that Rust is the best language....... you should have figured that out by now.
Thanks to newpavlov 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