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
Newsletters
Project/Tooling Updates
- Scaphandre 0.5.0, to measure energy consumption of IT servers and computers, is released : windows compatibility (experimental), multiple sensors support, and much more...
- IntelliJ Rust Changelog #187
- rust-analyzer changelog #166
- argmin 0.8.0 and argmin-math 0.3.0 released
- Fornjot (code-first CAD in Rust) - Weekly Release - The Usual Rabbit Hole
- One step forward, an easier interoperability between Rust and Haskell
- Managing complex communication over raw I/O streams using
async-io-typed
andasync-io-converse
- Autometrics - a macro that tracks metrics for any function & inserts links to Prometheus charts right into each function's doc comments
Observations/Thoughts
- Ordering Numbers, How Hard Can It Be?
- Next Rust Compiler
- Forking Chrome to render in a terminal
- 40x Faster! We rewrote our project with Rust!
- Moving and re-exporting a Rust type can be a major breaking change
- What the HAL? The Quest for Finding a Suitable Embedded Rust HAL
- Some Rust breaking changes don't require a major version
- Crash! And now what?
Rust Walkthroughs
- Handling Integer Overflow in Rust
- Rust error handling with anyhow
- Synchronizing state with Websockets and JSON Patch
- Plugins for Rust
- [series] Protohackers in Rust, Part 00: Dipping the toe in async and Tokio
- Building gRPC APIs with Rust using Tonic
Miscellaneous
Crate of the Week
This week's crate is symphonia, a collection of pure-Rust audio decoders for many common formats.
Thanks to Kornel for the suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but did not 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.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
377 pull requests were merged in the last week
- move
format_args!()
into AST (and expand it during AST lowering) - implement Hash for
proc_macro::LineColumn
- add help message about function pointers
- add hint for missing lifetime bound on trait object when type alias is used
- add suggestion to remove if in
let
..else
block - assume MIR types are fully normalized in
ascribe_user_type
- check for missing space between fat arrow and range pattern
- compute generator saved locals on MIR
- core: support variety of atomic widths in width-agnostic functions
- correct suggestions for closure arguments that need a borrow
- detect references to non-existant messages in Fluent resources
- disable
ConstGoto
opt in cleanup blocks - don't merge vtables when full debuginfo is enabled
- fix def-use dominance check
- fix thin archive reading
- impl
DispatchFromDyn
forCell
andUnsafeCell
- implement simple
CopyPropagation
based on SSA analysis - improve proc macro attribute diagnostics
- insert whitespace to avoid ident concatenation in suggestion
- only compute
mir_generator_witnesses
query indrop_tracking_mir
mode - preserve split DWARF files when building archives
- recover from more const arguments that are not wrapped in curly braces
- reimplement
NormalizeArrayLen
based onSsaLocals
- remove overlapping parts of multipart suggestions
- special-case deriving
PartialOrd
for enums with dataless variants - suggest coercion of
Result
using?
- suggest qualifying bare associated constants
- suggest using a lock for
*Cell: Sync
bounds - teach parser to understand fake anonymous enum syntax
- use
can_eq
to compare types for default assoc type error - use proper
InferCtxt
when probing for associated types in astconv - use stable metric for const eval limit instead of current terminator-based logic
- remove optimistic spinning from
mpsc::SyncSender
- stabilize the
const_socketaddr
feature - codegen_gcc: fix/signed integer overflow
- cargo:
cargo add
check[dependencies]
order without considering the dotted item - cargo: avoid saving the same
future_incompat
warning multiple times - cargo: fix split-debuginfo support detection
- cargo: make cargo aware of dwp files
- cargo: mention current default value in
publish.timeout
docs - rustdoc: collect rustdoc-reachable items during early doc link resolution
- rustdoc: prohibit scroll bar on source viewer in Safari
- rustdoc: use smarter encoding for playground URL
- rustdoc: add option to include private items in library docs
- fix infinite loop in rustdoc
get_all_import_attributes
function - rustfmt: don't wrap comments that are part of a table
- rustfmt: fix for handling empty code block in doc comment
- clippy:
invalid_regex
: show full error when string value doesn't match source - clippy:
multiple_unsafe_ops_per_block
: don't lint in external macros - clippy: improve span for
module_name_repetitions
- clippy: missing config
- clippy: prevents
len_without_is_empty
from triggering whenlen
takes arguments besides&self
- rust-analyzer: adding section for Visual Studio IDE Rust development support
- rust-analyzer: don't fail workspace loading if sysroot can't be found
- rust-analyzer: improve "match to let else" assist
- rust-analyzer: show signature help when typing record literal
- rust-analyzer: ide-assists: unwrap block when it parent is let stmt
- rust-analyzer: fix config substitution failing extension activation
- rust-analyzer: don't include lifetime or label apostrophe when renaming
- rust-analyzer: fix "add missing impl members" assist for impls inside blocks
- rust-analyzer: fix assoc item search finding unrelated definitions
- rust-analyzer: fix process-changes not deduplicating changes correctly
- rust-analyzer: handle boolean scrutinees in match
<->
if let replacement assists better - rust-analyzer: substitute VSCode variables more generally
Rust Compiler Performance Triage
Overall a positive week, with relatively few regressions overall and a number of improvements.
Triage done by @simulacrum. Revision range: c8e6a9e..a64ef7d
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.6% | [0.6%, 0.6%] | 1 |
Regressions ❌ (secondary) |
0.3% | [0.3%, 0.3%] | 1 |
Improvements ✅ (primary) |
-0.8% | [-2.0%, -0.2%] | 27 |
Improvements ✅ (secondary) |
-0.9% | [-1.9%, -0.5%] | 11 |
All ❌✅ (primary) | -0.8% | [-2.0%, 0.6%] | 28 |
2 Regressions, 4 Improvements, 6 Mixed; 2 of them in rollups 44 artifact comparisons made in total
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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] Stabilize feature
cstr_from_bytes_until_nul
- [disposition: merge] Support
true
andfalse
as boolean flag params - [disposition: merge] Implement
AsFd
andAsRawFd
forRc
- [disposition: merge] rustdoc: compute maximum Levenshtein distance based on the query
New and Updated RFCs
- [new] Permissions
- [new] Add text for the CFG OS Version RFC
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:
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.
Upcoming Events
Rusty Events between 2023-02-01 - 2023-03-01 🦀
Virtual
- 2023-02-01 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-02-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-02-01 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-01 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-02-06 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-07 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
- 2023-02-07 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-02-07 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-08 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-02-08 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-09 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-02-11 | Virtual | Rust GameDev
- 2023-02-13 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-02-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-02-14 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-14 | Virtual (Saarbrücken, DE) | Rust-Saar
- 2023-02-15 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US; São Paulo, BR) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco and Microsoft Reactor São Paulo
- 2023-02-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-02-21 | Virtual (Washington, DC, US) | Rust DC
- 2023-02-23 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-02-23 | Virtual (Kassel, DE) | Java User Group Hessen
- 2023-02-28 | Virtual (Berlin, DE) | Open Tech School Berlin
- 2023-02-28 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-03-01 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-02-01 | Kyoto, JP | Kansai Rust
- 2023-02-20 | Tel Aviv, IL | Rust TLV
Europe
- 2023-02-02 | Berlin, DE | Prenzlauer Berg Software Engineers
- 2023-02-02 | Hamburg, DE | Rust Meetup Hamburg
- 2023-02-02 | Lyon, FR | Rust Lyon
- 2023-02-04 | Brussels, BE | FOSDEM
- 2023-02-09 | Lille, FR | Rust Lille
- 2023-02-15 | London, UK | Rust London User Group
- 2023-02-15 | Trondheim, NO | Rust Trondheim
- 2023-02-16, 2023-02-17 | London, UK | Rust Nation UK
- 2023-02-18 | London, UK | Rust London User Group
- 2023-02-21 | Zurich, CH | Rust Zurich
- 2023-02-23 | Copenhagen, DK | Copenhagen Rust Community
North America
- 2023-02-09 | Mountain View, CA, US | Mountain View Rust Study Group
- 2023-02-09 | New York, NY, US | Rust NYC
- 2023-02-13 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2023-02-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-02-23 | Lehi, UT, US | Utah Rust
Oceania
- 2023-02-28 | Canberra, ACT, AU | Canberra Rust User Group
- 2023-03-01 | 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
Compilers are an error reporting tool with a code generation side-gig.
– Esteban Küber on Hacker News
Thanks to Stefan Majewsky 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