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 and archives can be viewed at this-week-in-rust.org. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Official
- Blog: Launching the 2023 State of Rust Survey | Direct Link to Survey
- A Call for Proposals for the Rust 2024 Edition
Project/Tooling Updates
- ratatui: a Rust library for cooking up terminal user interfaces - v0.25.0
- Introducing Gooey: My take on a Rusty GUI framework
- Two New Open Source Rust Crates Create Easier Cedar Policy Management
- Introducing FireDBG - a Time Travel Visual Debugger for Rust
- Fornjot 0.48.0 - open source b-rep CAD kernel written in Rust
- Committing to Rust for kernel code
- A Rust implementation of Android's Binder
- Preventing atomic-context violations in Rust code with klint
- Rust for Linux — in space
Observations/Thoughts
- Rust is growing
- A curiously recurring lifetime issue
- The rabbit hole of unsafe Rust bugs
- Faster Rust Toolchains for Android
- The Most Common Rust Compiler Errors as Encountered in RustRover: Part 1
- Nine Rules for SIMD Acceleration of your Rust Code (Part 2): General Lessons from Boosting Data Ingestion in the range-set-blaze Crate by 7x
- What I Learned Making an embedded-hal Driver in Rust (for the MAX6675 Thermocouple Digitizer)
Rust Walkthroughs
- Rust: Traits
- Write a Toy VPN in Rust
- Getting Started with Actix Web in Rust
- Getting Started with Rocket in Rust
- Generic types for function parameters in Rust 🦀
- Benchmarking Rust Compiler Settings with Criterion: Controlling Criterion with Scripts and Environment Variables
- [series] Multithreading and Memory-Mapping: Refining ANN Performance with Arroy
- [series] Getting started with Tiny HTTP building a web application in Rust
Miscellaneous
- Embedded Rust Education: 2023 Reflections & 2024 Visions
- Default arguments for functions in Rust using macros
- [audio] Rust in Production Ep 1 - InfluxData's Paul Dix
- [audio] Episode 160: Rust & Safety at Adobe with Sean Parent
Crate of the Week
This week's crate is constcat, a std::concat!
-replacement with support for const variables and expressions.
Thanks to Ross MacArthur 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.
- Ockam - Fix documentation warnings
- Ockam - Library - Validate CBOR structs according to the cddl schema for
nodes/models/secure_channel
- Ockam - Implement events in
SqlxDatabase
- Hyperswitch - [REFACTOR]: [Nuvei] MCA metadata validation
- Hyperswitch - [FEATURE] : [Noon] Sync with Hyperswitch Reference
- Hyperswitch - [FEATURE] : [Zen] Sync with Hyperswitch Reference
- Hyperswitch - [REFACTOR] : [Authorizedotnet] Sync with Hyperswitch Reference
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
386 pull requests were merged in the last week
- enable stack probes on aarch64 for LLVM 18
- add new tier 3 aarch64-apple-watchos target
- add hexagon support
- add the function body span to StableMIR
- allow
async_fn_in_trait
traits with Send variant - cherry-pick "M68k: Fix ODR violation in GISel code (#72797)"
- AIX: fix XCOFF metadata
-Ztrait-solver=next
to-Znext-solver
- actually parse async gen blocks correctly
- add a method to StableMIR to check if a type is a CStr
- add more suggestions to unexpected cfg names and values
- add support for
--env
ontracked_env::var
- add unstable
-Zdefault-hidden-visibility
cmdline flag forrustc
- annotate panic reasons during enum layout
- attempt to try to resolve blocking concerns (RFC #3086)
- avoid overflow in GVN constant indexing
- cache param env canonicalization
- check
FnPtr
/FnDef
built-in fn traits correctly with effects - check generic params after sigature for main-fn-ty
- collect lang items from AST, get rid of
GenericBound::LangItemTrait
- coroutine variant fields can be uninitialized
- coverage: skip instrumenting a function if no spans were extracted from MIR
- deny
~const
trait bounds in inherent impl headers - desugar
yield
inasync gen
correctly, ensuregen
always returns unit - don't merge cfg and doc(cfg) attributes for re-exports
- erase late bound regions from
Instance::fn_sig()
and add a few more details to StableMIR APIs - fix ICE
ProjectionKinds Deref and Field were mismatched
- fix LLD thread flags in bootstrap on Windows
- fix
waker_getters
tracking issue number - fix alignment passed down to LLVM for
simd_masked_load
- fix dynamic size/align computation logic for packed types with dyn trait tail
- fix overlapping spans in delimited meta-vars
- ICE 110453: fixed with errors
- llvm-wrapper: adapt for LLVM API changes
- make
IMPLIED_BOUNDS_ENTAILMENT
into a hard error from a lint - make exhaustiveness usable outside of rustc
- match lowering: Remove the
make_target_blocks
hack - more expressions correctly are marked to end with curly braces
- nudge the user to kill programs using excessive CPU
- opportunistically resolve region var in canonicalizer (instead of resolving root var)
- properly reject
default
on free const items - remove unnecessary constness from ProjectionCandidate
- replace some instances of
FxHashMap
/FxHashSet
with stable alternatives (mostly inrustc_hir
andrustc_ast_lowering
) - resolve: replace visibility table in resolver outputs with query feeding
- skip rpit constraint checker if borrowck return type error
- some cleanup and improvement for invalid ref casting impl
- tweak
short_ty_string
to reduce number of files - unconditionally register alias-relate in projection goal
- update FreeBSD CI image
- uplift
TypeAndMut
andClosureKind
torustc_type_ir
- use
if cfg!
instead of#[cfg]
- use the LLVM option NoTrapAfterNoreturn
- miri: visit the AllocIds and BorTags in borrow state FrameExtra
- miri run: default to edition 2021
- miri: make mmap not use expose semantics
- fast path for
declared_generic_bounds_from_env
- stabilize
type_name_of_val
- stabilize
ptr::{from_ref, from_mut}
- add
core::intrinsics::simd
- add a column number to
dbg!()
- add more niches to
rawvec
- add ASCII whitespace trimming functions to
&str
- fix cases where std accidentally relied on inline(never)
- Windows: allow
File::create
to work on hidden files - std: add xcoff in object's feature list
- codegen: panic when trying to compute size/align of extern type
- codegen_gcc: simd: implement missing intrinsics from simd/generic-arithmetic-pass.rs
- codegen_llvm: set
DW_AT_accessibility
- cargo: clean up package metadata
- cargo: do not allow empty name in package ID spec
- cargo: fill in more empty name holes
- cargo: hold the mutate exclusive lock when vendoring
- rustdoc: use Map instead of Object for source files and search index
- rustdoc: allow resizing the sidebar / hiding the top bar
- rustdoc-search: fix a race condition in search index loading
- rustdoc-search: use set ops for ranking and filtering
- bindgen: use
\r\n
on windows - bindgen: better working destructors on windows
- clippy: add new
unconditional_recursion
lint - clippy: new Lint:
result_filter_map
/ Mirror ofoption_filter_map
- clippy: don't visit nested bodies in
is_const_evaluatable
- clippy:
redundant_pattern_matching
: lintif let true
,while let true
,matches!(.., true)
- clippy: do not lint
assertions_on_constants
forconst _: () = assert!(expr)
- clippy:
doc_markdown
Recognize words followed by empty parentheses()
for quoting - clippy: fix binder handling in
unnecessary_to_owned
- rust-analyzer: deduplicate annotations
- rust-analyzer: optimizing Performance with
Promise.all
🏎 - rust-analyzer: desugar doc correctly for mbe
- rust-analyzer: dont assume ascii in
remove_markdown
- rust-analyzer: resolve alias before resolving enum variant
- rust-analyzer: add minimal support for the 2024 edition
- rust-analyzer: move out
WithFixture
into dev-dep only crate - rust-analyzer: fix false positive type mismatch in const reference patterns
- rust-analyzer: syntax fixup now removes subtrees with fake spans
- rust-analyzer: update builtin attrs from rustc
- rust-analyzer: fix fragment parser replacing matches with dummies on incomplete parses
- rust-analyzer: fix incorrectly replacing references in macro invocation in "Convert to named struct" assist
Rust Compiler Performance Triage
A lot of noise in the results this week; there was an lull in the noise
recently, so our auto-inferred noise threshold went down, and thus five PR's
were artificially flagged this week (and three supposed improvements were just
reverting to the mean). Beyond that, we had three nice improvements: the first
to debug builds in #117962 (by ceasing emission of expensive+unused
.debug_pubnames
and .debug_pubtypes
), a second to diesel and serde
in #119048 (by avoiding some unnecessary work), and a third to several benchmarks
in #117749 (by adding some caching of an internal compiler structure).
Triage done by @pnkfelix. Revision range: 57010939..bf9229a2
6 Regressions, 9 Improvements, 3 Mixed; 5 of them in rollups 67 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
- [disposition: postpone] RFC: Precise Pre-release Deps
Tracking Issues & PRs
- [disposition: merge] Support async recursive calls (as long as they have indirection)
- [disposition: merge] make soft_unstable show up in future breakage reports
- [disposition: merge] Tracking Issue for ip_in_core
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline RFCs entered Final Comment Period this week.
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 2023-12-20 - 2024-01-17 🦀
Virtual
- 2023-12-20 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-12-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-12-28 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-01-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-01-11 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-16 | Virtual (Washington, DC, US) | Rust DC
Europe
- 2023-12-27 | Copenhagen, DK | Copenhagen Rust Community
- 2023-12-28 | Vienna, AT | Rust Vienna
- 2024-01-11 | Reading, UK | Reading Rust Workshop
- 2024-01-11 | Wrocław, PL | Rust Wrocław
- 2024-01-13 | Helsinki, FI | Finland Rust-lang Group
North America
- 2023-12-20 | Austin, TX, US | Rust ATX
- 2023-12-27 | Austin, TX, US | Rust ATX
- 2024-01-06 | Boston, MA, US | Boston Rust Meetup
- 2024-01-08 | Chicago, IL, US | Deep Dish Rust
- 2024-01-09 | Seattle, WA, US | Cap Hill Rust Coding/Hacking/Learning
- 2024-01-09 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-01-14 | Cambridge, MA, US | Boston Rust Meetup
- 2024-01-16 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-01-17 | Chicago, IL, US | Deep Dish 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
The Tianyi-33 satellite is a 50kg class space science experimental satellite equipped with an operating system independently developed by Beijing University of Posts and Telecommunications—the Rust-based dual-kernel real-time operating system RROS. RROS will carry out general tasks represented by tensorflow/k8s and real-time tasks represented by real-time file systems and real-time network transmission on the satellite. It will ensure the normal execution of upper-layer applications and scientific research tasks, such as time-delay measurement between satellite and ground, live video broadcasting, onboard web chat services, pseudo-SSH experiments, etc. This marks the world’s first official application of a Rust-written dual-kernel operating system in a satellite scenario.
Thanks to Brian Kung 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