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.
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
Foundation
Project/Tooling Updates
- 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
Observations/Thoughts
- 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
Rust Walkthroughs
- 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
Miscellaneous
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!
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.
Artichoke
- Implement
mezzaluna_feature_loader::LoadedFeatures::shrink_to
- Implement
artichoke_backend::module::Registry::shrink_to
- Implement
artichoke_backend::class::Registry::shrink_to
Ockam
- 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
- stabilize
-Z strip
as-C strip
- permit const panics in stable const contexts in stdlib
- simplify
for
loop desugar - warn on
#[must_use]
use on async fn's - suggest
&str.chars()
on attempt to&str.iter()
- suggest
await
in 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
ManuallyDrop
suggestion - 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
TraitRef
s when emitting suggestions - avoid suggesting literal formatting that turns into member access
- address performance regression introduced by recent ADT drop requirements fix
- optimize
impl Hash for ObligationCauseData
by not hashingObligationCauseCode
variant fields - add IEEE 754-2019 minimun and maximum functions for
f32
/f64
- make char conversion functions unstably
const
- make slice →
str
conversion and related functionsconst
- mark
<*const _>::align_offset
and<*mut _>::align_offset
asconst fn
- mark
Arc::from_inner
/Rc::from_inner
asunsafe
- stabilize
File::options
- add
Vec::retain_mut
- implement
Termination
forResult<Infallible, E>
- implement
clone_from
forState
- miri: portable SIMD: basic binops
- arch: work-around buggy Intel chips erroneously reporting BMI1/BMI2 support
- arch: complete armv8 instructions
- log: add
Log
implementation for&impl Log
andArc<impl Log>
- cargo: add
--message-format
forinstall
command - cargo: enhance error message for target auto-discovery
- cargo: warn when alias shadows external subcommand
- clippy: add new lint
octal_escapes
- clippy: allow
suboptimal_flops
inconst
functions - clippy: avoid inline hints with double backticks for
doc-markdown
- clippy: don't show
no_effect
warning on unit structs implementingfn_once
- clippy: fix ICE on
undocumented_unsafe_blocks
- clippy: fix
manual_map
with 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_once
suggestion and add new lintneedless_splitn
- clippy: fix
shadow_same
false positives for async function arguments - clippy: improve
needless_borrow
lint - clippy: improve heuristic for eagerness suggestion
- clippy: fix suggestion in
option_map_or_none
- 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
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] 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
New RFCs
- RFC Update: Clarify that RFC1520 does not permit the compiler to replace calls to Clone::clone with a memcpy
Upcoming Events
Rusty Events between 11/24-12/08 🦀
Online
- 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
North America
Europe
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.
Rust Jobs
StackBlitz
Elektron
tangram
Kraken
- Backend Engineer - Rust - Core Backend (Remote)
- Backend Engineer, Kraken Futures - Rust (Remote)
- Senior Rust Engineer - Banking (Remote)
Maasa Labs
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!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, andrewpollack, U007D, kolharsam, joelmarcey, marriannegoldin.
Email list hosting is sponsored by The Rust Foundation