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
- IntelliJ Rust Changelog #185
- rust-analyzer changelog #160
- Cranelift Progress in 2022
- Native Reflection in Rust
- Announcing Diesel-Async 0.2.0
- Easily verify your Rust in CI with Kani and GitHub Actions
- Fornjot (code-first CAD in Rust) - Weekly Release
- Slint 0.3.3 Release and weekly update
Observations/Thoughts
- My Year With Rust: The Good, The Bad, The Ugly | BreakBuildGames
- An adventure with optimization, Rust and Z3
- Faster CI builds for Rust with pre-baked builder images and sccache
- UI development in Rust
- Docs as Code: Mermaid inline diagrams
- Rust needs
#[throws]
, not ubiquitous handwrittenOk()
- [video] Possibility of OCI Container Runtime with Rust at KubeDay Japan
Rust Walkthroughs
- How to build a Rust API with the builder pattern
- Building a Command-Line Application in Rust
- Writing SQL User-Defined Functions in Rust
- New Rust course by Android: Comprehensive Rust 🦀
Miscellaneous
- Our year in Rust - in a rhyme!
- Rust for the Polyglot Programmer (2022 edition) - a rather different introductory text, now revised
- [audio] Episode 108: Jane Losare-Lusby on Rust! (Part 3)
- [DE] Programmiersprache Rust 1.66 erweitert Enumerations und entfernt Abhängigkeiten
- [video] Re-writing an Express.js chat app (web-sockets) in Rust
- [video] Story time: Rust compiler errors
- [video] Let's write a TUI Password Manager in Rust - Part 2
- [video] Decrusting the serde crate
Crate of the Week
This week's crate is dhat, a crate providing DHAT-like allocation profiling capabilities.
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 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.
- Ockam - Add
clap
command to list available vaults - Ockam - Add optional --identity argument to clap commands that use CloudOpts
- Ockam - Add optional --identity argument to clap command secure-channel-listener create and modify its handler
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
368 pull requests were merged in the last week
- fix
-Z print-type-sizes
for generators with discriminant field ordered first - account for item-local in inner scope for E0425
- add
0..=isize::MAX
range metadata to size loads from vtables - add batch flag to remote-test-server
- address some
EarlyBinder
nits - adjust log line in
fuchsia-test-runner.py
- allow
impl ~const Trait
opaque types - allow unsafe through inline const
- always check alignment during CTFE
- always evaluate vecs of subdiagnostics eagerly
- always use
anonymize_bound_vars
- auto traits in
dyn Trait + Auto
are suggestable - bail in
collect_trait_impl_trait_tys
if signatures reference errors - change pattern borrowing suggestions to be verbose and remove invalid suggestion
- check AArch64 branch-protection earlier in the pipeline
- combine
ty::Projection
andty::Opaque
intoty::Alias
- custom MIR: Many more improvements
- fast-path some binder relations
- find the right lower bound region in the scenario of partial order relations
- fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR)
- guard ProjectionTy creation against passing the wrong number of substs
- help rust-analyzer normalize query return types
- highlight conflicting param-env candidates, again
- illegal sized bounds: only suggest mutability change if needed
- implement DerefMut for PathBuf
- make some diagnostics not depend on the source of what they reference being available
- normalize receiver substs and erase the regions
- point at method chains on
E0271
errors - point out the type of associated types in every method call of iterator chains
- print argument name in arg mismatch if possible
- properly handle postfix inc/dec in standalone and subexpr scenarios
- simpler diagnostic when passing arg to closure and missing borrow
- stabilize
default_alloc_error_handler
- start improving monomorphization items stats
- suggest
collect
ing intoVec<_>
- suggest a
T: Send
bound for&mut T
upvars inSend
generators - suggest constraining type parameter with
Clone
- suggest dereferencing receiver arguments properly
- support
#[track_caller]
on async closures - use a more efficient
Once
on platforms without threads - futures: impl FusedStream for Buffered
- cargo: artifact deps should works when target field specified coexists with
optional = true
- cargo: show
--help
if there is no man page for subcommand - cargo: stabilize terminal-width
- cargo: use workspace lockfile when running
cargo package
andcargo publish
- rustdoc: don't add "Read more" link if there is no extra content
- clippy: fix
new_return_no_self
with recursive bounds - clippy: fix logic in
IncrementVisitor
- clippy: fix overflow ICE in
large_stack/const_arrays
- clippy: fix: not suggest
seek_to_start_instead_of_rewind
when expr is used - clippy: extend
useless_conversion
to identify more cases of uselessinto_iter()
calls - clippy:
manual_is_ascii_check
check - clippy: move
manual_clamp
to nursery - clippy:
null
fn lints - rust-analyzer: add a command to clear flycheck diagnostics
- rust-analyzer: add command for manually running flychecks
- rust-analyzer: add parentheses for binding mode hints when they attach to an Or-pattern
- rust-analyzer: deduplicate inserted parentheses in binding mode hints
- rust-analyzer: parse half-open
..= X
patterns - rust-analyzer: fix wrong config patching logic for addCallParenthesis
- rust-analyzer: add a check for
if
token in patterns parser - rust-analyzer: fix "parser seems stuck" panic when parsing colossal files
- rust-analyzer: resolve all inference vars in
InferenceResult::assoc_resolutions
- rust-analyzer: use the correct edition when formatting code in path dependencies
Rust Compiler Performance Triage
Relatively quiet week for performance, with most regressions and improvements being pretty small.
Triage done by @simulacrum. Revision range: 109ccc..8a746f4
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.9% | [0.2%, 2.8%] | 28 |
Regressions ❌ (secondary) |
0.7% | [0.2%, 1.3%] | 39 |
Improvements ✅ (primary) |
-1.0% | [-1.1%, -1.0%] | 2 |
Improvements ✅ (secondary) |
-1.7% | [-4.3%, -0.2%] | 24 |
All ❌✅ (primary) | 0.8% | [-1.1%, 2.8%] | 30 |
3 Regressions, 4 Improvements, 2 Mixed; 3 of them in rollups 53 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] Don't normalize in AstConv
- [disposition: merge] Change
bindings_with_variant_name
to deny-by-default
New and Updated RFCs
- No New or Updated RFCs were created this week.
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 2022-12-21 - 2023-01-18 🦀
Virtual
- 2022-12-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2022-12-27 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-01-03 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
- 2023-01-03 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-01-03 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-01-04 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-01-04 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-01-05 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-01-10 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-01-11 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-01-12 | Virtual (San Francisco, CA, US; Stockholm, SE; New York, NY US) | Microsoft Reactor San Francisco | Microsoft Reactor New York
- 2023-01-16 | 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-17 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-01-17 | 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-17 | Virtual (Washington, DC, US) | Rust DC
- 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
Asia
- 2022-12-29 | Tel Aviv, IL | Rust TLV
Europe
- 2022-12-29 | Freiburg, DE | Arso Collective
North America
- 2022-12-27 | Austin, TX, US | ATX Rustaceans
- 2023-01-05 | 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
In the depths of a computer's core,
Where bits and bytes are stored,
Lies a tool that's often ignored
But without it, things would be floored.It's the rust borrow checker,
A guardian of memory,
Ensuring that data is in the right place
And never causing miseries.With each line of code it carefully scans,
Checking for underflows and overflows,
Preventing errors, saving the day,
And keeping the program in a flow.So let's give a nod to this silent hero,
Whose work may go unnoticed, but is never zero,
It's the rust borrow checker,
A vital part of the machine,
Ensuring our programs run clean.
– ChatGPT prompted by Vivek Yadav
llogiq is quite self-appreciative 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