Title: This Week in Rust 418
Number: 418
Date: 2021-11-24
Category: This Week in Rust

Hello and welcome to another issue of *This Week in Rust*!
[Rust](http://rust-lang.org) 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](https://twitter.com/ThisWeekInRust) or [send us a pull request](https://github.com/rust-lang/this-week-in-rust).
Want to get involved? [We love contributions](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md).

*This Week in Rust* is openly developed [on GitHub](https://github.com/rust-lang/this-week-in-rust).
If you find any errors in this week's issue, [please submit a PR](https://github.com/rust-lang/this-week-in-rust/pulls).

## Updates from Rust Community

### Foundation

* [The Rust Foundation Ask Me Anything (AMA) - November 2021](https://www.youtube.com/watch?v=Twb4u57kH5E)

### Project/Tooling Updates

* [SixtyFPS (GUI crate): Changelog for 21th of November 2021](https://sixtyfps.io/thisweek/2021-11-22.html)
* [What's new in SeaORM 0.4.0](https://www.sea-ql.org/SeaORM/blog/2021-11-19-whats-new-in-0.4.0/)
* [This week in Fluvio #14: the programmable streaming platform](https://www.fluvio.io/news/this-week-in-fluvio-0014/)
* [Rust Analyzer Changelog #104](https://rust-analyzer.github.io/thisweek/2021/11/22/changelog-104.html)
* [IntelliJ Rust Changelog #160](https://intellij-rust.github.io/2021/11/22/changelog-160.html)
* [Arti 0.0.1 is released: An embeddable Tor client in Rust](https://forum.torproject.net/t/arti-0-0-1-is-released-an-embeddable-tor-client-in-rust/281)
* [This week in Databend #17: an elastic and reliable cloud warehouse](https://weekly.databend.rs/2021-11-24-databend-weekly/)

### Observations/Thoughts

* [mod team resignation](https://github.com/rust-lang/team/pull/671)
* [My Path to Magma: How I slowly became convinced we absolutely have to build a proof checker and bring formal verification to the mainstream.](https://blainehansen.me/post/my-path-to-magma/)
* [Rust Packages vs Crates](https://jeffa.io/rust_packages_vs_crates)
* [Merge Queues with Bors](https://kflansburg.com/posts/merge-queues/)
* [Stack-safety for free?](https://hurryabit.github.io/blog/stack-safety-for-free/)
* [Intrusive Smart Pointers + Heap Only Types = 💞](https://blog.schichler.dev/intrusive-smart-pointers-heap-only-types-ckvzj2thw0caoz2s1gpmi1xm8)
* [The Second First Rustc Reading Club](https://mojosd.medium.com/the-second-first-rustc-reading-club-d0d0ffedc92f)
* [Rustc Reading Club, Take 2](http://smallcultfollowing.com/babysteps/blog/2021/11/18/rustc-reading-club-take-2/)
* [Undefined Behavior deserves a better reputation](https://blog.sigplan.org/2021/11/18/undefined-behavior-deserves-a-better-reputation/)
* [Improving overconstrained Rust library APIs](https://dev.to/logrocket/improving-overconstrained-rust-library-apis-47ok)
* [I used Rust for the first time to bridge two softwares, here’s how it went](https://blog.scaleway.com/i-used-rust-for-the-first-time-to-bridge-two-softwares-heres-how-it-went/)
* [IDEs and Macros](https://rust-analyzer.github.io//blog/2021/11/21/ides-and-macros.html)
* [Contributing to Artichoke in Rust](https://briankung.dev/2021/11/20/contributing-to-artichoke-in-rust/)
* [How lnx does fuzzy searching over 5x faster with SymSpell](https://chillfish8.ghost.io/fuzzy-searching-5x-faster-with-symspell/)
* [Endianness, API Design, and Polymorphism in Rust](https://www.thecodedmessage.com/posts/endian_polymorphism/)
* [A Tale of Three Rust Codebases](https://blog.convex.dev/a-tale-of-three-codebases/)
* [DE] [Programmiersprachen: Die Rust Foundation hat eine neue Geschäftsführerin](https://www.heise.de/news/Die-Rust-Foundation-hat-eine-neue-Geschaeftsfuehrerin-6270875.html)
* [DE] [Rust: Moderatoren der Programmiersprache treten zurück](https://www.heise.de/news/Rust-Moderatoren-der-Programmiersprache-treten-zurueck-6275049.html)
* [audio] [Error Handling in Rust with Jane Lusby](https://rustacean-station.org/episode/047-jane-lusby/)

### Rust Walkthroughs

* [I'm learning Rust - Ownership, lifetimes, and structs (video)](https://youtu.be/PHa9rGuDzQI)
* [Calling Rust from Python using PyO3](https://saidvandeklundert.net/learn/2021-11-18-calling-rust-from-python-using-pyo3/)
* [Pinning in plain English](https://blog.schichler.dev/pinning-in-plain-english-ckwdq3pd0065zwks10raohh85)
* [Let’s Build a Salesforce Commerce Cloud Product Search Component with OCAPI, Rust, and Yew — Part 1](https://medium.com/perimeterx/lets-build-a-salesforce-commerce-cloud-products-search-component-with-ocapi-rust-and-yew-part-98d7b3774f2f)
* [Adventures in Drone Photogrammetry Using Rust and Machine Learning](http://cmoran.xyz/writing/adventures_in_photogrammetry)
* [Async, refactoring and fewer bugs: Rust block expressions to the rescue](https://dev.to/igorpetruk/async-refactoring-and-fewer-bugs-rust-block-expressions-to-the-rescue-ef0)
* [How to instrument a Rust application with OpenTelemetry](https://21-lessons.com/how-to-instrument-a-rust-application-with-opentelemetry/)
* [series] [Rust from the beginning, your first program](https://dev.to/azure/rust-from-the-beginning-your-first-program-30cp)
* [series] [Oops, I Did It Again...I Made A Rust Web API And It Was Not That Difficult](https://dev.to/deciduously/oops-i-did-it-againi-made-a-rust-web-api-and-it-was-not-that-difficult-3kk8)
* [series] [Getting Started with Hippo - a WebAssembly PaaS (Part 1)](https://dev.to/smurawski/getting-started-with-hippo-a-webassembly-paas-part-1-5470)
* [series] [Getting Started with Hippo - a WebAssembly PaaS (Part 2)](https://dev.to/smurawski/getting-started-with-hippo-a-webassembly-paas-part-2-2ilo)
* [series] [Getting Started with Hippo - a WebAssembly PaaS (Part 3)](https://dev.to/smurawski/getting-started-with-hippo-a-webassembly-paas-part-3-1h76)
* [video] [Using Rust with Elixir for code reuse and performance by Niklas Begley](https://youtu.be/Sfb0DKD8e9A)
* [video] [Rust Autocomplete and Debugging in VS Code](https://youtu.be/2VPSzb7RNtY)
* [video] [Getting Started with WebAssembly (WASM) with Rust Lang](https://youtu.be/AlsIhnrQO9A)
* [video] [What's Special About Rust](https://youtu.be/YxzGp33K088)
* [video] [Web api benchmarking: NodeJS (Express) vs Rust (actix-web)](https://youtu.be/5ObNvCMIkPs)
* [video] [Munich Rust Meetup Remote #9](https://youtu.be/Ejzi-56-nqc)
* [series] [video] [LRG-16: Threads](https://youtu.be/U6Yg6-aW_Zg)
* [series] [video] [Writing a Programming Language (in Rust) 8: Function returns and list indexing](https://www.youtube.com/watch?v=EPdilVGovxE)

### Miscellaneous

* [I Made a Star Wars Programming Language Called "The Force" in Rust!](https://codecaptured.com/blog/i-made-a-star-wars-programming-language-called-the-force/)

## Crate of the Week

This week's crate is [rustc\_codegen\_nvvm](https://crates.io/crates/rustc_codegen_nvvm), a rustc codegen backend that targets NVIDIA's libnvvm CUDA library.

Thanks to [troiganto](https://users.rust-lang.org/t/crate-of-the-week/2704/987) for the suggestion!

[Please submit your suggestions and votes for next week][submit_crate]!

[submit_crate]: https://users.rust-lang.org/t/crate-of-the-week/2704

## 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.

* [rusty-celery is looking for contributors](https://github.com/rusty-celery/rusty-celery)

**Artichoke**

* [Implement `mezzaluna_feature_loader::LoadedFeatures::shrink_to`](https://github.com/artichoke/artichoke/issues/1501)
* [Implement `artichoke_backend::module::Registry::shrink_to`](https://github.com/artichoke/artichoke/issues/1503)
* [Implement `artichoke_backend::class::Registry::shrink_to`](https://github.com/artichoke/artichoke/issues/1502)

**Ockam**

* [Fix handling of larger messages in ockam_node](https://github.com/ockam-network/ockam/issues/2236)
* [Replace TCP port 5000 in examples&guides](https://github.com/ockam-network/ockam/issues/2256)
* [Update to Rust 2021](https://github.com/ockam-network/ockam/issues/2249)

If you are a Rust project owner and are looking for contributors, please submit tasks [here][guidelines].

[guidelines]: https://users.rust-lang.org/t/twir-call-for-participation/4821

## Updates from the Rust Project

284 pull requests were [merged in the last week][merged]

[merged]: https://github.com/search?q=is%3Apr+org%3Arust-lang+is%3Amerged+merged%3A2021-11-15..2021-11-22

* [stabilize `-Z strip` as `-C strip`](https://github.com/rust-lang/rust/pull/90058)
* [permit const panics in stable const contexts in stdlib](https://github.com/rust-lang/rust/pull/90687)
* [simplify `for` loop desugar](https://github.com/rust-lang/rust/pull/90352)
* [warn on `#[must_use]` use on async fn's](https://github.com/rust-lang/rust/pull/89610)
* [suggest `&str.chars()` on attempt to `&str.iter()`](https://github.com/rust-lang/rust/pull/90803)
* [suggest `await` in more situations where infer types are involved](https://github.com/rust-lang/rust/pull/91022)
* [suggest removal of arguments for unit variant, not replacement](https://github.com/rust-lang/rust/pull/90961)
* [try all stable method candidates first before trying unstable ones](https://github.com/rust-lang/rust/pull/90329)
* [point at source of trait bound obligations in more places](https://github.com/rust-lang/rust/pull/89580)
* [print escaped string if char literal has multiple characters, but only one printable character](https://github.com/rust-lang/rust/pull/90861)
* [improve `ManuallyDrop` suggestion](https://github.com/rust-lang/rust/pull/90901)
* [improve diagnostics when a static lifetime is expected](https://github.com/rust-lang/rust/pull/90667)
* [improve suggestions for compatible variants on type mismatch](https://github.com/rust-lang/rust/pull/90575)
* [fix float ICE](https://github.com/rust-lang/rust/pull/90927)
* [fix await suggestion on non-future type](https://github.com/rust-lang/rust/pull/90933)
* [fix incorrect handling of `TraitRef`s when emitting suggestions](https://github.com/rust-lang/rust/pull/90819)
* [avoid suggesting literal formatting that turns into member access](https://github.com/rust-lang/rust/pull/90989)
* [address performance regression introduced by recent ADT drop requirements fix](https://github.com/rust-lang/rust/pull/90845)
* [optimize `impl Hash for ObligationCauseData` by not hashing `ObligationCauseCode` variant fields](https://github.com/rust-lang/rust/pull/90996)
* [add IEEE 754-2019 minimun and maximum functions for `f32`/`f64`](https://github.com/rust-lang/rust/pull/91008)
* [make char conversion functions unstably `const`](https://github.com/rust-lang/rust/pull/89258)
* [make slice → `str` conversion and related functions `const`](https://github.com/rust-lang/rust/pull/90607)
* [mark `<*const _>::align_offset` and `<*mut _>::align_offset` as `const fn`](https://github.com/rust-lang/rust/pull/90958)
* [mark `Arc::from_inner` / `Rc::from_inner` as `unsafe`](https://github.com/rust-lang/rust/pull/89741)
* [stabilize `File::options`](https://github.com/rust-lang/rust/pull/85766)
* [add `Vec::retain_mut`](https://github.com/rust-lang/rust/pull/90772)
* [implement `Termination` for `Result<Infallible, E>`](https://github.com/rust-lang/rust/pull/88601)
* [implement `clone_from` for `State`](https://github.com/rust-lang/rust/pull/90535)
* [miri: portable SIMD: basic binops](https://github.com/rust-lang/miri/pull/1918)
* [arch: work-around buggy Intel chips erroneously reporting BMI1/BMI2 support](https://github.com/rust-lang/stdarch/pull/1249)
* [arch: complete armv8 instructions](https://github.com/rust-lang/stdarch/pull/1256)
* [log: add `Log` implementation for `&impl Log` and `Arc<impl Log>`](https://github.com/rust-lang/log/pull/471)
* [cargo: add `--message-format` for `install` command](https://github.com/rust-lang/cargo/pull/10107)
* [cargo: enhance error message for target auto-discovery](https://github.com/rust-lang/cargo/pull/10090)
* [cargo: warn when alias shadows external subcommand](https://github.com/rust-lang/cargo/pull/10082)
* [clippy: add new lint `octal_escapes`](https://github.com/rust-lang/rust-clippy/pull/8007)
* [clippy: allow `suboptimal_flops` in `const` functions](https://github.com/rust-lang/rust-clippy/pull/8009)
* [clippy: avoid inline hints with double backticks for `doc-markdown`](https://github.com/rust-lang/rust-clippy/pull/8011)
* [clippy: don't show `no_effect` warning on unit structs implementing `fn_once`](https://github.com/rust-lang/rust-clippy/pull/7898)
* [clippy: fix ICE on `undocumented_unsafe_blocks`](https://github.com/rust-lang/rust-clippy/pull/7988)
* [clippy: fix `manual_map` with unsafe functions](https://github.com/rust-lang/rust-clippy/pull/7968)
* [clippy: fix `needless_collect`'s tendency to suggest code requiring multiple mutable borrows of the same value.](https://github.com/rust-lang/rust-clippy/pull/7982)
* [clippy: fix behavior-changing `manual_split_once` suggestion and add new lint `needless_splitn`](https://github.com/rust-lang/rust-clippy/pull/7896)
* [clippy: fix `shadow_same` false positives for async function arguments](https://github.com/rust-lang/rust-clippy/pull/7997)
* [clippy: improve `needless_borrow` lint](https://github.com/rust-lang/rust-clippy/pull/7977)
* [clippy: improve heuristic for eagerness suggestion](https://github.com/rust-lang/rust-clippy/pull/7639)
* [clippy: fix suggestion in `option_map_or_none`](https://github.com/rust-lang/rust-clippy/pull/7971)
* [rustfmt: preserve normalized comments after last list item](https://github.com/rust-lang/rustfmt/pull/5091)

### 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](https://github.com/rust-lang/rustc-perf/issues/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](https://github.com/rust-lang/rust/issues/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](https://github.com/rust-lang/rust/issues/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](https://perf.rust-lang.org/?start=934624fe5f66ce3fb8abf0597a6deb079783335f&end=22c2d9ddbf356bcdb718e88ca6ee3665e1e42690&absolute=false&stat=instructions%3Au)

1 Regressions, 3 Improvements, 8 Mixed; 3 of them in rollups
34 comparisons made in total

[Full report here](https://github.com/rust-lang/rustc-perf/blob/master/triage/2021-11-23.md)

### Approved RFCs

Changes to Rust follow the Rust [RFC (request for comments) process](https://github.com/rust-lang/rfcs#rust-rfcs). These
are the RFCs that were approved for implementation this week:

* [Constrained Naked Functions](https://github.com/rust-lang/rfcs/pull/2972)
* [Cargo --crate-type CLI Argument](https://github.com/rust-lang/rfcs/pull/3180)

### Final Comment Period

Every week [the team](https://www.rust-lang.org/team.html) announces the
'final comment period' for RFCs and key PRs which are reaching a
decision. Express your opinions now.

### [RFCs](https://github.com/rust-lang/rfcs/labels/final-comment-period)

* *No RFCs entered final comment period this week.*

### [Tracking Issues & PRs](https://github.com/rust-lang/rust/labels/final-comment-period)

* [disposition: merge] [Stabilize some MaybeUninit behavior as const](https://github.com/rust-lang/rust/pull/90896)
* [disposition: merge] [Document setgroups call caused by std::os::unix::process::CommandExt.uid](https://github.com/rust-lang/rust/pull/90292)
* [disposition: merge] [Tracking Issue for const-initialized thread locals](https://github.com/rust-lang/rust/issues/84223)
* [disposition: merge] [Tracking Issue for NonZeroUn::is_power_of_two (feature nonzero_is_power_of_two)](https://github.com/rust-lang/rust/issues/81106)
* [disposition: merge] [Tracking Issue for #![feature(available_parallelism)]](https://github.com/rust-lang/rust/issues/74479)
* [disposition: merge] [Tracking Issue for inline assembly (asm!)](https://github.com/rust-lang/rust/issues/72016)
* [disposition: merge] [Tracking Issue for cargo report future-incompat](https://github.com/rust-lang/rust/issues/71249)

### [New RFCs](https://github.com/rust-lang/rfcs/pulls)

* RFC Update: [Clarify that RFC1520 does not permit the compiler to replace calls to Clone::clone with a memcpy](https://github.com/rust-lang/rfcs/pull/3197)

## 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](https://www.meetup.com/rust-and-c-plus-plus-in-cardiff/events/282025037)
* [November 25, 2021 | Nuremberg, DE | **Rust Nürnberg online #7** | Rust Nuremberg](https://www.meetup.com/rust-noris/events/281829098)
* [November 25, 2021 | Stuttgart, DE | **Rust-Meetup** | Rust Community Stuttgart](https://www.meetup.com/Rust-Community-Stuttgart/events/282000759)
* [November 25, 2021 | Linz, AT | **Rust Meetup Linz - 16th Edition** | Rust Linz](https://www.meetup.com/Rust-Linz/events/282093961)
* [November 30, 2021 | Dallas, TX, US | **Last Tuesday** | Dallas Rust](https://www.meetup.com/Dallas-Rust/events/jqxqwryccpbnc/)
* [November 30, 2021 | Graz, AT | **Rust and memory safety** | Rust Graz Meetup](https://www.meetup.com/Graz-Rust-Meetup/events/281955585)
* [December 7, 2021 | Buffalo, NY, US | **First Tuesdays** | Buffalo Rust Meetup](https://www.meetup.com/Buffalo-Rust-Meetup/events/281833990/)
* [December 8, 2021 | Los Gatos, CA, US | **Book #24 - Rust for Rustaceans - Chapter 1** | Los Gatos Reading Group](https://www.meetup.com/Los-Gatos-Rust-Reading-Group/events/281966245)
* [December 8, 2021 | Los Angeles, CA, US | **Rust Computer Vision Project with Geordon Worley** | Rust Los Angeles](https://www.meetup.com/Rust-Los-Angeles/events/281944671/)
* [December 8, 2021 | Stuttgart, DE | **Rust-Meetup** | Rust Community Stuttgart](https://www.meetup.com/Rust-Community-Stuttgart/events/282009864)

### North America

* [December 8, 2021 | Atlanta, GA, US | **Grab a beer with fellow Rustaceans** | Rust Atlanta](https://www.meetup.com/Rust-ATL/events/lhpkmsyccqblb/)

### Europe

* [December 3, 2021 | Moscow, RU | **Rust Con** | RustCon.ru](https://rustcon.ru)

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][community] for access.

[calendar]: https://www.google.com/calendar/embed?src=apd9vmbc22egenmtu5l6c5jbfc%40group.calendar.google.com
[community]: mailto:community-team@rust-lang.org

# Rust Jobs

**StackBlitz**

* [WebContainer Systems Engineer (Remote)](https://jobs.lever.co/stackblitz/7ccd2472-1416-4448-8642-e58e9b32e129)

**Elektron**

* [Rust Audio Developer (Gothenburg, SE)](https://www.elektron.se/rust-audio-developer/)

**tangram**

* [Rust Developer (Remote)](https://www.tangram.dev/jobs)

**Kraken**

* [Backend Engineer - Rust - Core Backend (Remote)](https://jobs.lever.co/kraken/4019a818-4a7b-46ef-9225-c53c7a7f238c)
* [Backend Engineer, Kraken Futures - Rust (Remote)](https://jobs.lever.co/kraken/fe1e07f4-6d7c-4f65-9a8f-27cf3b3fd2b1)
* [Senior Rust Engineer - Banking (Remote)](https://jobs.lever.co/kraken/2863623f-13c9-4f50-992d-7c25736a60f9)

**Maasa Labs**

* [Several Rust Engineering Positions Available](https://massa.net/jobs.html)

*Tweet us at [@ThisWeekInRust](https://twitter.com/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](https://acoup.blog/2019/06/28/collections-oaths-how-do-they-work/).
>
> 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.

– [/u/scook0 on /r/rust](https://reddit.com/r/rust/comments/qx168t/undefined_behavior_deserves_a_better_reputation/hl8koel/)

Thanks to [G. Thorondorsen](https://users.rust-lang.org/t/twir-quote-of-the-week/328/1142) for the suggestion!

[Please submit quotes and vote for next week!](https://users.rust-lang.org/t/twir-quote-of-the-week/328)

*This Week in Rust is edited by: [nellshamrell](https://github.com/nellshamrell), [llogiq](https://github.com/llogiq), [cdmistman](https://github.com/cdmistman), [ericseppanen](https://github.com/ericseppanen), [extrawurst](https://github.com/extrawurst), [andrewpollack](https://github.com/andrewpollack), [U007D](https://github.com/U007D), [kolharsam](https://github.com/kolharsam), [joelmarcey](https://github.com/joelmarcey), [marriannegoldin](https://github.com/marriannegoldin).*

*Email list hosting is sponsored by [The Rust Foundation](https://foundation.rust-lang.org/)*

<small>[Discuss on r/rust](https://www.reddit.com/r/rust/comments/r1krej/this_week_in_rust_418/)</small>
