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.
Foundation
- Welcoming Software Engineer Adam Harvey to the Rust Foundation Team
- New SLSA++ Survey Reveals Real-World Developer Approaches to Software Supply Chain Security
Newsletters
Project/Tooling Updates
- autometrics 0.3: Defining Service-Level Objectives (SLOs) in Rust Source Code
- Typst starts its public beta test and goes open source
- Klint: Compile-time Detection of Atomic Context Violations for Kernel Rust Code
- rust-analyzer changelog #173
- Gitea 1.19.0 is released
- Fornjot (code-first CAD in Rust) - Weekly Release - Finished!
- activitypub-federation 0.4.0: Major rewrite with improvements to usability and documentation
- Quickwit 0.5: Distributed tracing with Open Telemetry and Jaeger, VRL, Pulsar support, and more...!
- pavex, a new Rust web framework - Progress report #2
Observations/Thoughts
- Temporary lifetimes
- Must move types
- Defer blocks and async drop
- A template proposal for adopting Rust at work
- Patterns & Abstractions
- Const as an auto trait
- Item Patterns And Struct Else
- Why use Rust on the backend?
- The Importance of Logging
- AsRef vs Borrow trait (ft. ChatGPT)
- [audio] Cargo Limit with Alexander Lopatin :: Rustacean Station
- [video] The Truth about Rust/WebAssembly Performance
Rust Walkthroughs
- Using Cow in Rust for efficient memory utilization
- STM32F4 Embedded Rust at the PAC: Creating Hardware Abstractions
- STM32F4 Embedded Rust at the PAC: GPIO Interrupts
- Build your own Counting Bloom Filter
- [video] Setting up CI and property testing for a Rust crate
Research
- Verus: Verifying Rust Programs using Linear Ghost Types
- Ownership guided C to Rust translation
- Optimizing a parser/compiler with data-oriented design: a case study
Miscellaneous
Crate of the Week
This week's crate is Speedy2D, a crate offering cross-platform Hardware-accelerated drawing of shapes, images, and text, with an easy to use API.
Thanks to Aleksey Kladov 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.
- racoon - Open Source IAM call for contributors
- Ockam - create clap command to show the details of a secure-channel listener on a node
- Ockam - create clap command to delete an existing Forwarder on a node
- Ockam - ockam run - a single command to run many ockam “create” commands
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
321 pull requests were merged in the last week
inherit_overflow
: adapt pattern to also work with v0 manglingread_buf_exact
: on error, all read bytes are appended to the buffer- add
enable-warnings
flag for llvm, and disable it by default - add
useless_anonymous_reexport
lint - add note for mismatched types because of circular dependencies
- do not ICE for unexpected lifetime with ConstGeneric rib
- don't ICE for late-bound consts across
AnonConstBoundary
- don't suggest similar method when unstable
- fix ICE in
custom-test-frameworks
feature - fix ClashingExternDeclarations lint ICE
- emit diagnostic when calling methods on the unit type in method chains
- ensure
ptr::read
gets all the same LLVMload
metadata that dereferencing does - erase escaping late-bound regions when probing for ambiguous associated types
- error-msg: expand suggestion for
unused_def
lint - error-msg: impl better suggestion for
E0532
- fall back to old metadata computation when type references errors
- fast path for
process_obligations
- fix
generics_of
for impl's RPITIT (Return Position Impl Trait In Trait) synthesized associated type - fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty
- install projection from RPITIT to default trait method opaque correctly
- make fns from other crates with RPITIT work for
-Zlower-impl-trait-in-trait-to-assoc-ty
- fix object safety checks for new RPITITs
- fix linker detection for clang with prefix
- flatten/inline
format_args!()
and (string and int) literal arguments intoformat_args!()
- implement
FixedSizeEncoding
forUnusedGenericParams
- implement checked
Shl
/Shr
at MIR building - only expect a GAT const param for
type_of
of GAT const arg - pass the right HIR back from
get_fn_decl
- remove
identity_future
indirection - remove box expressions from HIR
- replace ZST operands and debuginfo by constants
- simplify proc macro signature validity check
- some cleanups in our normalization logic
- suggest surrounding the macro with
{}
to interpret as a statement - use
unused_generic_params
from crate metadata - miri: move reject with isolation logic in fcntl
- miri: tree borrows
- properly allow macro expanded
format_args
invocations to use captures - optimize dep node backtrace and ignore fatal errors
- fallback to lstat when stat fails on Windows
- stabilise
unix_socket_abstract
- stabilize
atomic_as_ptr
- use index based drop loop for slices and arrays
- allow using
Range
as anIterator
in const contexts - cargo: accurately show status when downgrading dependencies
- cargo: add
--ignore-rust-version
flag to cargo install - cargo: add more information to wait-for-publish
- cargo: align semantics of generated vcs ignore files
- cargo: handle case mismatches when looking up env vars in the Config snapshot
- rustdoc: correctly merge import's and its target's docs in one more case
- rustdoc: docFS: replace rayon with threadpool and enable it for all targets
- rustdoc: implement bag semantics for function parameter search
- clippy: add
allow_attribute
lint - clippy: new lint to detect
&std::path::MAIN_SEPARATOR.to_string()
- clippy: enhance
ifs_same_cond
to warn same immutable method calls as well - clippy: fix
almost_swapped
false positive (let mut a = b; a = a
) - clippy: fix
almost_swapped
: Ignore external macros - clippy: issue function modifiers in the right order in
manual_async_fn
lint - rust-analyzer: add an autofix for inserting an unsafe block to missing unsafe diagnostic
- rust-analyzer: prioritize missing variants in match pattern completions
- rust-analyzer: allow the status bar item to be clicked again
- rust-analyzer: fix reference completions being emitted in places other than argument lists
- rust-analyzer: fix rustc proc-macro handling being broken on the rustc workspace itself
- rust-analyzer: fix visibility resolution not respecting parent blocks
- rust-analyzer: only skip adjustment hints for block, if and match expressions for reborrows
- rust-analyzer: lint incoherent inherent impls
Rust Compiler Performance Triage
A mixed week, with some nice wins, but also at least two PR's that were subsequently reverted, such as the upgrade to LLVM 16. We do want to note PR #108944, which cut down on crate metadata, binary sizes, and was an overall win on execution time for many benchmarks.
Triage done by @pnkfelix. Revision range: 00587489..ef03fda3
1 Regressions, 4 Improvements, 11 Mixed; 2 of them in rollups 37 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: merge] RFC: result_ffi_guarantees
Tracking Issues & PRs
- [disposition: merge] Initial support for return type notation (RTN)
- [disposition: merge] rustdoc: add support for type filters in arguments and generics
- [disposition: merge] rustdoc: run more HIR validation to mirror rustc
- [disposition: merge] Add a builtin FnPtr trait that is implemented for all function pointers
- [disposition: merge] Clarify stability guarantee for lifetimes in enum discriminants
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 2023-03-22 - 2023-04-19 🦀
Virtual
- 2023-03-22 | Virtual (Richmond, VA, US) | Rustaceans RVA
- 2023-03-27 | Virtual | Rust Formal Methods Interest Group
- 2023-03-28 | Virtual (Berlin, DE) | Berline.rs - OpenTechSchool Berlin
- 2023-03-28 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-03-28 | Virtual (Redmond, WA, US) | Microsoft Reactor Redmond
- 2023-03-29 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2023-03-31 | Virtual (Tunis, TN) | Rust Tunisia
- 2023-04-04 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-04-05 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-04-05 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-04-11 | Virtual (Berlin, DE) | Berline.rs - OpenTechSchool Berlin
- 2023-04-11 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-04-11 | Virtual | Rust Live
- 2023-04-18 | Virtual (Washington, DC, US) | Rust DC
- 2023-04-19 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Europe
- 2023-03-28 | Zurich, CH | Rust Zurich
- 2023-03-29 | Paris, FR | Rust Paris
- 2023-04-04 | Berlin, DE | Berline.rs
- 2023-04-06 | Lyon, FR | Rust Lyon
- 2023-04-19 | Zurich, CH | Rust Zurich
Asia
- 2023-04-08 | Kyoto, JP | Kansai Rust
- 2023-04-12 | Kuala Lumpur, MY | Rust Malaysia; Telegram
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 generated program is a random sequence of bytes that just happens to take the shape of a seemingly working program by accident. Such is the joy of code that causes UB. You cannot deduce anything from what happens when you execute a program with UB, since that act is by itself meaningless. You need to establish that your program has no UB before making any inference based on what you see the program do after it came out of the compiler.
Thanks to bugaevc 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