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
Project/Tooling Updates
- This week in Fluvio #7: the programmable streaming platform
- This week in Databend #10: an elastic and reliable cloud warehouse
- SixtyFPS (GUI crate) weekly update for 3rd of October 2021
- GCC Rust Monthly Report #10 September 2021
- Rust Analyzer Changelog #97
- Amethyst – Starting fresh
Research and Papers
- SyRust: automatic testing of Rust libraries with semantic-aware program synthesis
- Verification for dummies: SMT and Induction using the mikino model-checker
- Does the Bronze Garbage Collector Make Rust Easier to Use? A Controlled Experiment
Newsletters
Observations/Thoughts
- Does the published crate match the upstream source?
- What Rust could learn from Kotlin
- Plugins in Rust: Diving into Dynamic Loading
- Measuring power consumption: sync vs. async
- Using Rust for kernel development
- Spark and Rust - How to Build Fast, Distributed and Flexible Analytics Pipelines with Side Effects
- So You Want to Rust the Linux Kernel?
- [ZH] Rust Web Eco Watch| SeaORM: To be the Rust version of ActiveRecord
- [video] Talks from Rust Computer Vision Meetup 2021-09-29 (YouTube playlist)
- [video] Rust v.s Java 17 Pattern Matching
- [audio] Gleam with Louis Pilfold
Rust Walkthroughs
- Giving Your JSON a Web API with Rust
- Exporting Test Mocks Across Crates
- Writing dockerfile in rust project
- Rust crimes: Enum ints
- Scalable server design in Rust with Tokio
- Running Rust on AWS Lambda on ARM64
- How to deploy a Rust REST API application on AWS with ease
- [PT] Rust - Borrowing?
- [series] Build Your Text Editor With Rust!
- [video] Building a Reddit Ticker with Rust and Flutter using Rid and Bloc/Cubit
- [video] Pattern Syntax in Rust
Crate of the Week
This week's crate is pubgrub, a Rust implementation of the state of the art version solving algorithm.
Thanks to Louis Pilfold 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.
- This Week in Rust is looking for additional editors
- Veloren will be participating in Hacktoberfest 2021!
- RustFest - Introducing Rust in Arts
- caniuse.rs - Data to add
- cargo - Help Wanted Issues
ockam
- Implement IntoIterator/FromIterator for AddressSet
- Split Context methods accepting
Into<T>
generics up to improve compile time and binary size
jsonschema-rs
- Implement unevaluatedProperties
- Implement unevaluatedItems
- Implement dependentRequired & dependentSchemas
- Python: Add an iterator over validation errors
Updates from the Rust Project
266 pull requests were merged in the last week
- make const (), mut () okay for FFI
- resolve: cache module loading for all foreign modules
- improve error message for missing angle brackets in
[_]::method
- avoid nondeterminism in
trimmed_def_paths
- improve error message for printf-style format strings
- pick one possible lifetime in case there are multiple choices
- suggest using the path separator for tuple struct
- suggest similarly named associated items in trait impls
- improve cause information for NLL higher-ranked errors
- hide
<...> defined here
note if the source is not available - fix incorrect disambiguation suggestion for associated items
- fix unsound optimization with explicit variant discriminants
- don't anonymize bound region names during typeck
- pass real crate-level attributes to
pre_expansion_lint
- use larger span for adjustment THIR expressions
- coerce const FnDefs to implement const Fn traits
- constify ?-operator for
Result
andOption
- partially stabilize
array_methods
- avoid spurious "previous iteration of loop" errors
- include the length in
BTree
hashes - optimize unnecessary check in
Vec::retain
VecDeque
: improve performance forFrom<[T; N]
>- optimize
is_sorted
forRange
andRangeInclusive
- [optimize
str::from_utf8()
validation when slice contains multibyte chars andstr.chars().count()
in all * Fixread_to_end
to not grow an exact size buffer - make
<[T]>::split_at_unchecked
and<[T]>::split_at_mut_unchecked
public - mark unsafe methods
NonZero*::unchecked_
{add
,mul
} as const - const fn for
Option::
{copied
,take
,replace
} cases](https://github.com/rust-lang/rust/pull/88834) - hashbrown: relax the bounds on
HashSet
:Debug
- clippy: correctly handle signs in exponents in
numeric_literal::format()
- clippy: make
if_then_panic
handle situation ofBinOpKind::And || BinOpKind::Or
- clippy: re-write
shadow
lints - clippy: make
doc_unsafe
warn on unsafe traits as well - clippy: fix bug for
large_enum_variants
- clippy: add new 'while_let_some_result' linting
- clippy: add lint
equatable_if_let
- clippy: fix ICE in
implicit_hasher
- clippy: exclude enum from derivable impls
Rust Compiler Performance Triage
A fairly busy week, with a relatively high percentage of PRs landing with regressions and improvements. The overall trajectory is fairly neutral for this week though.
Triage done by @simulacrum. Revision range: 83f147b..25ec82
5 Regressions, 5 Improvements, 5 Mixed; 1 of them in rollups
43 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
No RFCs are currently in the final comment period.
Tracking Issues & PRs
- [disposition: merge] Partially stabilize duration_consts_2
- [disposition: merge] Stabilize unreachable_unchecked as const fn
- [disposition: merge] Add
#[repr(i8)]
to Ordering - [disposition: merge] Fix ctrl-c causing reads of stdin to return empty on Windows.
- [disposition: merge] Tracking Issue for saturating_div
- [disposition: merge] Avoid allocations and copying in
Vec::leak
- [disposition: merge] linux/aarch64 Now() should be actually_monotonic()
- [disposition: merge] Stabilise unix_process_wait_more, extra ExitStatusExt methods
- [disposition: merge] Make all proc-macro back-compat lints deny-by-default
- [disposition: merge] Windows: Resolve process::Command program without using the current directory
- [disposition: merge] Implement RefUnwindSafe for
Rc<T>
- [disposition: merge] Reject octal zeros in IPv4 addresses
- [disposition: merge] Tracking Issue for methods to go from nul-terminated
Vec<u8>
to CString - [disposition: merge] Tracking issue for
proc_macro::is_available()
- [disposition: close] Tracking issue for
alloc::prelude
New RFCs
Upcoming Events
Online
- October 9, 2021 - Rust Gamedev Discord - Rust Gamedev Monthly Meetup
- October 12, 2021, Berlin, DE - Rust Hack and Learn - Berline.rs
- October 12, 2021, Seattle, WA, US - Monthly meetup - Seattle Rust Meetup
- October 13, 2021 - betterCode Rust
- October 13, 2021 - C++/Rust: Learning from Each Other - MUC++
- October 13, 2021, Los Angeles, CA, US - Processing shaders in Rust with Dzmitry Malyshau - Rust Los Angeles
- October 20, 2021, Buffalo, NY, US - Buffalo Rust User Group, Alternate Day - Buffalo Rust
- October 20, 2021, Vancouver, BC, CA - WASM plugin for Istio - Vancouver Rust
North America
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
Grafbase
Jigzi
pganalyze
Oso
Kraken
- Backend Engineer - Rust - Core Backend (Remote)
- Backend Engineer, Kraken Futures - Rust (Remote)
- Senior Rust Engineer - Banking (Remote)
Subspace Labs
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
There's a common trope among people unfamiliar with rust where they assume that if you use unsafe at all, then it's just as unsafe as C and rust provided no benefit. Comparing C's approach to safety vs Rust's is like comparing an open world assumption to a closed world assumption in formal logic systems. In C, you publish your api if it's possible to use correctly (open world). In Rust, you publish a safe api if it's im possible to use in correctly (closed world). Rust's key innovation here is that it enables you to build a 'bridge' from open world (unsafe) to a closed world (safe), a seemingly impossible feat that feels like somehow pairwise reducing an uncountable infinity with a countable infinity. Rust's decision to design an analogous closed-world assumption for safe code is extremely powerful, but it seems very hard for old school C programmers to wrap their head around it.
Thanks to Alice Ryhl for the suggestion!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, and cdmistman.