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? Tweet us at @ThisWeekInRust or send us a pull request. Want to get involved? We love contributions.
Updates from Rust Community
- SixtyFPS (GUI crate): Changelog for 21th of November 2021
- What's new in SeaORM 0.4.0
- This week in Fluvio #14: the programmable streaming platform
- Rust Analyzer Changelog #104
- IntelliJ Rust Changelog #160
- Arti 0.0.1 is released: An embeddable Tor client in Rust
- This week in Databend #17: an elastic and reliable cloud warehouse
- mod team resignation
- My Path to Magma: How I slowly became convinced we absolutely have to build a proof checker and bring formal verification to the mainstream.
- Rust Packages vs Crates
- Merge Queues with Bors
- Stack-safety for free?
- Intrusive Smart Pointers + Heap Only Types = 💞
- The Second First Rustc Reading Club
- Rustc Reading Club, Take 2
- Undefined Behavior deserves a better reputation
- Improving overconstrained Rust library APIs
- I used Rust for the first time to bridge two softwares, here’s how it went
- IDEs and Macros
- Contributing to Artichoke in Rust
- How lnx does fuzzy searching over 5x faster with SymSpell
- Endianness, API Design, and Polymorphism in Rust
- A Tale of Three Rust Codebases
- [DE] Programmiersprachen: Die Rust Foundation hat eine neue Geschäftsführerin
- [DE] Rust: Moderatoren der Programmiersprache treten zurück
- [audio] Error Handling in Rust with Jane Lusby
- I'm learning Rust - Ownership, lifetimes, and structs (video)
- Calling Rust from Python using PyO3
- Pinning in plain English
- Let’s Build a Salesforce Commerce Cloud Product Search Component with OCAPI, Rust, and Yew — Part 1
- Adventures in Drone Photogrammetry Using Rust and Machine Learning
- Async, refactoring and fewer bugs: Rust block expressions to the rescue
- How to instrument a Rust application with OpenTelemetry
- [series] Rust from the beginning, your first program
- [series] Oops, I Did It Again...I Made A Rust Web API And It Was Not That Difficult
- [series] Getting Started with Hippo - a WebAssembly PaaS (Part 1)
- [series] Getting Started with Hippo - a WebAssembly PaaS (Part 2)
- [series] Getting Started with Hippo - a WebAssembly PaaS (Part 3)
- [video] Using Rust with Elixir for code reuse and performance by Niklas Begley
- [video] Rust Autocomplete and Debugging in VS Code
- [video] Getting Started with WebAssembly (WASM) with Rust Lang
- [video] What's Special About Rust
- [video] Web api benchmarking: NodeJS (Express) vs Rust (actix-web)
- [video] Munich Rust Meetup Remote #9
- [series] [video] LRG-16: Threads
- [series] [video] Writing a Programming Language (in Rust) 8: Function returns and list indexing
Crate of the Week
This week's crate is rustc_codegen_nvvm, a rustc codegen backend that targets NVIDIA's libnvvm CUDA library.
Thanks to troiganto for the suggestion!
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.
- Fix handling of larger messages in ockam_node
- Replace TCP port 5000 in examples&guides
- Update to Rust 2021
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
284 pull requests were merged in the last week
- permit const panics in stable const contexts in stdlib
- warn on
#[must_use]use on async fn's
&str.chars()on attempt to
awaitin more situations where infer types are involved
- suggest removal of arguments for unit variant, not replacement
- try all stable method candidates first before trying unstable ones
- point at source of trait bound obligations in more places
- print escaped string if char literal has multiple characters, but only one printable character
- improve diagnostics when a static lifetime is expected
- improve suggestions for compatible variants on type mismatch
- fix float ICE
- fix await suggestion on non-future type
- fix incorrect handling of
TraitRefs when emitting suggestions
- avoid suggesting literal formatting that turns into member access
- address performance regression introduced by recent ADT drop requirements fix
impl Hash for ObligationCauseDataby not hashing
- add IEEE 754-2019 minimun and maximum functions for
- make char conversion functions unstably
- make slice →
strconversion and related functions
- miri: portable SIMD: basic binops
- arch: work-around buggy Intel chips erroneously reporting BMI1/BMI2 support
- arch: complete armv8 instructions
- log: add
- cargo: add
- cargo: enhance error message for target auto-discovery
- cargo: warn when alias shadows external subcommand
- clippy: add new lint
- clippy: allow
- clippy: avoid inline hints with double backticks for
- clippy: don't show
no_effectwarning on unit structs implementing
- clippy: fix ICE on
- clippy: fix
manual_mapwith unsafe functions
- clippy: fix
needless_collect's tendency to suggest code requiring multiple mutable borrows of the same value.
- clippy: fix behavior-changing
manual_split_oncesuggestion and add new lint
- clippy: fix
shadow_samefalse positives for async function arguments
- clippy: improve
- clippy: improve heuristic for eagerness suggestion
- clippy: fix suggestion in
- rustfmt: preserve normalized comments after last list item
Rust Compiler Performance Triage
This week, there were a number of cases where the
incr-unchanged variants of
inflate went up or down by 5% to 6%; we believe these are instances of increased noise in benchmarks documented on rustc-perf#1105. I was tempted to remove these from the report, but its non-trivial to re-construct the report "as if" some benchmark were omitted.
Otherwise, there were some nice wins for performance. For example, PR #90996 more than halved the time to document builds of
diesel by revising how we hash
ObligationCauseData. If anyone is interested, it might be good to follow-up on the effects of PR #90352, "Simplify
for loop desugar", where we have hypothesized that the increased compilation time is due to more LLVM optimizations being applied.
Triage done by @pnkfelix. Revision range: 934624fe..22c2d9dd
1 Regressions, 3 Improvements, 8 Mixed; 3 of them in rollups 34 comparisons made in total
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.
- No RFCs entered final comment period this week.
- [disposition: merge] Stabilize some MaybeUninit behavior as const
- [disposition: merge] Document setgroups call caused by std::os::unix::process::CommandExt.uid
- [disposition: merge] Tracking Issue for const-initialized thread locals
- [disposition: merge] Tracking Issue for NonZeroUn::is_power_of_two (feature nonzero_is_power_of_two)
- [disposition: merge] Tracking Issue for #![feature(available_parallelism)]
- [disposition: merge] Tracking Issue for inline assembly (asm!)
- [disposition: merge] Tracking Issue for cargo report future-incompat
- RFC Update: Clarify that RFC1520 does not permit the compiler to replace calls to Clone::clone with a memcpy
Rusty Events between 11/24-12/08 🦀
- November 25, 2021 | Cardiff, WLS | Rust Book Study Session - Packages, Crates and Modules & Common Collections | Rust and C++ Cardiff
- November 25, 2021 | Nuremberg, DE | Rust Nürnberg online #7 | Rust Nuremberg
- November 25, 2021 | Stuttgart, DE | Rust-Meetup | Rust Community Stuttgart
- November 25, 2021 | Linz, AT | Rust Meetup Linz - 16th Edition | Rust Linz
- November 30, 2021 | Dallas, TX, US | Last Tuesday | Dallas Rust
- November 30, 2021 | Graz, AT | Rust and memory safety | Rust Graz Meetup
- December 7, 2021 | Buffalo, NY, US | First Tuesdays | Buffalo Rust Meetup
- December 8, 2021 | Los Gatos, CA, US | Book #24 - Rust for Rustaceans - Chapter 1 | Los Gatos Reading Group
- December 8, 2021 | Los Angeles, CA, US | Rust Computer Vision Project with Geordon Worley | Rust Los Angeles
- December 8, 2021 | Stuttgart, DE | Rust-Meetup | Rust Community Stuttgart
- Backend Engineer - Rust - Core Backend (Remote)
- Backend Engineer, Kraken Futures - Rust (Remote)
- Senior Rust Engineer - Banking (Remote)
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
On the topic of reframing UB, I was reminded of an article about the mechanics of oaths and vows in historical cultures.
When a programmer writes
get_unchecked, we can imagine them wanting to promise the compiler that they uphold its preconditions. But since the compiler is normally not so trusting of unproven assertions, the programmer swears an oath that their argument is in bounds.
The compiler, seeing such a solemn commitment, treats the programmer's word as true and optimizes accordingly. The compiler is so thoroughly convinced that it never even entertains the possibility of doubting the programmer's oath.
But if the programmer has sworn falsely, then they might well suffer divine retribution in the form of nasal demons — or worse, subtly baffling program behaviour.
Thanks to G. Thorondorsen for the suggestion!
Email list hosting is sponsored by The Rust Foundation