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
Project/Tooling Updates
- rust-analyzer changelog #150
- IntelliJ Rust Changelog #180
- This Month in hyper: September 2022
- Fornjot - Weekly Release - 2022-W41
- This Month in Rust OSDev: September 2022
- rustc_codegen_gcc: Progress Report #16
- Fyrox 0.28 Feature Highlights
- zerocal - A Serverless Calendar App in Rust Running on shuttle.rs
- Announcing error-stack v0.2
Observations/Thoughts
- When to vendor (or not) your dependencies in Rust
- RAII: Compile-Time Memory Management in C++ and Rust
- Hard Mode Rust
- Single Pass Recursion in Rust
- Platform Agnostic Drivers in Rust: The MAX7219 Driver
- Different test scopes in Rust
Rust Walkthroughs
- Avoiding allocations in Rust to shrink Wasm modules
- Building a JobSystem
- [video] Fast Rest API - Rust + Actix Web (2022)
- Using C libraries in your Rust project
Miscellaneous
- Call for Papers: Rust Nation UK Conference 2023 (Deadline 2022-10-31)
- [audio] What's New in Rust 1.62, 1.63, and 1.64 :: Rustacean Station
- [audio] Veloren with Forest Anderson :: Rustacean Station
- [video] Day in the Life of Open Source Maintenance: 2022-10-08
- [video] Static Async Concurrency in Rust
- [video] Rust makes cents (Speed is a FEATURE)
- [video] Rust Wrocław Meetup 29 - Live stream, 6.10.2022
Crate of the Week
This week's crate is pci-driver, a crate to develop user-space PCI(e) linux drivers.
Thanks to Alberto Faria 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.
- zerocopy - Miri can't run tests for wasm32-wasi target
- zerocopy - Test in CI that we have the same MSRV in all source files
- zerocopy - Add comment to README.md stating that it's auto-generated and shouldn't be edited directly
- zerocopy - Test Clippy in CI
- Ockam - Partition rust test jobs with nextest
- Ockam - Refactor ockam identity show command to use rpc abstraction
- Ockam - Refactor tcp connection list command to use rpc abstraction
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
388 pull requests were merged in the last week
- use BOLT in CI to optimize LLVM
- stabilize
half_open_range_patterns
- check
WhereClauseReferencesSelf
after all other object safety checks - check generic argument compatibility when projecting assoc ty
- delay evaluating lint primary message until after it would be suppressed
- disable compressed debug sections on i586-gnu
- don't ICE when trying to copy unsized value in const prop
- enable inline stack probes on X86 with LLVM 16
- suggest
.into()
when all other coercion suggestions fail - suggest
==
to wrong assign expr - suggest calling method if fn does not exist
- suggest
unwrap_or_else
when a closure is given - fix MIR inlining of
asm_unwind
- fix
#[derive(Default)]
on a generic#[default]
enum adding unnecessaryDefault
bounds - fix unwind drop glue for if-then scopes
- lint against nested opaque types that don't satisfy associated type bounds
- make tests capture the error printed by a
Result
return - only allow
~const
bounds for traits with#[const_trait]
- recover from impl Trait in type param bound
- remove
TypeckResults
fromInferCtxt
- show let-else suggestion on stable
- skip chained OpaqueCast when building captures
- trying to suggest additional lifetime parameter
- uplift
clippy::for_loops_over_fallibles
lint into rustc - don't ICE when normalizing closure input tys
- make
const_err
a hard error - panic-on-uninit: adjust checks to 0x01-filling
- introduce
{char, u8}::is_ascii_octdigit
- std: use futex in
Once
EscapeAscii
is not anExactSizeIterator
- slice:
#[inline]
a couple iterator methods - add
Vec::push_within_capacity
- fallible, does not allocate - add
T
toimpl Debug for PhantomData
- only export
__tls_*
on wasm32-unknown-unknown - add
AsFd
implementations for stdio lock types on WASI - add
ptr::Alignment
type - reduce
CString
allocations in std as much as possible - avoid repeated re-initialization of the
BufReader
buffer - do the
calloc
optimization forOption<bool>
From<Alignment>
for {usize
,NonZeroUsize
}- Make
Hash
{Set
,Map
}::with_hasher
unstably const - implement
Ready::into_inner()
- futures: implement
Clone
forDrain
- codegen_gcc: fix
fmaddsub
- codegen_gcc: fix simd bitmask
- codegen_gcc: fix simd select bitmask
- codegen_gcc: simd: enable
simd_as
intrinsic - cargo: import
cargo remove
into cargo - cargo: add completions for
cargo remove
- cargo: add retry support to sparse registries
- cargo: config file loaded via CLI takes priority over env vars
- cargo: fix sparse registry lockfile urls containing 'registry+sparse+'
- cargo: source replacement ambiguity (RFC #3289)
- rustdoc: render more cross-crate HRTBs properly
- bindgen: generated name override
- bindgen: context: fix tokenization of C++20 inline namespace
- clippy: add
disallowed_macros
lint - clippy: add
manual_filter
lint forOption
- clippy: new
implicit_saturating_add
lint - clippy: add a temporary workaround for multiline formart arg inlining
- clippy: don't suggest moving tuple structs with a significant drop to late evaluation
- clippy: fix
arithmetic_side_effects
false negative - clippy: don't ignore literal references on
arithmetic-side-effects
- clippy:
FormatArgsExpn
: find comma spans and ignore weird proc macro spans - clippy: further enhance
needless_borrow
, mildly refactorredundant_clone
- clippy:
match_single_binding
add curlies for more cases to fix suggestion - clippy:
suboptimal_flops
lint for multiply and subtract - clippy: extend
box-default
lint, add suggestion - clippy: let
upper_case_acronyms
check the enum name - clippy:
unsafe_removed_from_name
: fix false positive when#[allow]
ed - rust-analyzer: add
convert_named_struct_to_tuple_struct
assist - rust-analyzer: prefer similar tokens when expanding macros speculatively
- rust-analyzer: fix
generate_method
: correct method indentation inside generated impl and change gen loc - rust-analyzer: expand unmatched mbe fragments to reasonable default token trees
- rust-analyzer: honor cfg attributes on params when lowering their patterns
- rust-analyzer: make go-to-def work for
#[doc = include_str!("path")]
- rust-analyzer: in VSCode, correctly resolve relative paths to errors
- rust-analyzer: treat enum variants as generic item on their own
- rust-analyzer: use
BoundVar
s from current generic scope - perf: add basic runtime benchmark infrastructure
- add n-body simulation runtime benchmark
Rust Compiler Performance Triage
Overall, a fairly quiet week where the change to primary benchmarks ended up breaking exactly even. Secondary benchmarks saw improvements but not in large enough numbers for it to be particularly noteworthy.
Triage done by @rylev. Revision range: 02cd79a..1e926f0
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.8% | [0.2%, 1.4%] | 19 |
Regressions ❌ (secondary) |
1.0% | [0.3%, 1.8%] | 9 |
Improvements ✅ (primary) |
-0.6% | [-1.8%, -0.3%] | 29 |
Improvements ✅ (secondary) |
-1.0% | [-6.4%, -0.2%] | 39 |
All ❌✅ (primary) | -0.0% | [-1.8%, 1.4%] | 48 |
3 Regressions, 1 Improvements, 6 Mixed; 4 of them in rollups 41 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] make unaligned_reference a hard error
- [disposition: merge] Stabilize raw-dylib for non-x86
- [disposition: merge] Only apply
ProceduralMasquerade
hack to older versions ofrental
- [disposition: merge] Remove save-analysis.
- [disposition: merge] make order_dependent_trait_objects show up in future-breakage reports
- [disposition: merge] merge functionality of io::Sink into io::Empty
- [disposition: merge] Stabilize
duration_checked_float
- [disposition: merge] Change process spawning to inherit the parent's signal mask by default
New and Updated RFCs
- [new] unsafe attributes
- [new] Support upcasting of
dyn Trait
values - [new] Restrictions
Upcoming Events
Rusty Events between 2022-10-12 - 2022-11-09 🦀
Virtual
- 2022-10-12 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2022-10-12 | Virtual (Erlangen, DE) | Rust Franken
- 2022-10-12 | Virtual (San Francisco, CA, US / Redmond, WA, US / New York, NY, US / Toronto, CA / London, UK) | Microsoft Reactor San Francisco
- 2022-10-13 | Virtual (Berlin, DE) | EuroRust
- 2022-10-15 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2022-10-18 | Virtual (Myrtle Point, OR, US) | #EveryoneCanContribute Cafe
- 2022-10-18 | Virtual (Washington, DC, US) | Rust DC
- 2022-10-19 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2022-10-19 | Virtual (Chennai, IN) | Techceleration at Toyota Connected
- 2022-10-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2022-10-19 | Virtual | Boston NoSQL Database Group (ScyllaDB)
- 2022-10-20 | Virtual (México City, MX) | Rust MX
- 2022-10-20 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-10-25 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2022-10-25 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-10-26 | Virtual (Redmond, WA, US / New York, NY, US / Toronto, CA / Stockholm, SE) | Microsoft Reactor Redmond
- 2022-10-27 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2022-10-27 | Karlsruhe, DE | The Karlsruhe Functional Programmers Meetup Group
- 2022-11-01 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2022-11-02 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2022-11-02 | Virtual (Redmond, WA, US / San Francisco, SF, US / New York, NY, US / Toronto, CA / London, UK) | Microsoft Reactor Redmond
- 2022-11-02 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2022-11-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-11-08 | Virtual (Stockholm, SE) | Func Prog Sweden
Europe
- 2022-10-12 | Berlin, DE | Rust Berlin
- 2022-10-12 | Cologne, DE | Rust Cologne
- 2022-10-13 | Berlin, DE + Virtual | EuroRust
- 2022-10-13 | Roma, IT | Rust Roma
- 2022-10-20 | London, UK | Rust London User Group
- 2022-10-25 | Paris, FR | Rust Paris
- 2022-10-26 | London, UK | Rust London User Group
- 2022-10-27 | København, DK | Copenhagen Rust Group
North America
- 2022-10-13 | Columbus, OH, US | Columbus Rust Society
- 2022-10-18 | San Francisco, CA, US | San Francisco Rust Study Group
- 2022-10-20 | New York, NY, US | Rust NYC
- 2022-10-20 | New York, NY, US | Cloud Native New York
- 2022-10-25 | Toronto, ON, CA | Rust Toronto
- 2022-10-27 | Lehi, UT, US | Utah Rust
Oceania
- 2022-10-20 | Brisbane, QLD, AU | Rust Brisbane
- 2022-10-20 | Wellington, NZ | Rust Wellington
- 2022-11-09 | Sydney, NSW, AU | Rust Sydney
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
There's a lot of weird debate about whether Rust in the kernel is useful or not... in my experience, it's way more useful than I could've ever imagined!
I went from 1st render to a stable desktop that can run run games, browsers, etc. in about two days of work on my driver (!!!)
All the concurrency bugs just vanish with Rust! Memory gets freed when it needs to be freed! Once you learn to make Rust work with you, I feel like it guides you into writing correct code, even beyond the language's safety promises. It's seriously magic! ✨
There is absolutely no way I wouldn't have run into race conditions, UAFs, memory leaks, and all kinds of badness if I'd been writing this in C.
In Rust? Just some logic bugs and some core memory management issues. Once those were fixed, the rest of the driver just worked!!
llogiq is mightily pleased with his 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