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? Tweet us at @ThisWeekInRust 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
Foundation
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #146
- IntelliJ Rust Changelog #178
- A byte string library for Rust
- Pomsky 0.7 released
- Slint weekly updates (The GUI framework)
- Fang 0.9 - new version of the background processing framework for rust
- Fornjot (code-first CAD in Rust) - Weekly Release - 2022-W37
- This week in Databend #59: A Modern Cloud Data Warehouse for Everyone
- HexoSynth 2022 - Devlog #12 - Documentation for me and you
Observations/Thoughts
- You Can't Do That: Abstracting over Ownership in Rust with Higher-Rank Type Bounds. Or Can You?
- Security and Correctness in Wasmtime
- Attacking Firecracker: AWS' microVM Monitor Written in Rust
- &stress about &Strings
- A pair of Rust kernel modules
- GNU
ld
Discards Section Containing Code – Section Flags are Important for ELF Files - Use Rust to Reduce the Size of Your SQLite Database
- [video] Coroutines: C++ vs Rust - Jonathan Müller - C++ on Sea 2022
- [video] Rust on Rails (write code that never crashes)
- [video] Let's Code Asteroids in Rust with a First-Time Bevy User
- [video] Linux Plumbers Conference 2022 - Rust MC
- [video] [series] Rust Day on Google Open Source Live
Rust Walkthroughs
- Kernighan software tools in rust
- Speeding up incremental Rust compilation with dynamic libraries
- Learning Rust by implementing a SHA-1 hash cracker
- Chat Blast! A TCP chat server in Rust
- Concurrency in RustDb
- Beginners guide to Solana NFTs in Rust.
- STM32F4 Embedded Rust at the HAL: DMA Controllers
Miscellaneous
- [FR] Rejoignez la communauté Rust (et devenez un "rustacé")
- [DE] Moderne Spieleprogrammierung mit dem Entity Component System und der Engine Bevy
- [DE] Programmieren mit Rust für den FreeBSD-Kernel
Crate of the Week
This week's crate is bstr, a fast and featureful byte-string library.
Thanks to 8573 for the suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but didn't 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.
- Ockam - Support TCP keepalive for TCP clients
- Ockam - Show ockam command help in $PAGER or less (clap based)
- Ockam - Implement ockam reset clap command
- lib3mf - Help compiling the upstream C++ library on Windows
- Artichoke Ruby - Help migrate more path helpers out of its monolith into a support crate.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
324 pull requests were merged in the last week
- initial implementation of return-position
impl Trait
in traits - check that the types in return position
impl Trait
in traits are well-formed - deny return-position
impl Trait
in traits for object safety - only encode return-position
impl Trait
in trait when parent function has a default body - implement
std::marker::Tuple
, a marker trait for tuples - add
inline-llvm
option for disabling/enabling LLVM inlining - stabilize raw-dylib for non-x86
- equate fn outputs when inferring RPITIT hidden types
- allow generators to
impl Clone
/Copy
- avoid infinite loop in function arguments checking
const_generics
: correctly deal with bound variables- fix LLVM IR type mismatch
- fix ICE in
opt_suggest_box_span
- fix ICE report flags display
- fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments
- fix RPIT ICE for implicit HRTB when missing dyn
- fix code generation of
Rvalue::Repeat
with 128 bit values - fix compile errors for uwp-windows-msvc targets
- normalize before erasing late-bound regions in
equal_up_to_regions
- recover from using
;
as separator between fields - fix the suggestion of format for
asm_sub_register
- adjust and slightly generalize operator error suggestion
- add list of recognized repr attributes to the unrecognized repr error
- shrink span for bindings with subpatterns
- point at type parameter in plain path expr
- point out when a callable is not actually callable because its return is not sized
- allow
lower_lifetime_binder
receive a closure - do not suggest a semicolon for a macro without
!
- include enum path in variant suggestion
- suggest adding array lengths to references to arrays if possible
- suggest introducing an explicit lifetime if it does not exist
- suggest pub instead of public for const type item
- suggest removing unnecessary prefix let in patterns
- migrate another part of
rustc_infer
to session diagnostic - migrate
rustc_middle
diagnostic - migrate
rustc_session
to use SessionDiagnostic - Pt. 2 - miri: add a Machine hook for inline assembly
- shrink
PredicateS
- shrink
hir::Ty
andhir::Pat
- parameterize
ty::Visibility
over used ID - allow lint passes to be bound by
TyCtxt
- track PGO profiles in depinfo
- use
RelocModel::Pic
for UEFI targets - use niche-filling optimization even when multiple variants have data
- inline
<T as From<T>>::from
- lower the
assume
intrinsic to a MIR statement - compile
spin_loop_hint
as pause on x86 even without sse2 enabled - reimplement
carrying_add
andborrowing_sub
for signed integers - optimize thread parking on NetBSD
- remove
&[T]
fromvec_deque::Drain
- the
<*const T>::guaranteed_*
methods now return an option for the unknown case - use futex-based locks and thread parker on Hermit
- hashbrown: add
HashSet::raw_table
- hashbrown: add
RawTable::is_full
- git2: implement
IntoIterator
forStatuses
- codegen_gcc: simd: impl
extract_element
for vector types - cargo: specify the max length for crate name
- rustdoc: avoid cleaning modules with duplicate names
- rustdoc: correcty handle intra-doc-links to items without HTML page
- rustdoc: more accurate struct type
- rustdoc: store Variant Fields as their own item
- clippy: do not expand macro in
nonminimal_bool
suggestions - clippy: don't lint
large_stack_array
inside static items - clippy: don't panic on invalid shift while constfolding
- clippy: fix
FormatArgsExpn
parsing ofFormatSpec
positions - clippy: fix
range_{plus,minus}_one
bad suggestions - clippy: fix hang in
vec_init_then_push
- clippy: rename the
arithmetic
lint - clippy: suggest
unwrap_or_default
when closure returns"".to_string
- clippy: use
visit_expr_field
forParamPosition
- clippy: use macro callsite when creating
Sugg
helper - clippy: make
Arithmetic
consider literals - clippy:
assertions_on_result_states
: fix suggestion whenassert!
is not in a statement - rust-analyzer: add config to unconditionally prefer core imports over std
- rust-analyzer: build release artifact against older glibc
- rust-analyzer: filter imports on find-all-references
- rust-analyzer: new assist:
move_format_string_arg
- rust-analyzer: remove the
toggleInlayHints
command from VSCode - rust-analyzer: use
proc-macro-srv
from sysroot in rust-project.json workspaces - rust-analyzer: make clicking a closing brace inlay hint go to the opening brace
- rust-analyzer: add semicolon completion to mod
- rust-analyzer: handle lifetime variables in projection normalization
- rust-analyzer: handle trait methods as inherent methods for trait-related types
Rust Compiler Performance Triage
From the viewpoint of metrics gathering, this was an absolutely terrible week, because the vast majority of this week's report is dominated by noise. Several benchmarks (html5ever, cranelift-codegen, and keccak) have all been exhibiting bimodal behavior where their compile-times would regress and improve randomly from run to run. Looking past that, we had one small win from adding an inline directive.
Triage done by @pnkfelix. Revision range: e7cdd4c0..17cbdfd0
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.1% | [0.2%, 6.2%] | 26 |
Regressions ❌ (secondary) |
1.9% | [0.1%, 5.6%] | 34 |
Improvements ✅ (primary) |
-1.8% | [-29.4%, -0.2%] | 42 |
Improvements ✅ (secondary) |
-1.3% | [-5.3%, -0.2%] | 50 |
All ❌✅ (primary) | -0.7% | [-29.4%, 6.2%] | 68 |
11 Regressions, 11 Improvements, 13 Mixed; 11 of them in rollups 71 artifact comparisons made in total
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.
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: close] Loosen shadowing check inside macro contexts (attempt 2).
- [disposition: merge] Tracking issue for
std::hint::black_box
- [disposition: merge] Commit to safety rules for dyn trait upcasting
- [disposition: merge] Tracking Issue for constifying some
{BTreeMap,Set}
functions - [disposition: merge] Tracking Issue for
Option::unzip()
- [disposition: merge] Tracking issue for map_first_last: first/last methods on BTreeSet and BTreeMap
- [disposition: merge] Make
Sized
coinductive, again - [disposition: merge] Neither require nor imply lifetime bounds on opaque type for well formedness
- [disposition: merge] Make typeck aware of uninhabited types
- [disposition: merge] Stabilize
let else
- [disposition: merge] Fix
#[derive(Default)]
on a generic#[default]
enum adding unnecessaryDefault
bounds
New and Updated RFCs
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2022-09-14 - 2022-10-12 🦀
Virtual
- 2022-09-14 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2022-09-14 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2022-09-14 | Virtual (Malaysia)| Golang Malaysia
- 2022-09-15 | Virtual (Columbus, OH, US) | GDG Columbus
- 2022-09-15 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-09-20 | Virtual (Washington, DC, US) | Rust DC
- 2022-09-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2022-09-22 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2022-09-22 | Virtual (Tehran, IR) | Iran Rust Meetup
- 2022-09-23 | Virtual (Tokyo, JP) | Rust Tokyo
- 2022-09-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-09-28 | Virtual (London, UK) | Rust London User Group
- 2022-10-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2022-10-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2022-10-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-10-06 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2022-10-08 | Virtual | Rust GameDev
- 2022-10-12 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2022-10-12 | Virtual (San Francisco, CA, US) | Microsoft Reactor San Francisco
Europe
- 2022-09-15 | Paris, FR | Rust Paris
- 2022-09-27 | Nijmegen, NL | Rust Nederland
- 2022-09-28 | London, UK + Virtual | Rust London User Group
- 2022-09-29 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2022-09-29 | Copenhagen, DK | Copenhagen Rust group
- 2022-09-29 | Enschede, NL | Dutch Rust Meetup
- 2022-10-02 | Florence, IT + Virtual | RustLab
- 2022-10-03 | Stockholm, SE | Stockholm Rust
- 2022-10-12 | Berlin, DE | Rust Berlin
North America
- 2022-09-14 | Austin, TX, US | Rust ATX
- 2022-09-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 2022-09-22 | Lehi, UT, US | Utah Rust
- 2022-09-29 | Ciudad de México, MX | Rust MX
Oceania
- 2022-09-14 | Sydney, NSW, AU | Rust Sydney
- 2022-09-20 | Phillip, 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
In Rust We Trust
Thanks to Anton Fetisov 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.
Email list hosting is sponsored by The Rust Foundation