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
Official
Foundation
- Project Grants Application Deadline Extended to November 7, 2022
- Q3 2022 Recap: A summary from Rebecca Rumbul
Project/Tooling Updates
- Announcing async-backtrace
- This Month in hyper: October 2022
- rust-analyzer changelog #153
- rustc_codegen_gcc: Progress Report #17
- From Fuzzing to Proof: Using Kani with the Bolero Property-Testing Framework
- dfdx v0.10.0 - deep learning now with even more const generic goodness
- SeaQuery 0.27.0 - A dynamic query builder for SeaORM
- Slint 0.3.1 - GUI framework in Rust
- headtail: head & tail simultaneously, written in Rust
Observations/Thoughts
- Mini-post: the role of Rust's teams
- Do we need a "Rust Standard"?
- Rustdoc doctests need fixing
- Ranged integers
- Ranged integers via subtypes
- The stable HashMap trap
- Const Syntax
- How to speed up the Rust compiler in October 2022
- Speeding up the Rust compiler without changing its code
- Exploring technologies at Weborama: The Rust language
- Lock-free webserver using channels in Rust
- [video] A Cellular Automaton with Rust and Bevy - Diemo Heuer
- [video] AMD Hypervisor with Rust - Matthias Heiden
- [video] Boxes, Heaps, and Stacks - Tim McNamara
- [video] Rustberry Pi: Baby-steps in Embedded Rust - Lisa Passing
- [video] Workshop: Rust for Artists - Lisa Passing
- [video] Intro to Tower and the Service Trait - Stefan Baumgartner
- [video] Rust Before Main - Ryan Levick
- [video] How does the detour crate work?
Rust Walkthroughs
- Implementing Rayon’s Parallel Iterators
- Tower, Episode 1: your Service as a Function
- Rust microservices in server-side WebAssembly
- 4 Simple Steps for Creating a Platform Agnostic Driver in Rust
- [video] Work on gpu library
- Fathomable Rust Macros
- Property-Based Testing in Rust with Arbitrary
Research
- Static Information Flow Control Made Simpler
- Unsafe's Betrayal: Abusing Unsafe Rust in Binary Reverse Engineering toward Finding Memory-safety Bugs via Machine Learning
Miscellaneous
Crate of the Week
This week's crate is type_description, a crate to make types discoverable for users by explaining them in a way that a user can understand without knowing implementation details.
Thanks to musicmatze 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.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
433 pull requests were merged in the last week
- add a tier 3 target for the Sony PlayStation 1
- add flag to forbid recovery in the parser
- allow
impl Fn() -> impl Trait
in return position - prevent foreign Rust exceptions from being caught
- add diagnostic for calling a function with the same name with unresolved Macro
- add suggestions for unsafe impl error codes
- change terminology for assoc method suggestions when they are not called
- diagnostic derives: allow specifying multiple alternative suggestions
- diagnostics: do not suggest static candidates as traits to import
- emit a nicer error on
impl Self {
- emit proper error when casting to
dyn*
- enable varargs support for calling conventions other than C or cdecl
- even nicer errors from
assert_unsafe_precondition
- filter candidates in pick probe for diagnostics
- fix
unreachable_pub
suggestion for enum with fields - name the
impl Trait
in region bound suggestions - remap early bound lifetimes in return-position
impl Trait
in traits too - remove extra type error after missing semicolon error
- libtest: do fewer passes and generally be more efficient when filtering tests
- libtest: sort tests at compile time, not at startup
- suggest type annotation for local statement initialed by ref expression
- miri: implement
ptr_mask
intrinsic - miri: implement thread parking for Windows
- miri: stacked Borrows: make scalar field retagging the default
- miri: support timeouts with monotonic clocks even when isolation is enabled
- miri: test on windows-gnu target
- use
br
instead ofswitch
in more cases - perf improvements for effective visibility calculating
- introduce UnordMap, UnordSet, and UnordBag (MCP 533)
- llvm-16: don't initialize removed legacy passes
- codegen_gcc: add missing register class conversion for inline asm
- codegen_gcc: fix gcc build instructions
- make
CStr::from_ptr
const
- make
core::mem::copy
const
poll_fn
and Unpin: fix pinning- stabilize
Option::unzip()
- stabilize
arbitrary_enum_discriminant,
take 2 - stabilize
duration_checked_float
- simd: vectors of pointers
- stdarch: fix undefined behavior in SSE4.2 test
- cargo: add Accept-Encoding request header to enable compression
- cargo: fix confusing error messages when using
-Zsparse-registry
- cargo: improve the error message if
publish
isfalse
or empty list - cargo: report crate size on package and publish
- rustdoc: add support for incoherent impls on structs and traits
- rustdoc: do not filter out cross-crate
Self: Sized
bounds - rustdoc: don't mark
Box<T>
asIterator
,Read
, etc - clippy:
bool_to_int_with_if
do not lint in const context - clippy:
option_if_let_else
do not lint if any arm has guard - clippy:
question_mark
don't lint onif let Err
withelse
- clippy:
use_self
fix FP when trait impl defined in macro - clippy:
use_self
fix suggestion when full path to struct was given - clippy: add lint for confusing use of
^
instead of.pow
- clippy: add lint to tell about the
let else
pattern - clippy: add new lint
seek_to_start_instead_of_rewind
- clippy: add new lint
seek_from_current
- clippy: ensure
new_ret_no_self
is not fired ifimpl Trait<Self>
is returned - clippy: fix
bool_to_int_with_if
false positive withif let
- clippy: fix
needless_borrow
false positive & fix anotherneedless_borrow
false positive - clippy: fix the
string-extend-chars
suggestion on slice - clippy: make ignored internally mutable types for
mutable-key
configurable - clippy: move
uninlined_format_args
to pedantic - clippy: remove note mentioning configuration changes need cargo clean
- clippy: warn when
clippy::restriction
is enabled via the command line - rust-analyzer: clicking the status bar item stops and starts the server
- rust-analyzer: type inference for generic associated types
- rust-analyzer: disregard type variable expectation for if expressions
- rust-analyzer: don't respond with an error when requesting a shutdown while starting
- rust-analyzer: fix standard flycheck command not being executed in the workspace it is being invoked for
- rust-analyzer: test all generic args for trait when finding matching impl
Rust Compiler Performance Triage
Noise continues to make triaging a bit tedious. We've become good at identifying noise, but we may need to invest in trying to reduce it or automate some of the triaging needed to identify it. In terms of performance, this week ending up being positive albeit with improvements only outweighing regressions by a little. Some of the largest improvements were in reverts of previous regressions as well.
Triage done by @rylev. Revision range: 629a414d..822f8
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.7% | [0.2%, 7.9%] | 28 |
Regressions ❌ (secondary) |
1.7% | [0.2%, 7.0%] | 97 |
Improvements ✅ (primary) |
-1.2% | [-4.6%, -0.2%] | 73 |
Improvements ✅ (secondary) |
-1.3% | [-2.6%, -0.3%] | 61 |
All ❌✅ (primary) | -0.4% | [-4.6%, 7.9%] | 101 |
13 Regressions, 9 Improvements, 5 Mixed; 9 of them in rollups 41 artifact comparisons made in total
See full report for details.
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:
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.
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] Add lang-team advisors team
- [disposition: merge] Support upcasting of dyn Trait values
- [disposition: close] Short Macro Invocation Syntax: m!123 and m!"abc"
- [disposition: merge] crates.io token scopes
Tracking Issues & PRs
- [disposition: merge] Use
token::Lit
inast::ExprKind::Lit
. - [disposition: merge] Make
Sized
coinductive, again - [disposition: merge] Stabilize const char convert
New and Updated RFCs
- [new] Add
exhaustive_match_output
RFC - [new] Update the RFC template
- [new] Style evolution
- [new] MaybeDangling
Upcoming Events
Rusty Events between 2022-11-02 - 2022-11-30 🦀
Virtual
- 2022-11-02 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2022-11-02 | Virtual (Redmond, WA, US / San Francisco, SF, US / New York, NY, US / Toronto, CA / London, UK) | Microsoft Reactor Redmond
- 2022-11-08 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2022-11-08 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-11-08 | Virtual (Rostock, DE) | Altow Academy
- 2022-11-08 | Virtual (Stockholm, SE) | Func Prog Sweden
- 2022-11-09 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2022-11-09 | Virtual (Darmstadt, DE) | betterCode
- 2022-11-09 | Virtual (Malaysia, MY) | Rust Malaysia
- 2022-11-10 | Virtual (Budapest, HU) | HWSW free!
- 2022-11-10 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2022-11-12 | Virtual | Rust GameDev
- 2022-11-15 | Virtual (Nairobi, KE / New York, NY, US)| Data Umbrella Africa
- 2022-11-15 | Virtual (Washington, DC, US) | Rust DC
- 2022-11-16 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2022-11-17 | Virtual (Amsterdam, NL) | ITGilde Tech-Talks
- 2022-11-17 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2022-11-21 | Virtual (Paris, FR) | Meetup Paris - École Supérieure de Génie Informatique (ESGI)
- 2022-11-24 | Virtual (Linz, AT) | Rust Linz
- 2022-11-29 | Virtual (Dallas, TX, US) | Dallas Rust
- 2022-11-30 | Virtual (Munich, DE) | Rust Munich
Asia
- 2022-11-08 | Bangkok, TH | Tech@Agoda
Europe
- 2022-11-16 | Paris, FR | Stockly
- 2022-11-23 | Bratislava, SK | Bratislava Rust Meetup Group
- 2022-11-24 | København, DK | Copenhagen Rust Group
- 2022-11-30 | Amsterdam, NL | Rust Nederland
- 2022-11-30 | Munich, DE + Virtual | Rust Munich
North America
- 2022-11-10 | Columbus, OH, US | Columbus Rust Society
- 2022-11-15 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2022-11-09 | Sydney, NSW, AU | Rust Sydney
- 2022-11-22 | Canberra, ACT, AU | Canberra Rust User Group
South America
- 2022-11-05 | São Paulo, SP, BR | Rust São Paulo Meetup
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
I'm getting more convinced that Rust code is generally going to end up faster than C++ code every day I work on optimizations.
Strong immutability and no-alias guarantees are a game-changer and we've only really begun to scratch the surface of what can be done.
llogiq is exceedingly pleased with his 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