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
- Changelog #184
- MsgPacker: Enhancing performance and security
- Diesel 2.1: Generated Migrations and simplified MultiBackend support
- Quickwit 0.6: Elasticsearch compatible API, range & prefix phrase queries, histogram & percentiles aggregations, and more...!
- Meilisearch 1.2 - new features for filters and engine improvements
- [video] The status of parallel rustc - Nicholas Nethercote
Observations/Thoughts
- A Proposal for an asynchronous Rust GUI framework
- A locking war story
- Building a Vector Database to Make Use of Vector Embeddings
- Data Exfiltration through DNS with Rust
- The Rust I Wanted Had No Future
- From Stacks to Trees: A new aliasing model for Rust
- ESP32 Embedded Rust at the HAL: GPIO Interrupts
- Introducing posh: Type-Safe Graphics Programming with Functional Shaders in Rust
- Demystifying trait generics in Rust
Rust Walkthroughs
- Writing universal libraries using C++ and consuming it in Rust (WASI)
- Rust's cfg Attribute
- Looking at Rust builtin derives
- What is WASI?
- Create a simple DSL for CSS like syntax for TUIs
- [video] A Practical Introduction to Derive Macros with Attributes
Miscellaneous
- [audio] Shuttle Launchpad with Stefan Baumgartner :: Rustacean Station
- [audio] Episode 5: Putting Lipstick on a Pig
- [video] Bevy Basics Timers
- [video] We Built a Blazingly Fast Video Conferencing System in Rust & WASM
- [video] Why Static Typing Came Back • Richard Feldman • GOTO 2022
Crate of the Week
This week's crate is kanata, a keyboard remapper for Linux and Windows.
Thanks to Aleksey Kladov 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 - Remove redundant heap allocation (specifically string construction) in the application
- Hyperswitch - add domain type for client secret
- Hyperswitch - Implement cache for
MerchantKeyStore
- Ockam - Add
--yes
flag todelete
commands to prevent unintentional deletions - Ockam - Define json output for
ockam node create
- Ockam - unreported
project path not found
error
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
392 pull requests were merged in the last week
- support 128-bit atomics on all
x86_64
Apple targets - support the rustc metadata for AIX
- QNX Neutrino: exponential backoff when fork/spawn needs a retry
- Control Flow Integrity: fix with
repr(transparent): transform_ty
: unexpected Alias(Proj - Control Flow Integrity: fix async:
transform_ty
: unexpected GeneratorWitness(Bi… - add other workspaces to
linkedProjects
inrust_analyzer_settings
- allow limited access to
OsStr
bytes - check nested obligations during coercion unify in new solver
- diagnostics: exclude indirect private deps from trait impl suggest
- don't ICE in new solver when auto traits have associated types
- don't compute inlining status of mono items in advance
- don't require the output from libtest to be valid UTF-8
- don't suggest break through nested items
- don't typecheck recovered method call from suggestion
- enable
ConstGoto
andSeparateConstSwitch
passes by default - enable
ScalarReplacementOfAggregates
in optimized builds - extra context for
unreachable_pub
lint - fix bug where private item with intermediate doc hidden re-export was not inlined
- fix codegen test suite for bare-metal-like targets
- fix linkage for large binaries on mips64 platforms
- fix re-export of doc hidden item inside private item not displayed
- fix type-inference regression
- fix: dedup
static_candidates
before report - improve CGU debug printing
- linker: report linker flavors incompatible with the current target
- normalize anon consts in new solver
- only check inlining counter after recursing
- only rewrite valtree-constants to patterns and keep other constants opaque
- only suppress coercion error if type is definitely unsized
- optimize scalar and scalar pair representations loaded from ByRef in llvm
- preserve substs in opaques recorded in typeck results
- refactor and cleanup the leak check, add it to new solver
- remove unneeded
Buffer
allocations when&mut fmt::Write
can be used directly - replace const eval limit by a lint and add an exponential backoff warning
- require that const param tys implement
ConstParamTy
- rpath is not supported on AIX
- rust-lld: add rpath entry to the correct
lib
folder - show note for type ascription on a local binding interpreted as a constant pattern and not a new variable
- stop normalizing so many different prefixes
- suggest
Option::as_deref(_mut)
on type mismatch in option combinator if it passes typeck - suggest correct
self_ty
- uplift
clippy::cast_ref_to_mut
lint - uplift
clippy::invalid_utf8_in_unchecked
lint - lower
unchecked_div
/_rem
to MIR'sBinOp::Div
/Rem
- miri: Tree Borrows (TB) diagnostics: avoid printing irrelevant events
- miri: TB: improve error messages (distinguish between accesses and reborrows)
- miri: remove rustc-workspace-hack
- greatly decrease the size of
rustc_driver.so
when debuginfo is enabled - remove
ExtendElement
,ExtendWith
,extend_with
- remove
[T]::zip(_)
- make
TrustedStep
requireCopy
offset_of!
: don't require type to beSized
- check tuple elements are
Sized
inoffset_of!
- fix bug in
utf16_to_utf8
for zero length strings - hashbrown: add support for rkyv serialization and deserialization
- regex compile: make
Regex::new(r"(?-u:\B)")
fail again - cargo: add message on reusing previous temporary path on failed cargo installs
- cargo: emit error when users try to use a toolchain via the
add
orinstall
command - cargo: support "default" option for
build.jobs
- rustdoc: add interaction delays for tooltip popovers
- rustdoc: render visibility on associated types
- clippy:
allow_attributes
,allow_attributes_without_reason
: Ignore attributes from procedural macros - clippy:
manual_let_else
: supportstruct
patterns - clippy:
nonminimal_bool
fix double not - clippy:
ptr_cast_constness
: Only lint on casts which don't change type - clippy:
unnecessary_lazy_eval
: don't lint on types with deref impl - clippy:
useless_conversion
: pluralize if there are multiple.into_iter()
calls - clippy:
wildcard_imports
Modules that containprelude
are also allowed - clippy: add a test that checks for old style test headers
- clippy: add checking for
cfg(features = ...)
- clippy: add lints for disallowing usage of
to_xx_bytes
andfrom_xx_bytes
- clippy: add spans to
clippy.toml
error messages - clippy: emit
unnecessary_cast
on raw pointers as well - clippy: fix suggestion on fully qualified syntax
- clippy: ignore fix for
from_over_into
if the target type contains aSelf
reference - clippy: move
redundant_clone
tonursery
- clippy: new lint:
explicit_into_iter_fn_arg
- clippy: new lint:
missing_fields_in_debug
- rust-analyzer: add mandatory panic contexts to all threadpool tasks
- rust-analyzer: allow setting cfgs
- rust-analyzer: don't add --all-targets to runnables for no-std crates
- rust-analyzer: add signature help for tuple patterns and expressions
- rust-analyzer: render niches on hover
- rust-analyzer: fix Assist "replace named generic type with impl trait"
- rust-analyzer: fix
unused-mut
false positive forBox
- rust-analyzer: fix bug in labeled for loop desugaring
- rust-analyzer: fix drop scopes problems in mir
- rust-analyzer: fix edits for
convert_named_struct_to_tuple_struct
- rust-analyzer: fix missing terminator for slice pattern
- rust-analyzer: fix string pattern matching in mir interpreter
- rust-analyzer: fix: add enum, reference, array and slice to
render_const_scalar
- rust-analyzer: fix: add render configs for memory layout hovers
- rust-analyzer: fix: consider outer binders when folding captured items' type
- rust-analyzer: fix: detect "bound more than once" error and suppress
need-mut
for it - rust-analyzer: fix: don't duplicate sysroot crates in rustc workspace
- rust-analyzer: fix: emit
'_
for lifetime generics inHirDisplay
- rust-analyzer: fix nav target calculation discarding file ids from differing macro upmapping
- rust-analyzer: make assignment operators right associative
- rust-analyzer: prioritize threads affected by user typing
- rust-analyzer: support floating point intrinsics in const eval
Rust Compiler Performance Triage
This week was a bunch of improvements, largely driven by cutting std debuginfo in [#110221] and a few MIR or codegen optimizations. No pure regressions landed this week!
Triage done by @simulacrum. Revision range: 1221e43b..adc719d
Summary:
0 Regressions, 1 Improvements, 12 Mixed; 2 of them in rollups
79 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:
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] TAIT defining scope options
- [disposition: merge] rustdoc-search: clean up type unification and "unboxing"
- [disposition: merge] Specify behavior of HashSet::insert
- [disposition: merge] Update runtime guarantee for
select_nth_unstable
- [disposition: merge] Stabilize String::leak
- [disposition: merge] Implement
TryFrom<&OsStr>
for&str
- [disposition: merge] impl SliceIndex\<str> for (Bound\<usize>, Bound\<usize>)
- [disposition: merge] Stabilize
const_cstr_methods
- [disposition: close] Add cfg(no_128_bit) to core: removes u128/i128 formatting
- [disposition: merge] rustdoc: search for slices and arrays by type with
[]
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-06-07 - 2023-07-05 🦀
Virtual
- 2023-06-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-06-07 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-06-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-06-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-06-14 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-06-14 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-06-15 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-06-19 | Virtual (San Francisco, CA, US) | Data Science on AWS - San Francisco, Global
- 2023-06-20 | Virtual (Berlin, DE) | Berline.rs / OpenTechSchool Berlin
- 2023-06-20 | Virtual (Washington, DC, US) | Rust DC
- 2023-06-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-06-22 | Virtual (Karlsruhe, DE) | Karlsruhe Functional Programmers Group
- 2023-06-25 | Virtual (Auckland, NZ) | ResBaz Aotearoa 2023
- 2023-06-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-06-28 | Virtual (Chicago, IL, US) | Chicago Healthcare Cloud Technology Community
- 2023-07-04 | Virtual (Berlin, DE) | Berline.rs / OpenTechSchool Berlin
- 2023-07-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-07-05 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-06-10 | Kuala Lumpur, MY | GoLang Malaysia
- 2023-06-10 | Pune, IN | Rust Pune
Europe
- 2023-06-08 | Aarhus, DK | Rust Aarhus
- 2023-06-08 | Paris, FR | Stockly.ai
- 2023-06-08 | Zurich, CH | Rust Zurich
- 2023-06-16 | Stuttgart, DE | Rust Community Stuttgart
- 2023-06-22 | Vienna, AT | Papers We Love Vienna
- 2023-06-28 | Bratislava, SK | Bratislava Rust Meetup Group
- 2023-07-03 | Zurich, CH | Rust Zurich
North America
- 2023-06-07 | Austin, TX, US | Rust ATX
- 2023-06-08 | Lehi, UT, US | Utah Rust
- 2023-06-08 | Pasadena, CA, US | Pasadena Thursday Go/Rust
- 2023-06-10 | San Jose, CA, US | Rust Breakfast & Learn
- 2023-06-15 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-06-17 | San Jose, CA, US | Rust Breakfast & Learn
- 2023-06-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-06-24 | San Jose, CA, US | Rust Breakfast & Learn
- 2023-07-01 | San Jose, CA, US | Rust Breakfast & Learn
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
(...) Rust developers usually are not just looking for "less buggy".
They are addicted to the clicky sound of legos.
Thanks to Jan Riemer 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