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. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Official
Newsletters
Observations/Thoughts
- A guide to test parametrization in Rust
- Iterator, Generator
- Breaking semver in Rust by adding a private type, or by adding an import
- Ask not what the compiler can do for you
Rust Walkthroughs
- How We Built Our Own Time-Tracking Algorithm for a Rust app
- ESP32 Embedded Rust at the HAL: UART Serial Communication
- Build a non-binary tree that is thread safe using Rust
- Coherence in Rust (feat. rustc sources)
- [video] Beginner's guide to Rust's Result, "?" and Try/FromResidual
- [video] Crust of Rust: std::collections
- [ES] [video] Introducción a Rust en Español, Parte 2: Todo sobre variables, let, mut, scopes, tipos y más.
Miscellaneous
- How Rust-based search engine Meilisearch uses dynamic virtual address management to scale indexes
- The Way of the Crab Podcast, Epside 1: Hello, World!
- Hangman over QUIC (using Rust and Quinn)
Crate of the Week
This week's crate is dlhn, a serde-compatible serialization format geared for performance.
Thanks to Shogo Otake 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.
- velo - Implement simple bevy-markdown renderer
- ockam -
#[ockam::node]
macro doesn't handle returned errors -
ockam - Make clap command asynchronously wait for the changes to take place
- Hyperswitch - Implement
ReverseLookupInterface
forMockDb
- Hyperswitch - Implement
EventInterface
forMockDb
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Calls for Proposals
Open calls for submissions to conferences and meetups.
Updates from the Rust Project
386 pull requests were merged in the last week
- implement
c"foo"
literals (RFC #3348) - output LLVM optimization remark kind in
-Cremark
output - STD support for PSVita
- add
force
option for--extern
flag rustc_middle
: Fixopt_item_ident
for non-local def ids- add FreeBSD cpuset support to
std::thread::available_concurrency
- add deployment-target --print flag for Apple targets
- add hint for
=<
as<=
- avoid alignment mismatch between ABI and layout for unions
- check arguments length in trivial diagnostic lint
- check array type of repeat exprs is wf
- constProp into
PlaceElem::Index
- constify slice flatten method
- correctly recurse when expanding anon consts
- debuginfo: split method declaration and definition
- disable nrvo mir opt
- do not recurse into const generic args when resolving self lifetime elision
- don't bail out early when checking invalid
repr
attr - don't compute trait super bounds unless they're positive
- don't validate constants in const propagation
- emit
while_true
lint spanning the entire loop condition - enable
rust_2018_idioms
lint group for doctests - encode def span for foreign return-position
impl Trait
in trait - ensure test library issues json string line-by-line
- expand the LLVM coverage of
--print target-cpus
- explicitly reject negative and reservation drop impls
- fix elaboration with associated type bounds
- fix lifetime suggestion for type aliases with objects in them
- fix miscompilation when calling default methods on
Future
- fix some suggestions where a
Box<T>
is expected - fix spans in LLVM-generated inline asm errors
- forbid escaping bound vars in combine
- further normalize msvc-non-utf8-ouput
- implement
tuple<->array
convertions viaFrom
- implement negative bounds for internal testing purposes
- interpret: fail more gracefully on uninit unsized locals
- introduce
AliasKind::Inherent
for inherent associated types - leave promoteds untainted by errors when borrowck fails
- make PlaceMention a non-mutating use
- make
(try_)subst_and_normalize_erasing_regions
takeEarlyBinder
- make
generics_of has_self
on RPITITs delegate to the opaque - make some simple queries no longer cache on disk
- optimize builder sizes
- prevent aborting guard from aborting the process in a forced unwind
- reduce MIR dump file count for MIR-opt tests
- refactor
core::char::EscapeDefault
and co. structures - reject borrows of projections in ConstProp
- replace
tcx.mk_trait_ref
withTraitRef::new
- suggest
struct
when we get colon in fileds inenum
- support return-type bounds on associated methods from supertraits
- uplift
clippy::clone_double_ref
assuspicious_double_ref_op
- use fulfillment to check
Drop
impl compatibility - miri: avoid interpreting code that has lint errors
- miri: clearer variable names in
data_race
- miri: simplify event selection in TB diagnostics
- box AssertKind
- stabilize
debugger_visualizer
- stabilize raw-dylib,
link_ordinal, import_name_type
and -Cdlltool - partial stabilisation of
c_unwind
- inline SocketAddr methods
- add 64-bit
time_t
support on 32-bit glibc Linux toset_times
- make sure the implementation of
TcpStream::as_raw_fd
is fully inlined - add
ascii::Char
assume
the runtime range ofalign_offset
btree_map: Cursor{,Mut}::peek_prev
must agree- add
is_positive
method for signed non-zero integers - constify
[u8]::is_ascii
(unstably) - fix
checked_{add,sub}_duration
incorrectly returningNone
whenother
has more thani64::MAX
seconds - correctly convert an NT path to a Win32 path in
read_link
- libtest: include test output in junit xml reports
- hashbrown: mark
RawTable::data_start
NonNull - hashbrown: special case
clear()
on empty tables - cargo: metadata: add
workspace_default_members
- cargo: do not try an exponential number of package names
- cargo: remove repeated definite articles
- cargo: support for shallow clones and fetches with
gitoxide
- rustdoc-search: add slices and arrays to index
- rustdoc: restructure type search engine to pick-and-use IDs
- clippy:
imprecise_flops
: Globally ignore#[no_std]
crates - clippy:
wildcard_imports
ignoretest.rs
files - clippy: add lint to detect construction of unit
struct
usingdefault
- clippy: ignore
borrow_deref_ref
warnings in code from procedural macros - clippy: ignore expressions from macros in
default_constructed_unit_structs
- clippy: initial
clippy::ref_patterns
implementation - rust-analyzer: add config for disabling hover memory layout data
- rust-analyzer: closure capture inlay hints
- rust-analyzer: creating rust dependencies tree explorer
- rust-analyzer: define problem matcher for panics in VS Code
- rust-analyzer: emit function bodies in expanding builtin derives
- rust-analyzer: fix pattern type mismatches for bindings, enable pattern type mismatch diagnostics again
- rust-analyzer: highlight closure captures when cursor is on pipe or move keyword
- rust-analyzer: fix body lowering not using block def maps
- rust-analyzer: fix some mir related bugs
- rust-analyzer: generate delegate methods filters out functions that already exist on the struct's impls
- rust-analyzer: ide: do not highlight escapes in raw strings
- rust-analyzer: ide: exclude sized in go-to actions in hover
- rust-analyzer: ignore impls with
#[rustc_reservation_impl]
- rust-analyzer: lazy evaluate consts in
path_to_const
- rust-analyzer: only pass unstable flags to cargo metadata from extra args config
- rust-analyzer: parse bare dyn types with leading lifetime
- rust-analyzer: show type alias layout
- rust-analyzer: sort rust dependencies in vscode tree view
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation 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] Remove misleading target feature aliases
- [disposition: merge] expand: Change how
#![cfg(FALSE)]
behaves on crate root - [disposition: merge] do not allow inference in
predicate_must_hold
(alternative approach) - [disposition: merge] Tracking Issue for slice::split_at in const context
- [disposition: merge] Implement
AsHandle
/AsSocket
forArc
/Rc
/Box
on Windows
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-05-10 - 2023-06-07 🦀
Virtual
- 2023-05-10 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-05-11 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-05-11 | Virtual (South Pasadena, CA, US) | Pasadena Thursday Go / Rust
- 2023-05-13 | Virtual | Rust GameDev
- 2023-05-13 | Virtual + In person (Singapore, SG) | Web3Dev.Community
- 2023-05-16 | Virtual (Washington, DC, US) | Rust DC
- 2023-05-17 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-05-17 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-05-18 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-05-20 | Virtual + In person (Singapore, SG) | Web3Dev.Community
- 2023-05-23 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-05-25 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-05-25 | Virtual (Ciudad de México, MX) | Rust MX
- 2023-05-25 | Virtual (Karlsruhe, DE) | The Karlsruhe Functional Programmers Meetup Group
- 2023-05-25 | Virtual (San Francisco, CA, US) | Data + AI Online Meetup
- 2023-05-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-05-31 | Virtual (Chicago, IL, US) | Chicago Healthcare Cloud Technology Community
- 2023-06-06 | Virtual (Austin, TX, US) | WebAssembly and WasmEdge
- 2023-06-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-06-07 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-05-13 | Singapore, SG | Web3Dev.Community
- 2023-05-18 | Seoul, KR | Seoul Substrate Blockchain Meetup
- 2023-05-20 | Singapore, SG | Web3Dev.Community
- 2023-05-25 | Amsterdam, NL | Frontend Developer Meetup Amsterdam
Europe
- 2023-05-10 | Amsterdam, NL | RustNL
- 2023-05-19 | Stuttgart, DE | Rust Community Stuttgart
- 2023-05-23 | Paris, FR | Kaïbee
- 2023-05-24 | Lyon, FR | Rust Lyon
- 2023-05-25 | Barcelona, ES | C++ Programmer Meetup.
- 2023-05-25 | Copenhagen, DK | Copenhagen Rust Community
- 2023-05-25 | Paris, FR | Rust Paris
- 2023-05-30 | Barcelona, ES | BcnRust
North America
- 2023-05-11 | Lehi, UT, US | Utah Rust
- 2023-05-16 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-05-17 | New York, NY, US | Rust NYC
Oceania
- 2023-05-30 | Canberra, ACT, AU | Canberra Rust User Group
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
Thanks to all for the very helpful responses. "The Book" says The community is very welcoming and happy to answer students’ questions "; I expected that to be just marketing, but I was wrong."
Thanks to evann 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