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
Foundation
Newsletters
Project/Tooling Updates
- Announcing Unreal Rust
- Introducing
cxx-async
- Arti 1.0.0 is released: Our Rust Tor implementation is ready for production use
- rust-analyzer changelog #145
- rustc_codegen_gcc: Progress Report #15
- Lapce editor 0.2.0 released
- This week in Databend #58: A Modern Cloud Data Warehouse for Everyone
- HexoSynth 2022 - Devlog #11: VST3/CLAP Plugin Integration
- Fornjot (code-first CAD in Rust) - Weekly Release - 2022-W36
- One year of Relm4
- Slint UI crate weekly updates
Observations/Thoughts
- How to Use Rust Traits, Generics and Bounds
- Wasmtime 1.0: A Look at Performance
- Understanding primitive data types in Rust
- [video] RustConf 2022 Talks
- [video] Rust Education Workshop 2022
- [audio] Fyrox with Dmitry Stepanov
Rust Walkthroughs
- Filtering a Vector with SIMD Instructions (AVX-2 and AVX-512)
- Learning Rust: Async Combinators
- Solving The Witness with Z3 (Part 2)
- How to build a (simple) blog using Rust
- STM32F4 Embedded Rust at the HAL: The RTIC Framework
- [video] Nine Rules for Elegant Rust Library APIs
Miscellaneous
-
[DE] Security: FreeBSD-Kernel bekommt experimentelle Rust-Patches
-
Random File Lines and Iterator Items: Understanding Reservoir Sampling with Rust
Crate of the Week
This week's crate is sql-query-builder, a library to write SQL queries in a simple and composable way.
Thanks to Belchior Oliveira 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 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 - Show ockam command help in $PAGER or less (clap based)
- Ockam - Detect new release is available and display upgrade instructions in ockam command
- Ockam - Remove the --node argument from ockam enroll clap command
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
417 pull requests were merged in the last week
- add tier-3 support for powerpc64 and riscv64 openbsd
- support
#[unix_sigpipe = "inherit|sig_dfl"]
onfn main()
to prevent ignoringSIGPIPE
- proc_macro/bridge: send diagnostics over the bridge as a struct
- proc_macro/bridge: use the cross-thread executor for nested proc-macros
- do not leak type variables from opaque type relation
- attempt to normalize
FnDef
signature inInferCtxt::cmp
- do not report too many expr field candidates
- do not suggest adding
move
to closure whenmove
is already used - don't suggest reborrow if usage is inside a closure
- suggest
{Option,Result}::{copied,clone}()
to satisfy type mismatch - suggest associated method on deref types when path syntax method fails
- suggest moving redundant generic args of an assoc fn to its trait
- suggest returning closure as
impl Fn
- add
special_module_name
lint - uplift the
let_underscore
lints from clippy into rustc - strengthen
invalid_value
lint to forbid uninit primitives, adjust docs to say that's UB - forbid mixing
System
with direct sytem allocator calls - use head span for
rustc_on_unimplemented
'senclosing_scope
attr - make call suggestions more general and more accurate
- make trait bound not satisfied specify kind
- miri: adjust for supporting more implicit ptr-to-int transmutation
- miri: re-enable FFI support
- allow deriving multipart suggestions
- replace
rustc_data_structures::thin_vec::ThinVec
withthin_vec::ThinVec
- separate the receiver from arguments in HIR
- shrink
thir::Pat
- shrink suggestion span of argument mismatch error
- simplify
hir::PathSegment
- interpret: fix unnecessary allocation in validation visitor
- more
clippy::perf
fixes - optimization of access level table construction
- migrate
rustc_session
to useSessionDiagnostic
- Pt. 1 - migrate
rustc_metadata
toSessionDiagnostics
- migrate
rustc_monomorphize
to useSessionDiagnostic
- porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1
- fix UB from misalignment and provenance widening in
std::sys::windows
- avoid needless buffer zeroing in
std::sys::windows::fs
- avoid zeroing large stack buffers in stdio on Windows
- add
AsFd
implementations for stdio types on WASI - implement internal
IsZero
for Wrapping and Saturating forVec
optimizations - add
vec::Drain{,Filter}::keep_rest
- fix
into_iter
on ZST - provider API: add additional methods to the
Demand
type - make
ReentrantMutex
movable andconst
- make
char::is_lowercase
andchar::is_uppercase
const - make
const_eval_select
a real intrinsic - hashbrown:
Equivalent
trait - cargo: rework test error handling
- clippy: add
--explain
subcommand - clippy: new lint
bool_to_int_with_if
- clippy: initial implementation
result_large_err
- clippy: don't use
hir_ty_to_ty
inresult_large_err
- clippy: use
approx_ty_size
forlarge_enum_variant
- clippy: fix
mut_mutex_lock
when mutex is behind immutable deref - clippy: fix
suboptimal_float
not linting on{const}.powf({const})
- clippy: fix
unnecessary_to_owned
false positive - clippy: fix missing parens in
suboptimal_flops
suggestion - clippy: fix the emission order of
trait_duplication_in_bounds
- clippy: suggest
Entry::or_default
forEntry::or_insert(Default::default())
- rust-analyzer: clarify the state of (extern) preludes for block def maps
- rust-analyzer: don't store
SyntheticSyntax
in the reverse maps inBodySourceMap
- rust-analyzer: drop the expander borrow in all control flow paths
- rust-analyzer: fix nested break expressions, expecting unknown types
- rust-analyzer: highlight namerefs by syntax until proc-macros have been loaded
- rust-analyzer: lift out the module scope into a field in the resolver
- rust-analyzer: prefer the type of expression in "Replace turbofish with type"
- rust-analyzer: properly handle break resolution inside non-breakable expressions
- rust-analyzer: remove
hir::Expr::MacroStmts
- rust-analyzer: remove type alias definition on inline
- rust-analyzer: suggest struct when completing enum
- rust-analyzer: add a "Unmerge match arm" assist to split or-patterns inside match expressions
- rust-analyzer: implement
feature(exhaustive_patterns)
from unstable Rust - rust-analyzer: assist to turn
match
intomatches!
invocation - rust-analyzer: insert whitespaces into
static
&const
bodies if they are expanded from macro on hover - rust-analyzer: lower float literals with underscores
- rust-analyzer: only move comments when extracting a struct from an enum variant
- rust-analyzer: parse
TypePathFn
with preceding::
- rust-analyzer: correct broken logic for return completion
- rust-analyzer: unescape all occurrences of module name in module resolution
Rust Compiler Performance Triage
A relatively quiet week where regressions unfortunately outweighed improvements. What's more, many of the regressions that were found seemed somewhat mysterious requiring some deeper investigations.
Triage done by @rylev. Revision range: 0631ea5d73..09fb0bc6e
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.7% | [0.2%, 4.5%] | 85 |
Regressions ❌ (secondary) |
1.0% | [0.3%, 5.4%] | 87 |
Improvements ✅ (primary) |
-0.7% | [-1.0%, -0.5%] | 9 |
Improvements ✅ (secondary) |
-1.4% | [-2.7%, -0.5%] | 22 |
All ❌✅ (primary) | 0.5% | [-1.0%, 4.5%] | 94 |
2 Regressions, 3 Improvements, 2 Mixed; 3 of them in rollups 40 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:
- 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] De-RFC: Remove type ascription
Tracking Issues & PRs
- [disposition: merge] Stabilize generic associated types
- [disposition: merge] Fix handling of trailing bare CR in str::lines
- [disposition: merge] Implement Default for some alloc/core iterators
- [disposition: merge] Tracking Issue for
#[instruction_set]
attribute (RFC 2867) - [disposition: merge] Consider
#[must_use]
annotation onasync fn
as also affecting theFuture::Output
- [disposition: merge] Tracking issue for
..X
, and..=X
(#![feature(half_open_range_patterns)]
)
New and Updated RFCs
- [new] RFC: Add descriptive names to doctest
- [new] Add a general mechanism of setting RUSTFLAGS in Cargo for the root crate only
- [new] Rust Style Team
- [new] Add
core::mem::offset_of!
RFC
Upcoming Events
Rusty Events between 2022-09-07 - 2022-10-05 🦀
Virtual
- 2022-09-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2022-09-08 | Virtual (Linz, AT) | Rust Linz
- 2022-09-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2022-09-09 | Virtual + Linz, AT | Rust Linz
- 2022-09-10 | Virtual | Rust GameDev
- 2022-09-10 | Virtual (Bangalore, IN) | Polkadot India
- 2022-09-12 | Virtual + Dublin, IE | Linux Plumbers Conference
- 2022-09-13 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2022-09-13 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-09-13 | Virtual (Rostock, DE) | Altow Academy
- 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-23 | Virtual (Tokyo, JP) | Rust Tokyo
- 2022-09-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 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
Europe
- 2022-09-09 | Linz, AT + Virtual | Rust Linz
- 2022-09-12 | Dublin, IE + Virtual | Linux Plumbers Conference
- 2022-09-13 | Rome, IT | Rust Roma
- 2022-09-15 | Paris, FR | Rust Paris
- 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
North America
- 2022-09-08 | Columbus, OH, US| Columbus Rust Society
- 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
Oceania
- 2022-09-14 | Sydney, NSW, AU | Rust Sydney
South America
- 2022-09-10 | São Paulo, BR | Rust São Paulo Meetup
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
So long, and thanks for all the turbofish.
Thanks to Josh Triplett 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