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
Project/Tooling Updates
- rust-analyzer changelog #138
- Release Rustlings 5.0.0
- Rust on Espressif chips - 15-07-2022
- Fornjot (code-first CAD in Rust) - Weekly Release - 2022-W29
- HexoSynth 2022 - Devlog #5 - Signal Monitors and HexoTK Bugfixing
- What's new in SeaORM 0.9.0
- Slint UI crate weekly updates
- This week in Databend #51: A Modern Cloud Data Warehouse for Everyone
Observations/Thoughts
- How to speed up the Rust compiler in July 2022
- How to setup a Wasm API for a CHIP-8 emulator
- async let - A new concurrency primitve?
- Extending SQLite with Rust to support Excel files as virtual tables
- Pandas vs Polar - A look at performance
- Improving “Extract Function” in Rust Analyzer - Dorian Listens
- Advice for the next dozen Rust GUIs
- When rustc explodes
Rust Walkthroughs
- How Rust manages memory using ownership and borrowing
- Integrating a Rust module into an Android app
- Futuristic Rust: context emulation, part 2
- Elegant and performant recursion in Rust
- Getting Started with SeaORM
- Making GTK keyboard on Rust
- STM32F4 Embedded Rust at the HAL: PWM Buzzer
- [DE] Kommentar: Rust im Linux-Kernel – handeln statt jubeln!
- [video] Stop writing Rust
Miscellaneous
Crate of the Week
This week's crate is bnum, a library of arbitrarily sized fixed-size numerals.
Thanks to Isaac Holt 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.
- @CAD97 is collecting examples of unwind-safety bugs
- pyo3 - run_closure and drop_closure unsoundly drop payload on panic
- miniz_oxide - println!() can cause panic outside catch_unwind()
- axum - Add an example for a GET-or-HEAD handler that special-cases HEAD
- ockam - ockam node delete should have an --all option
- ockam - Diagnose Cannot drop a runtime ... error in rust nodes
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
416 pull requests were merged in the last week
- add Nintendo Switch as tier 3 target
- implement
for<>
lifetime binder for closures - allow destructuring opaque types in their defining scopes
- allow unions with mutable references and tuples of allowed types
- always create elided lifetime parameters for functions
- do not error during method probe on
Sized
predicates for types that aren't the method receiver - add Output = expected type trait obligation for known binary operators
- fix drop-tracking ICE when a struct containing a field with a significant drop is used across an await
- fix ICE in
named_arguments_used_positionally
lint - fix spans for asm diagnostics
- emit warning when named arguments are used positionally in format
- better error message for
generic_const_exprs
inference failure - lower let-else in MIR
- miri: optimizing Stacked Borrows (part 2): Shrink Item
- use ICF (identical code folding) for building rustc
- utilize PGO for windows x64 rustc dist builds
replace_bound_vars
fast path: check predicates, don't check consts- borrow
Vec<T, A>
as[T]
- final derive output improvements
- fix last
let_chains
blocker - stabilize
let_chains
in Rust 1.64 - stabilize
core::ffi::CStr
,alloc::ffi::CString
, and friends - stabilize
core::ffi:c_*
and rexport instd::ffi
- stabilize
future_poll_fn
- document and stabilize
process_set_process_group
- rearrange
slice::split_mut
to remove bounds check - add provider API to error trait
- add new unstable API
downcast
tostd::io::Error
- add
#[must_use]
toBox::from_raw
- implement
fmt::Write
forOsString
UnsafeCell
blocks niches inside its nested type from being available outside- hashbrown: fix double-drop in
RawTable::clone_from
- cargo: allow '.' in workspace.default-members in non-virtual workspaces
- cargo: fix nested workspace resolution
- cargo: normalize path for
cargo vendor
output - cargo: stabilize
--crate-type
flag forcargo rustc
- cargo: stabilize
-Zmultitarget
- rustdoc: avoid inlining items with duplicate
(type, name)
- rustfmt: fix/comments inside trait generics gets duplicated
- rustfmt: remove useless conditional compilation - 2
- rustfmt: add
skip_macro_invocations
option - clippy: add
repeated_where_clause_or_trait_bound
lint - clippy: add
std_instead_of_core
,std_instead_of_alloc
,alloc_instead_of_core
- clippy: add new lint
obfuscated_if_else
- clippy: fix
mismatching_type_param_order
false positive - clippy: fix for
branches_sharing_code
- clippy: improve
while_let_on_iterator
suggestion inside anFnOnce
closure - clippy: move
format_push_string
torestriction
- clippy:
box_collection
: raise warn for all std collections - clippy: change applicability type to
MaybeIncorrect
inexplicit_counter_loop
- clippy:
unused_self
: respectavoid-breaking-exported-api
- clippy:
match_like_matches_macro
does not trigger when one arm contains conta… - rust-analyzer: add simple support for completion item details
- rust-analyzer: add
str_ref_to_string
fix - rust-analyzer: automatically instaciate trivially instaciable structs in "Generate new" and "Fill struct fields"
- rust-analyzer: fix extract variable assist for subexpression in mutable borrow
- rust-analyzer: support negative,
char
&bool
const generics - rust-analyzer: go to implementation of trait methods
- rust-analyzer:
super::
completion at crate root and module depth aware - rust-analyzer: don't show qualified path completions for private items
- rust-analyzer: fix VSCode status bar tooltip not showing the error messages
- rust-analyzer: fix imports being inserted before doc comments in inline modules
- rust-analyzer: fix unresolved proc macro diagnostics pointing to macro expansions
- rust-analyzer: stack overflows and wrong type inference of associated type shorthands
- rust-analyzer: support generics in extract_function assist
- rustup: revert "Set RUSTC and RUSTDOC env for child processes run through the proxy"
- rustup: improved warning message for System-Rust-override
- rustup: correctly propagate subshell failures in rustup-init
Rust Compiler Performance Triage
A rather rough week for compiler performance with regressions outweighing improvements by a considerable margin, in particular in real world crates. To add insult to injury, the biggest regressions came in rollups which make it difficult to trace the cause.
Triage done by @rylev. Revision range: b3f4c311..8bd12e8
Summary:
mean | max | count | |
---|---|---|---|
Regressions 😿 (primary) |
1.5% | 4.0% | 176 |
Regressions 😿 (secondary) |
1.8% | 6.4% | 147 |
Improvements 🎉 (primary) |
N/A | N/A | 0 |
Improvements 🎉 (secondary) |
-1.6% | -4.1% | 9 |
All 😿🎉 (primary) | 1.5% | 4.0% | 176 |
7 Regressions, 5 Improvements, 3 Mixed; 4 of them in rollups 48 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
- [disposition: merge] RFC: resolve crates.io source replacement ambiguity
Tracking Issues & PRs
- [disposition: merge] session: stabilize split debuginfo on linux
- [disposition: merge] do not mark interior mutable shared refs as dereferenceable
- [disposition: close] Tracking issue for
#![register_attr]
New and Updated RFCs
- No New or Updated RFCs were created this week.
Upcoming Events
Rusty Events between 2022-07-20 - 2022-08-17 🦀
Virtual
- 2022-07-20 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-07-20 | Cardiff, UK | Rust and C++ Cardiff
- 2022-07-21 | Buenos Aires, AR | Rust Argentina
- 2022-07-21 | Stuttgart, DE | Rust Community Stuttgart
- 2022-07-26 | Dallas, TX, US | Dallas Rust
- 2022-07-27 | Cardiff, UK | Rust and C++ Cardiff
- 2022-07-28 | Linz, AT | Rust Linz
- 2022-07-29 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2022-07-31 | Seattle, WA, US | Seattle Rust Meetup
- 2022-08-02 | Berlin, DE | Berline.rs
- 2022-08-02 | Buffalo, NY, US | Buffalo Rust Meetup
- 2022-08-03 | Indianapolis, IN, US | Indy Rust
- 2022-08-03 | Stuttgart, DE | Rust Community Stuttgart
- 2022-08-05 | Portland, OR, US | RustConf
- 2022-08-10 | Atlanta, GA, US | Rust Atlanta
- 2022-08-10 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-08-11 | Nürnberg, DE | Rust Nuremberg
- 2022-08-13 | Virtual | Rust Gamedev
- 2022-08-16 | Washington, DC, US | Rust DC
- 2022-08-17 | Vancouver, BC, CA | Vancouver Rust
- 2022-08-18 | Charlottesville, VA, US | Charlottesville Rust Meetup
Europe
- 2022-07-20 | Warsaw, PL | Rust Warsaw
- 2022-07-21 | Oslo, NO | Rust Oslo
- 2022-07-21 | Wrocław, PL | Rust Wrocław
- 2022-07-27 | Amsterdam, NL | Rust Developers Amsterdam Group
- 2022-07-28 | Copenhagen, DK | Copenhagen Rust Group
- 2022-08-02 | London, UK | Rust London User Group
North America
- 2022-07-26 | Austin, TX, US | ATX Rustaceans
- 2022-07-27 | Austin, TX, US | Rust ATX
- 2022-08-05 | Portland, OR, US | RustConf
- 2022-08-10 | Atlanta, GA, US | Rust Atlanta
- 2022-08-11 | Columbus, IL | Columbus Rust Society
- 2022-08-16 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2022-07-28 | Brisbane, QLD, AU | Rust Brisbane
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.
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
The long compile times where all responsibility is taken away from you is infinitely more effective than submission patterns in BDSM, where the graceful rustc takes over and all you have to do is wait until they tell you that you're a good person and that everything is alright!
Thanks to Jacob Pratt 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