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
- rust-analyzer changelog #192
- iced Release 0.10.0
- Progress report on rustc_codegen_cranelift (July 2023)
- Garde 0.12 release
- tzf-rs: Get timezone via longitude&latitude in Rust in a fast way
- Meilisearch 1.3 - new features, including vector search, ranking score details, search for facet values, and searchable fields at query time
- This Week in Ars Militaris #4
Observations/Thoughts
- Moving Ownership and Functions! - Rust for the ABSOLUTE Beginner Tutorial
- High-throughput stream processing in Rust
- A Lock-Free Vector
- A JVM in Rust part 3 - Parsing class files
- Optimizing Rust programs with PGO and BOLT using cargo-pgo
- Distributing Lamport’s bakery with Automerge, and a touch of TLA+
- Building a Rust workspace with Bazel
- Building Multiple Binaries in Rust
- ESP32 Standard Library Embedded Rust: I2C Communication
- How to write Rust unit tests for your Compute@Edge application
- A random assortment of Rust notes
- Rusk - The transition of our Node software from Golang to Rust
- [video] What to Expect from RustConf 2023
Rust Walkthroughs
- How I finally understood async/await in Rust (part 3: why shouldn’t I hold a mutex guard across an await point?)
- Distributed Tracing in Rust, Episode 1: logging basics
- Ockam Routing: Building End-to-End Channels
Miscellaneous
- Sniffnet is one year old today: lessons learned and next steps
- [video] Physics in Bevy: What is Bevy Rapier
- [video] A Simpler Way to See Results
- [video] Decrusting the axum crate
Crate of the Week
This week's crate is allocator-api2, a forward-compatibility shim to use the nightly allocator API on stable Rust.
Thanks to Zicklag for the 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
upsert
endpoint tocards_info
table - Hyperswitch - move redis key creation to a common module
- Hyperswitch - Add support for more incoming webhooks for stripe
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
404 pull requests were merged in the last week
- add
x86_64-unikraft-linux-musl
target - CFI: fix ICE:
encode_const
: unexpected type usize - data_structures: Simplify
binary_search_slice
builtin_macros
: expect raw strings toocodegen_ssa
cleanupsdesugar_doc_comments
cleanups- resolve: report unresolved imports firstly
- resolve: skip panic when resolution is dummy
- abi: unsized field in union - assert to delay bug
- add Param and Bound ty to SMIR
- add
simd_bswap, simd_bitreverse, simd_ctlz,
andsimd_cttz
intrinsics - adjust spans correctly for fn → method suggestion
- change LLVM BOLT flags for nice space savings
- check for
<&NotClone as Clone>::clone()
calls and suggest to add Clone trait appropriately - check lazy type aliases for well-formedness
- define
CMAKE_SYSTEM_NAME
on a cross build targeting DragonFly - diagnostic namespace
- discard default auto trait impls if explicit ones exist
- don't attempt to compute layout of type referencing error
- don't install default projection bound for return-position
impl Trait
in trait methods with no body - don't say that a type is uncallable if its fn signature has errors in it
- don't treat negative trait predicates as always knowable
- dont pass
-Zwrite-long-types-to-disk=no
forui-fulldeps --stage=1
- double check that hidden types match the expected hidden type
- effects: don't print
host
param in diagnostics - fix
simd_bswap
for i8/u8 - fix intra-doc links on nested
use
andextern crate
items - fix invalid suggestion for mismatched types in closure arguments
- fix missing attribute merge on glob foreign re-exports
- gracefully handle ternary operator
- hide
ToString
implementations that specialize the default one - implement diagnostic translation for rustc-errors
- implement generic const items
- improve test case for experimental API
remove_matches
- insert RPITITs that were shadowed by missing ADTs that resolve to type error
- interpret: make read/write methods generic
- interpret: unify projections for MPlaceTy, PlaceTy, OpTy
- less
TokenTree
cloning - lint/ctypes: fix
()
return type checks - make RPITITs inherit the
assumed_wf_types
of their parent method - make
--error-format human-annotate-rs
handle multiple files - make
--print
with path unstable - make
noop_method_call
warn by default - make std tests pass on newer Android
- map RPITIT's opaque type bounds back from projections to opaques
- mark
lazy_type_alias
as incomplete - new unstable option: -Zwrite-long-types-to-disk
- normalize the RHS of an
Unsize
goal in the new solver - only golden arches
- optimize
TokenKind::clone
- print omitted frames count for short backtrace mode
- privacy: no nominal visibility for assoc fns
- reimplement C-str literals
- remove
constness
fromParamEnv
- replace atty crate with std's IsTerminal
- restore region uniquification in the new solver 🎉
- skip reporting item name when checking RPITIT GAT's associated type bounds hold
- split some functions with many arguments into builder pattern functions
- suggest {
Option
,Result
}::as_ref()
instead ofcloned()
in some cases - turns out opaque types can have hidden types registered during mir validation
- weaken
unnameable_types
lint - when flushing delayed span bugs, write to the ICE dump file even if it doesn't exist
- miri: TB: redefine trigger condition for protectors
- miri: add some interesting tests for alignment corner cases
- miri: fix oversight from new miri-script
- miri: refactor tests/utils a bit, and move some FS functions there
- miri: rewrite miri script in rust
- stabilize
const-weak-new
- const-stablilize
NonNull::as_ref
- optimize
AtomicBool
for target that don't support byte-sized atomics - mark
map_or
as#[must_use]
- merge functionality of
io::Sink
intoio::Empty
- futures: add
len
method forUnboundedSender
- cargo: normalize relative git submodule urls with
ssh://
- cargo: use thiserror for credential provider errors
- rustdoc: fix cross-crate
impl Sized
&impl ?Sized
- rustdoc: If re-export is private, get the next item until a public one is found or expose the private item directly
- rustdoc: Remove unneeded
clone()
calls forderive_id
- rustfmt: handle
dyn*
syntax when rewritingast::TyKind::TraitObject
- clippy:
arc_with_non_send_sync
: no longer lints macro-generated code - clippy:
arithmetic_side_effects
: ignore paths referring to literals - clippy:
needless_pass_by_ref_mut
: do not lint if passed as a fn-like argument - clippy: various
redundant_closure
fixes - clippy:
slow_vector_initialization
: catchVec::new()
followed by.resize(len, 0)
- clippy:
unnecessary_find_map
: look forthen_some
- clippy:
needless_pass_by_ref_mut
: emit note if function is behind a#[cfg]
- clippy: new lint
filter_map_bool_then
- clippy: new lint
readonly_write_lock
- clippy: now
option_env_unwrap
warns even if a variable isn't set at compiletime - rust-analyzer: add manual implementation of clone for tuples in mir interpreter
- rust-analyzer: fix: do not create fn macro calls with non-fn expanders
- rust-analyzer: fix: expand eager macros to delimited comma separated expression list
- rust-analyzer: fix: fix bad unwrap in
eager_macro_recur
- rust-analyzer: fix: remove another faulty unwrap (expect)
- rust-analyzer: fixup path fragments upon MBE transcription
- rust-analyzer: properly infer types with type casts
- rust-analyzer: runnable env per platform
- rust-analyzer: show anonymous fn def type as a fn pointer in source code
- rust-analyzer: support
Self
without field in mir lowering - rust-analyzer: write proc-macro server spawn errors to the status text
Rust Compiler Performance Triage
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] Allow redirecting subprocess stdout to our stderr etc.
- [disposition: merge] check for non-defining uses of RPIT
- [disposition: merge] Make
unconditional_recursion
warning detect recursive drops - [disposition: merge] Tracking Issue for
int_roundings
- [disposition: merge] Mention style for new syntax in tracking issue template
- [disposition: merge] add notes about non-compliant FP behavior on 32bit x86 targets
New and Updated RFCs
- [new] UnsafeAliased: allow aliasing of mutable references
- [new] Move out of deref for
ManuallyDrop
- [new] Crate quarantine
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-02 - 2023-08-30 🦀
Virtual
- 2023-08-02 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-08-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 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
Asia
- 2023-08-09 | Kuala Lumpur, MY | Rust Malaysia
Europe
- 2023-08-17 | Reading, UK | Reading Rust Workshop
- 2023-08-22 | Helsinki, FI | Finland Rust Meetup
- 2023-08-24 | Aarhus, DK | Rust Aarhus
North America
- 2023-08-07 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 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-17 | Nashville, TN, US | Seattle Rust User Group Meetup
- 2023-08-23 | Austin, TX, US | Rust ATX
Oceania
- 2023-08-08 | Aukland, NZ | Rust AKL
- 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
Writing return \<something>; at the end of a function in Rust is a bit like answering the question "Do you like potatoes?" with "Yes, I like potatoes" instead of simple "Yes".
– Artem Borisovskiy on rust-users
Thanks to Todd Fleming 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