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
Newsletters
Project/Tooling Updates
- rust-analyzer Changelog #170
- IntelliJ Rust Changelog #189
- gitoxide - [January]: The first
cargo
integration review - Dioxus 0.3 - Templates, Hot Reloading, LiveView, and more
- Rust on Espressif chips - 2023 Roadmap
- Announcing transitive 0.4.1, for better transitivity between types
- Announcing
compact_str
version 0.7! A small string optimization for Rust - Introducing Ambient 0.1
- This Week in Fyrox #16
- Fornjot (code-first CAD in Rust) - Weekly Release - Still More To Do
- [video] Cargo's New Sparse Index w/special guest Arlo Siemsen
- Kani Internship Projects 2022: Function Stubbing
- Announcing Magmide Month! (proof language for/using Rust)
Observations/Thoughts
- [video] Rust and RAII Memory Management - Computerphile
- All the Problems of Mutation
- Learning Rust Part 1: A kitten's guide to Options and Results
- When Rust hurts
- Time Travel Debugging in Rust
- What I learned from contributing to Rust's linter
- Rust Programming #1 - Getting started & basic concepts
- ROFL with a LOL: rewriting an NGINX module in Rust
- Pretty Rust backtraces in raw terminal mode
- A Little Bit of Rust
- How Rust and Wasm power Cloudflare's 1.1.1.1
- STM32F4 Embedded Rust at the PAC: SysTick Delay
- Write a First Person Game in 2KB With Rust
Rust Walkthroughs
- Trait Implementations and References
- Some exercises to accompany the Rust Book
- [video] Compression from scratch: Huffman coding tutorial
- Create a launchbar app using Tauri & Rust
Miscellaneous
- EuroRust 2023 announced for Oct. 12-13 in Brussels, BE
- Introducing MailCrab!
- Rust Nation 2023 Review
- Announcing wasi-threads
- WAI is the Answer !!!
- [video] Tutorial: Building a Blog in Rust - Static File Server
- [video] Embedded-exploration: Debugging Rust start-up code via JTAG
- [video] Oxidise Your Life
- [video] Improve your Rust APIs with the type state pattern
- (Possibly) Emulate PinePhone with Unicorn Emulator
- [Video] Generic Traits, Impls, and Slices in Rustlang
Crate of the Week
This week's crate is goku, a HTTP load tester.
Thanks to Joaquín Caro 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 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.
- barricade - Add support for OpenID Connect
- config-rs - CFP for the config-rs-ng experiment for a new implementation of the config-rs crate
- Ockam - Remove the check_credential arguments from clap command ockam tcp-inlet create
- Ockam - Implement clap command ockam tcp-listener delete
- Ockam - Improve install.sh to install in path - like rustup
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
381 pull requests were merged in the last week
- MIR-Validate StorageLive
rustc_infer
: consolidate obligation elaboration de-duplication- add an
InstCombine
for redundant casts - add check for invalid
#[macro_export]
arguments - add inlining attributes for query system functions
- apply query response: actually define opaque types
- ban associated type bounds in bad positions
- correctly handle aggregates in DataflowConstProp
- diagnostics: if
AssocFn
has self argument, describe as method - do not lint ineffective unstable trait impl for unresolved trait
- don't delay
ReError
bug during lexical region resolve - don't project specializable RPITIT projection
- don't trigger error for ReError when other region is empty
- emit the enum discriminant separately for the Encodable macro
- fix
is_terminal
's handling of long paths on Windows - fix handling of reexported macro in doc hidden items
- fix overlapping spans in removing extra arguments
- give the resolver access to
TyCtxt
- implement
-Zlink-directives=yes/no
- implement const iterator using
rustc_do_not_const_check
- lint against
Iterator::map
receiving a callable that returns()
- lint dead code in closures and generators
- lint: don't suggest
MaybeUninit::assume_init
for uninhabited types - make object bound candidates sound in the new trait solver
- make query keys
Copy
- make sure
test_type_match
doesn't ICE with late-bound types - merge
diagnostic_items
duplicate diagnostics - migrate
rustc_hir_analysis
to session diagnostic Part One - miri: basic dyn* support
- move IpAddr, SocketAddr and V4+V6 related types to
core
- parser: provide better suggestions and errors on closures with braces missing
- print a backtrace when query forcing fails
- rebuild BinaryHeap on unwind from retain
- remove dead unwinds before drop elaboration
- rustdoc: avoid including
<li>
tags in item table short desc - treat
str
as containing[u8]
for auto trait purposes - use
ThinVec
more in the AST - use a lock-free datastructure for
source_span
- miri: get Miri working on ARM
- hashbrown:
raw_table
+raw_table_mut
- hashbrown: fix last bug in
RawTable::clone_from_impl
- codegen_gcc: simd scatter gather
- cargo: addition of support for -F as an alias for --features
- cargo: error message for transitive artifact dependencies with targets the package doesn't directly interact with
- cargo: fix Cargo removing the sparse+ prefix from sparse URLs in .crates.toml
- cargo: reuse url encoding from
url
crate, don't use separatepercent-encoding
- cargo: suggest cargo add when installing library crate
- clippy: add
impl_trait_in_params
lint - clippy: add new lint
no_mangle_with_rust_abi
- clippy: add configuration to lint missing docs of
pub(crate)
items - clippy: do not panic when analyzing the malformed origin of a format string
- clippy: do not suggest to derive
Default
on generics with implicit arguments - clippy: do not suggest using Self in const generic parameters
- clippy: fix more false positives for
extra_unused_type_parameters
- clippy: fix test function checker in
unwrap_used
,expect_used
- clippy: ignore lifetimes from differing contexts in
needless_lifetimes
- clippy: normalize projections types when checking
explicit_auto_deref
- rust-analyzer: add openDocs command to context menu in VS Code extension
- rust-analyzer: add check for extra path segments after a fully qualified one
- rust-analyzer: add a case in which remainig is None in resolveing types when resolving hir path
- rust-analyzer: respect
$CARGO_HOME
when looking up toolchains - fix outdated doc
- rust-installer: adjust xz compression settings
Rust Compiler Performance Triage
Some noisy benchmarks impeded performance review this week. There was a notable improvement to a broad range of primary benchmarks, first from PR #108440, which revised the encodable proc macro to handle the discriminant separately from its fields, and second from PR #108375, which inlined a number of methods that had only a single caller. Both of these PR's were authored by the same contributor; many thanks Zoxc!
Triage done by @pnkfelix. Revision range: 3fee48c1..31f858d9
5 Regressions, 4 Improvements, 6 Mixed; 6 of them in rollups 39 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
- [disposition: close] Rename {Option, Result}::expect to unwrap_or_panic
- [disposition: close] take on bool
Tracking Issues & PRs
- [disposition: merge] io: soften ‘at most one write attempt’ requirement in io::Write::write
- [disposition: merge] Make
unused_allocation
lint againstBox::new
too - [disposition: merge] Properly allow macro expanded format_args invocations to uses captures
- [disposition: merge] Add
NonZero{I,U}{8,16,32,64,128,size}::{MIN,MAX}
- [disposition: merge] allow negative numeric literals in concat!
- [disposition: merge] Tracking issue for atomic_mut_ptr
- [disposition: merge] Add documentation about the memory layout of
Cell
- [disposition: merge] Tracking issue for
PathBuf::as_mut_os_string
andPath::as_mut_os_str
- [disposition: merge] Use
partial_cmp
to implement tuplelt
/le
/ge
/gt
New and Updated RFCs
- [new] Create RFC for bundling local images in rustdoc output
- [new] Extern types v2
- [new] format-dynamic-fill
- [new] Add RFC on governance, establishing the Leadership Council
- [new] RFC: result_ffi_guarantees
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-03-01 - 2023-03-29 🦀
Virtual
- 2023-03-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-03-02 | Virtual (Raleigh, NC, US) | Triangle BitDevs
- 2023-03-02 | Virtual (Linz, AT) | Rust Linz
- 2023-03-07 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-03-07 | Virtual (Santa Clara, CA, US) | UCSC Extension Community
- 2023-03-08 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-03-11 | Virtual | Rust GameDev
- 2023-03-14 | Virtual (Berlin, DE) | Berlin.rs
- 2023-03-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-03-14 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2023-03-15 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-03-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-03-16 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2023-03-16 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-03-21 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2023-03-21 | Virtual (Washington, DC, US) | Rust DC
- 2023-03-22 | Virtual (Richmond, VA, US) | Rustaceans RVA
- 2023-03-28 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2023-03-29 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
Asia
- 2023-03-04 | Kyoto, JP | Kansai Rust
Europe
- 2023-03-01 | Cologne, DE | Rust Cologne
- 2023-03-02 | Barcelona, ES | BcnRust
- 2023-03-02 | Wrocław, PL | Rust Wrocław
- 2023-03-07 | Bratislava, SK | Bratislava Rust Meetup Group
- 2023-03-09 | Basel, CH | Rust Basel
- 2023-03-09 | Delft, NL | Rust Nederland
- 2023-03-09 | Lyon, FR | Rust Lyon
- 2023-03-15 | Nürnberg, DE | Rust Nuremberg
- 2023-03-17 | Stuttgart, DE | Rust Community Stuttgart
- 2023-03-28 | Zurich, CH | Rust Zurich
North America
Oceania
- 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
You've probably come across unsafe. So "unsafe" is a keyword that sort of unlocks super powers and segfaults.
– Arthur Cohen during FOSDEM '23
Thanks to blonk 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