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
Project/Tooling Updates
- IntelliJ Rust Changelog #186
- rust-analyzer changelog #164
- This Week in Fyrox
- clap v4.1
- Fornjot (code-first CAD in Rust) - Weekly Release
- Release of sphrs 0.2.0, a spherical harmonics library
Observations/Thoughts
- Rails developers write some Rust: a review of Axum 0.6
- Rust should own its debugger experience
- The Hidden Control Flow — Some Insights on an Async Cancellation Problem in Rust
- Fallible - The Lost Sibling of Result and Option
- Folding arguments into the macro
- Zero To Production book review
- We Need Type Information, Not Stable ABI
- Comparison of web frameworks written in Java, nodejs and Rust
- This year I tried solving AoC using Rust, here are my impressions coming from Python!
Rust Walkthroughs
- Create a Rust worker | Wasm Workers Server
- Displaying Images on ESP32 with Rust!
- Rust FFI and bindgen: Integrating Embedded C Code in Rust
- Finding Nice MD5s Using Rust
- 2D game base with Bevy and LDtk (linked wasm)
- Song search in Rust using OpenAI
- Build a ray tracer, pt. 1 - 2D Image
Miscellaneous
- Building an out-of-tree Rust Kernel Module Part Two
- Using Rust to write a Data Pipeline. Thoughts. Musings.
- [video] C++ vs Rust: which is faster?
- [video] Everything You Wanted to Know About Rust Unit Testing (and then some more)
- [video] Introduction to rust operators for Kubernetes
- [DE] Rust-Framework: Turmoil testet verteilte Systeme
- [DE] Rust: bis zu 2500 Projekte durch Bibliothek Hyper für DoS verwundbar
- [DE] Ferris Talk #13: Rust-Web-APIs und Mocking mit Axum
- [DE] Open-Source-Browser: Google öffnet Chromium für Rust
Crate of the Week
This week's crate is syntactic-for, a syntactic "for" loop Rust macro.
Thanks to Tor Hovland 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.
- Ockam - GitHub CI: use global default shell in documentation.yml workflow
- Ockam - Modify clap command ockam start to set the node attribute's default value using attributes
- Ockam - Add optional --identity argument to clap command secure-channel-listener create and modify its API handler
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
458 pull requests were merged in the last week
- Initial
#[do_not_recommend]
implementation (RFC #2397) - LSDA Take
ttype_index
into account when taking unwind action - add checks for the signature of the
start
lang item - add log-backtrace option to show backtraces along with logging
- add note when
FnPtr
vs.FnDef
impl trait - adding a hint on iterator type errors
- allow codegen to unsize
dyn*
todyn
- change flags with a fixed default value from
Option<bool>
to bool - check
impl
'swhere
clauses inconsider_impl_candidate
in experimental solver - collect and emit proper backtraces for
delay_span_bug
s - consider return type when giving various method suggestions
- const closures
- deprioritize fulfillment errors that come from expansions
- detect out of bounds range pattern value
- detect struct literal needing parentheses
- disable "split dwarf inlining" by default
- emit a hint for bad call return types due to generic arguments
- emit a single error for contiguous sequences of unknown tokens
- emit only one nbsp error per file
- enable atomic cas for bpf targets
- exclude formatting commit from blame
- feed a bunch of queries instead of tracking fields on TyCtxt
- fix ICE formatting
- fix
aarch64-unknown-linux-gnu_ilp32
target - fix
unused_braces
on generic const expr macro call - fix bad import suggestion with nested
use
tree - fix help docs for -Zallow-features
- fix invalid files array re-creation in rustdoc-gui tester
- fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311
- fix linker detection for linker (drivers) with a version postfix (e.g. clang-12 instead of clang)
- fix misleading "add dyn keyword before derive macro" suggestion
- improve fluent error messages
- label
struct/enum constructor
instead offn item
, mention that it should be called on type mismatch - mark ZST as FFI-safe if all its fields are PhantomData
- move autoderef to
rustc_hir_analysis
- new trait solver: rebase impl substs for gats correctly
- cargo: nightly Fix CVE-2022-46176: Missing SSH host key validation
- note predicate span on
ImplDerivedObligation
- only suggest adding type param if path being resolved was a type
- prefer non-
[type error]
candidates during selection - provide help on closures capturing self causing borrow checker errors
- recover from where clauses placed before tuple struct bodies
- remove unnecessary lseek syscall when using
std::fs::read
- render missing generics suggestion verbosely
- report fulfillment errors in new trait solver
- specialize impl of
ToString
onbool
- stabilize
::{core,std}::pin::pin!
- stabilize
abi_efiapi
feature - stabilize
f16c_target_feature
- stop probing for statx unless necessary
- suggest
is_empty
for collections when casting tobool
- suggest making private tuple struct field public
- suggestion for type mismatch when we need a u8 but the programmer wrote a char literal
- tweak E0277
&
-removal suggestions - tweak E0599 and
elaborate_predicates
- support eager subdiagnostics again
- libcore: make result of
iter::from_generator
Clone
- add
AtomicPtr::as_mut_ptr
- leak amplification for
peek_mut()
to ensure BinaryHeap's invariant is always met - fix
mpsc::SyncSender
spinning behavior - futures: fix panic when
Unfold
sink return an error - futures: fix
FuturesOrdered
- cargo:
cargo metadata
supports artifact dependencies - cargo: support
codegen-backend
andrustflags
in profiles in config file - clippy:
cast_possible_truncation
SuggestTryFrom
when truncation possible - clippy:
expl_impl_clone_on_copy
: ignore packed structs with type/const params - clippy:
needless_return
: remove all semicolons on suggestion - clippy:
unused_self
: don't trigger if the method body containstodo!()
- clippy: allow implementing
Hash
with derivedPartialEq
(derive_hash_xor_eq
) - clippy: move
unchecked_duration_subtraction
to pedantic - rust-analyzer: add basic tooltips to adjustment hints
- rust-analyzer: assist: desugar doc-comment
- rust-analyzer: comment out disabled code
- rust-analyzer: derive 'Hash'
- rust-analyzer: make
unlinked_file
diagnostic quickfixes work for inline modules - rust-analyzer: fix panicking Option unwraping in match arm analysis
- rust-analyzer: fix ty should query impls in nearest block
- rust-analyzer: check orpat in missing match
- rust-analyzer: don't generate
PartialEq
/PartialOrd
methods body when types don't match - rust-analyzer: make inlay hint location links work for more types
- rust-analyzer: interior-mutable types should be
static
rather thanconst
- rust-analyzer: remove hover inlay tooltips, replace them with location links
- rust-analyzer: remove recursive
Display
implementations - rust-analyzer: split out hir-def attribute handling parts into hir-expand
- rust-analyzer: unconditionally enable location links in inlay hints again
Rust Compiler Performance Triage
Nearly all flagged regressions are likely noise, except one rollup with minor impact on diesel that we will follow up on. We had a broad (albeit small) win from #106294.
Triage done by @pnkfelix. Revision range: 0442fbab..1f72129f
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.4% | [0.2%, 1.7%] | 39 |
Regressions ❌ (secondary) |
0.5% | [0.2%, 1.8%] | 23 |
Improvements ✅ (primary) |
-0.4% | [-0.6%, -0.2%] | 7 |
Improvements ✅ (secondary) |
-0.4% | [-0.6%, -0.2%] | 6 |
All ❌✅ (primary) | 0.3% | [-0.6%, 1.7%] | 46 |
4 Regressions, 3 Improvements, 3 Mixed; 4 of them in rollups 50 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:
- 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: close] use implied bounds from impl header when comparing trait and impl methods
- [disposition: merge] rustdoc: change trait bound formatting"
- [disposition: merge] Make ExitStatus implement Default
- [disposition: merge] Allow fmt::Arguments::as_str() to return more Some(_).
New and Updated RFCs
- [new] RFC:
CARGO_TARGET_DIRECTORIES
, parent of all target directories - [new] RFC: (Re)standardise error code documentation
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.
Upcoming Events
Rusty Events between 2023-01-18 - 2023-02-15 🦀
Virtual
- 2023-01-18 | Virtual (San Francisco, CA, US; São Paulo, BR; New York, NY US) | Microsoft Reactor San Francisco and Microsoft Reactor São Paulo and Microsoft Reactor New York
- 2023-01-18 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-01-19 | Virtual (Redmond, WA, US; San Francisco, CA, US; New York, NY, US; Stockholm, SE) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco and Microsoft Reactor Stockholm
- 2023-01-19 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-01-23 | Virtual (Durham, NC, US) | Triangle Rust
- 2023-01-23 | Virtual (Linz, AT) | Rust Linz
- 2023-01-23 | Virtual (New York, NY, US; San Francisco, CA, US) | Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-01-24 | Virtual (Redmond, WA, US; New York, NY, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-01-25 | Virtual (Redmond, WA, US; San Francisco, CA, US) | Microsoft Reactor Redmond | Microsoft Reactor San Francisco
- 2023-01-26 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-01-26 | Virtual (Redmond, WA, US; San Francisco, CA, US; New York, NY, US; Stockholm, SE) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco and Microsoft Reactor Stockholm
- 2023-01-30 | 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-01-31 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-01-31 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-01-31 | 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 (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 (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-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 (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) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
- 2023-02-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Asia
- 2023-01-15 | Tokyo, JP | Tokyo Rust Meetup
- 2023-02-01 | Kyoto, JP | Kansai Rust
Europe
- 2023-01-20 | Stuttgart, DE | Rust Community Stuttgart
- 2023-01-25 | Paris, FR | Rust Paris
- 2023-01-26 | Copenhagen, DK | Copenhagen Rust Meetup Group
- 2023-02-02 | Hamburg, DE | Rust Meetup Hamburg
- 2023-02-02 | Lyon, FR | Rust Lyon
North America
- 2023-01-20 | New York, NY, US | Blockchain Center
- 2023-01-26 | Lehi, UT, US | Utah Rust
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
Common arguments against Rust's safety guarantees:
- The library you're binding to can have a segfault in it.
- RAM can physically fail, causing dangling pointers.
- The computer the Rust program is running on can be hit by a meteorite.
- Alan Turing can come back from the dead and tell everyone that he actually made up computer science and none of it is real, thus invalidating every program ever made, including all Rust programs.
– Ironmask on the phoronix forums
Thanks to Stephan Sokolow 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