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
- rust-analyzer changelog #159
- Making Dioxus (almost) as fast as SolidJS
- Announcing Ksunami v0.1.x
- Fornjot (code-first CAD in Rust) - Weekly Release
- Youki v0.0.4 Release
Observations/Thoughts
- Catch 22! Rust in Review
- A Look at dyn* Code Generation
- Shopify Embraces Rust for Systems Programming
- Rust in 2023
- Category Theory with Rust (pt2) - GATs example
- Rust: state of GUI, from the perspective of KAS
- A call for blogs about Rust GUI in 2023
- [video] Next Generation i18n with Rust Using ICU4X
- [video] Supercharging Zero-Copy Deserialization
- [video] Let's write a TCP Port Scanner in Rust
- [video] Rust Is Easy (The COMPILER teaches you!)
- [audio] Presser with Gray Olson
- [audio] Kernel Density Estimation with Seaton Ullberg
Rust Walkthroughs
- Clean Code with Rust & Axum
- Data-driven performance optimization with Rust and Miri
- Embedded Rust & Embassy: Analog Sensing with ADCs
- Sorting with SIMD
- Sending Emails from the Edge with Rust
- Composing an observable Rust application
Miscellaneous
Crate of the Week
This week's crate is lazy_format, a lazy version of format! for more efficient composed string formatting operations.
Thanks to Nathan West 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.
- impl-tools - more testing more context
- time - more testing more context
- Ockam - Refactor request_controller function to accept an optional Identity
- Ockam - Add optional --identity argument to secure-channel create and modify implementation on ockam_api
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
320 pull requests were merged in the last week
- add LLVM KCFI support to the Rust compiler
- add StableOrd trait
- add help for
#![feature(impl_trait_in_fn_trait_return)]
- compute generator sizes with
-Zprint_type_sizes
- consider
parent_count
for const param defaults - detect long types in E0308 and write them to disk
- detect spurious ; before assoc fn body
- disable top down MIR inlining
- don't ICE in ExprUseVisitor on FRU for non-existent struct
- don't call
diagnostic_hir_wf_check
query if we have infer variables - don't internalize
__llvm_profile_counter_bias
- enable ThinLTO for rustc on
x86_64-apple-darwin
- enable ThinLTO for rustc on x64 msvc
- enable profiler in dist-powerpc64le-linux
- fix build on powerpc-unknown-freebsd
- fix invalid codegen during debuginfo lowering
- fix lint perf regressions
- group some fields in a common struct so we only pass one reference instead of three
- interpret: clobber return place when calling function
- llvm-wrapper: adapt for LLVM API changes
- llvm-wrapper: adapt for an LLVM API change
- make
VecDeque::from_iter
O(1)
fromvec(_deque)::IntoIter
- make integer-to-integer
From
impls#[inline(always)]
- make pointer
sub
andwrapping_sub
methods#[inline(always)]
- make some trivial functions
#[inline(always)]
- mangle "main" as
"__main_void"
on wasm32-wasi - on E0195 point at where clause lifetime bounds
- point at GAT
where
clause when an obligation is unsatisfied - point at LHS on binop type err if relevant
- point at args in associated const fn pointers
- re-enable removal of ZST writes to unions
- recurse into nested impl-trait when computing variance
- remove
token::Lit
fromast::MetaItemLit
- remove {
Early
,Late
}LintPassObjects
- shrink
rustc_parse_format::Piece
- suggest parenthesis around
ExprWithBlock BinOp ExprWithBlock
- suggest removing struct field from destructive binding only in shorthand scenario
- tweak "the following other types implement trait"
- tweak
rustc_must_implement_one_of
diagnostic output - miri: allow configurable and platform-specific page sizes
- miri: make unix path handling on Windows hosts (and vice versa) preserve absoluteness
- cargo: allow Check targets needed for optional doc-scraping to fail without killing the build
- rustdoc: only hide lines starting with
#
in rust code blocks - rustdoc: prevent auto/blanket impl retrieval if there were compiler errors
- clippy:
arithmetic-side-effects
: consider user-provided pairs - clippy:
uninlined_format_args:
ignore assert! anddebug_assert!
before 2021 edition - clippy: add 1.58 MSRV for
collapsible_str_replace
- clippy: add
suppress_restriction_lint_in_const
config - clippy: add lint
almost_complete_digit_range
- clippy: add semicolon-outside/inside-block lints
- clippy: don't suggest keeping borrows in
identity_op
- clippy: fix
zero_ptr
suggestion forno_std
crates - rust-analyzer: compute data layout of types
- rust-analyzer: add "Remove redundant parentheses" assist
- rust-analyzer: add fallback case in generated
PartialEq
impl - rust-analyzer: allow unwrap block in let initializers
- rust-analyzer: breaking snippets on typed incomplete suggestions
- rust-analyzer: don't show duplicated adjustment hints for blocks, ifs and matches
- rust-analyzer: fix parsing of
_ = x
in closure body - rust-analyzer: make
make_body
respect comments inextract_function
- rust-analyzer: normalize projection after discarding free
BoundVar
s in RPIT - rust-analyzer: only shift
BoundVar
s that come from outside lowering context - rust-analyzer: show type info on hover of enum variant fields
Rust Compiler Performance Triage
Fairly quiet week with the only excitement coming from a nice improvement implemented by @nnethercote which fixed a pesky performance regressions in the linting system. This produced a 0.6% performance improvement across a large amount of the real world crates we test against.
Triage done by @rylev. Revision range: 9db224fc..109cccbe
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.2% | [0.2%, 0.2%] | 3 |
Regressions ❌ (secondary) |
1.7% | [0.3%, 3.3%] | 11 |
Improvements ✅ (primary) |
-0.8% | [-2.2%, -0.2%] | 129 |
Improvements ✅ (secondary) |
-1.2% | [-4.4%, -0.1%] | 97 |
All ❌✅ (primary) | -0.7% | [-2.2%, 0.2%] | 132 |
2 Regressions, 2 Improvements, 4 Mixed; 3 of them in rollups 41 artifact comparisons made in total
See the full report for details.
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] Add
core::mem::offset_of!
RFC - [disposition: close] Cargo allow running binaries from development or build dependencies
Tracking Issues & PRs
- [disposition: merge] Stabilize
#![feature(target_feature_11)]
- [disposition: merge] Stabilize default_alloc_error_handler
- [disposition: merge] Stop promoting all the things
- [disposition: merge]
Arc::ptr_eq
does not always return "true if the two Arcs point to the same allocation" as documented - [disposition: merge] Don't normalize in AstConv
- [disposition: merge] Encode spans relative to the enclosing item -- enable by default
- [disposition: merge] impl DispatchFromDyn for Cell and UnsafeCell
- [disposition: merge] Tracking issue for the "efiapi" calling convention
New and Updated RFCs
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-14 - 2023-01-11 🦀
Virtual
- 2022-12-14 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2022-12-24 | Virtual (Linz, AT) | Rust Linz
- 2022-12-14 | Virtual (México City, MX) | Rust MX
- 2022-12-15 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-12-20 | Virtual (Berlin, DE) | Berlin.rs
- 2022-12-20 | Virtual (Washington, DC, US) | Rust DC
- 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
Asia
- 2022-12-29 | Tel Aviv, IL | Rust TLV
Europe
- 2022-12-14 | Trondheim, NO | Rust Trondheim
- 2022-12-15 | Stuttgart, DE | Rust Community Stuttgart
North America
- 2022-12-14 | Austin, TX, US | Rust ATX
- 2022-12-20 | San Francisco, CA, US | San Francisco Rust Study Group
- 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
... you can lead a horse to git but you cannot make it commit.
Thanks to Anton Fetisov 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