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
Foundation
Project/Tooling Updates
- rust-analyzer changelog #156
- IntelliJ Rust Changelog #183
- Fornjot (code-first CAD in Rust) - Weekly Release
- This Week in Fyrox #3
- futures-concurrency Release v7.0.0
- Rust Search Extension v1.9.0 has been released
- [Chinese] RustSBI 0.3.0 Has Released
- [Chinese] Video: Technologies and Applications in RustSBI 0.3.0
Observations/Thoughts
- A Better Way to Borrow in Rust: Stack Tokens
- Category Theory with Rust (pt1)
- If a Tree Falls in a Forest, Does It Overflow the Stack?
- Safely writing code that isn't thread-safe
- Embedded Rust & Embassy: GPIO Button Controlled Blinking
- [video] Panel: Rust in reality - EuroRust 2022
Rust Walkthroughs
- Calling Rust from iOS
- Rust, Lambda, and DynamoDB
- Render Pipelines in wgpu and Rust
- (Re)writing an interpreter in Rust
Miscellaneous
- The carcinization of Go programs
- Flux: Refinement Types for Rust
- [video] Rust 🤝 WebAssembly with Alex Crichton
- [video] Getting Started with Rust: Understanding Rust Compile Errors
- [video] Can you use Character Controllers for non-platformer games?
Crate of the Week
This week's crate is graph, a collection of high-performance graph algorithms.
Thanks to Knutwalker for the (partial 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.
There were no calls for participation submitted this week. If you would like to submit, please check the guidelines.
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
- deduce closure signature from a type alias
impl Trait
's supertraits - pass 128-bit C-style enum enumerator values to LLVM
- detect incorrect chaining of if and if let conditions and recover
- diagnostics
icu4x
based list formatting - diagnostics: only show one suggestion for method → assoc fn
- fix inconsistent rounding of 0.5 when formatted to 0 decimal places
- fix non-associativity of
Instant
math onaarch64-apple-darwin
targets - improve generating Custom entry (as in
main()
) function - improve spans for RPITIT object-safety errors
- interpret: support for per-byte provenance
- llvm-wrapper adapt for LLVM API change
- nll: correctly deal with bivariance
- only do parser recovery on retried macro matching
- record
LocalDefId
in HIR nodes instead of a side table - shift no characters when using raw string literals
- slightly improve error message for invalid identifier
- support
#[track_caller]
on async fns - miri: make
align_offset
always work on no-provenance pointers - miri: stack borrows: weak protectors
- add new MIR constant propagation based on dataflow analysis
- merge basic blocks where possible when generating LLVM IR
- minimal implementation of implicit deref patterns for Strings
- shrink
ast::Expr
harder - use
token::Lit
inast::ExprKind::Lit
- perform simple scalar replacement of aggregates (SROA) MIR opt
- make
pointer::byte_offset_from
more generic - fix
mod_inv
termination for the last iteration - improve accuracy of asinh and acosh
- stabilize const char convert
VecDeque::resize
should re-use the buffer in the passed-in elementunchecked_
{shl
,shr
} should useu32
as the RHS- constify
is_aligned
viaalign_offset
x86_64
SSE2 fast-path forstr.contains(&str)
and short needles- remove HRTB from
slice::is_sorted_by
(_key
) - portable-simd: scatter/gather for pointers
- stdarch: fix undefined behavior in
movemask_epi8
- compiler-builtins: skip assembly implementations on the UEFI targets
- compiler-builtins: use a stub stdlib.h when compiling for UEFI targets
- cargo: fix cargo install --index when used with registry.default
- cargo: alternative registry authentication support (RFC #3139)
- cargo: improve error message for cargo add/remove
- rustdoc: fix missing minification for static files
- rustdoc: resolve doc links in external traits having local impls
- clippy:
never_loop
: don't emit AlwaysBreaks if it targets a block - clippy: add new lint
misnamed-getters
- clippy: allow manual swap in const fn
- clippy: allow return types for closures with lifetime binder
- clippy:
arithmetic_side_effects
: detect overflowing associated constants of integers - clippy: extend
needless_borrowed_reference
to structs and tuples, ignore_
- clippy: lint unchecked subtraction of a 'Duration' from an 'Instant'
- clippy: fix
#[allow]
formodule_name_repetitions
&single_component_path_imports
- clippy: preserve
ref
oninfallible_destructuring_match
suggestion - rust-analyzer: allow viewing the full compiler diagnostic in a readonly textview
- rust-analyzer: make "Remove dbg!()" assist work on selections
- rust-analyzer: remove
item_const
which had default value when implement missing members - rust-analyzer: format expression parsing edge-cases
- rust-analyzer: include generic parameter in GAT completions
- rust-analyzer: resolve inference variable before applying adjustments
- rust-analyzer: strip comments and attributes off of all trait item completions
- rust-analyzer: support multiple targets for checkOnSave (in conjunction with cargo 1.64.0+)
Rust Compiler Performance Triage
A fairly quiet week with regressions unfortunately slightly outweighing improvements. There was not any particular change of much note. Many of the regressions were justifiable since they were for critical bug fixes.
Triage done by @rylev. Revision range: 96ddd32c..a78c9bee
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.7% | [0.2%, 3.0%] | 76 |
Regressions ❌ (secondary) |
1.5% | [0.3%, 8.4%] | 69 |
Improvements ✅ (primary) |
-0.7% | [-1.8%, -0.2%] | 18 |
Improvements ✅ (secondary) |
-1.4% | [-3.2%, -0.2%] | 35 |
All ❌✅ (primary) | 0.4% | [-1.8%, 3.0%] | 94 |
7 Regressions, 4 Improvements, 6 Mixed; 5 of them in rollups 47 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] Style evolution
Tracking Issues & PRs
- [disposition: merge] Expand a style-guide principle: readability in plain text
- [disposition: merge] Stabilize native library modifier
verbatim
New and Updated RFCs
Upcoming Events
Rusty Events between 2022-11-23 - 2022-12-21 🦀
Virtual
- 2022-11-24 | Virtual (Linz, AT) | Rust Linz
- 2022-11-28 | Virtual | Rust Formal Methods Interest Group
- 2022-11-29 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-11-30 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2022-11-30 | Virtual (Munich, DE) | Rust Munich
- 2022-12-01 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2022-12-01 | Virtual (Lehi, UT, US) | Utah Rust
- 2022-12-01 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2022-12-06 | Virtual (Berlin, DE) | Berlin.rs
- 2022-12-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2022-12-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2022-12-07 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-12-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2022-12-08 | Virtual (San Francisco, CA, US) | Data + AI Online Meetup
- 2022-12-10 | Virtual | Rust GameDev
- 2022-12-13 | Virtual (Rostock, DE) | Altow Academy
- 2022-12-13 | Virtual (Saarbrücken, DE) | Rust-Saar
- 2022-12-14 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2022-12-20 | Virtual (Berlin, DE) | Berlin.rs
- 2022-12-20 | Virtual (Washington, DC, US) | Rust DC
- 2022-12-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Europe
- 2022-11-23 | Bratislava, SK | Bratislava Rust Meetup Group
- 2022-11-24 | København, DK | Copenhagen Rust Group
- 2022-11-28 | London, UK | Rust London User Group
- 2022-11-30 | Amsterdam, NL | Rust Nederland
- 2022-11-30 | Lille, FR | Rust Lille
- 2022-11-30 | Milan, IT | Rust Language Milano
- 2022-11-30 | Paris, FR | Rust Paris
- 2022-11-30 | Munich, DE + Virtual | Rust Munich
- 2022-12-01 | Edinburgh, UK | Rust Edinburgh
- 2022-12-01 | Wrocław, PL | Rust Wrocław
- 2022-12-07 | Zurich, CH | Rust Zurich
- 2022-12-12 | Enschede, NL | Dutch Rust Meetup
North America
- 2022-11-29 | Austin, TX, US | ATX Rustaceans
- 2022-12-01 | Lehi, UT, US + Virtual | Utah Rust
- 2022-12-08 | Columbus, OH, US | Columbus Rust Society
- 2022-12-20 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2022-11-24 | Brisbane, QLD, AU | Rust Brisbane
- 2022-12-08 | Melbourne, VIC, AU | Rust Melbourne
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
While working on these userspace Mesa changes today, I did not hit a single GPU kernel driver bug. Not. A. Single. Bug.
This is thanks to Lina's phenomenal efforts. She took a gamble writing the kernel driver in Rust, knowing it would take longer to get to the first triangle but believing it would make for a more robust driver in the end. She was right.
A few months of Lina's Rust development has produced a more stable driver than years of development in C on certain mainline Linux GPU kernel drivers.
I think... I think I have Rust envy 🦀
....Or maybe just Lina envy 😊
– Alyssa Rosenzweig tooting on Mastodon
Thanks to Brian Kung 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