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
- rust-analyzer changelog #152
- IntelliJ Rust Changelog #181
- mirrord 3.0 is out!
- gix credential and diffing with similar
- New release – gtk-rs
- Zellij 0.32.0: YAML => KDL, actions through CLI, command panes and a new layout system
- RPITs, RPITITs and AFITs and their relationship
- Evaluating Build Scripts in the IntelliJ Rust Plugin
Observations/Thoughts
- Adding Ada to Rust
- Adding a JavaScript interpreter to your Rust project
- Rust in the Linux Kernel: Just the Beginning
- A deeper look into the GCC Rust front-end
- The HTTP crash course nobody asked for
- Making Rust attractive for writing GTK applications
- Adventures In Cross Compilation
- Compiling Brainfuck code - Part 1: A Optimized Interpreter
- Rust Embedded Graphics with the MAX7219
- Buffers on the edge: Python and Rust · Alex Gaynor
- Writing Better Integration Tests with RAII
- Contention on multi-threaded regex matching
Rust Walkthroughs
- Serde by Example 2: OpenStreetMap
- Enums and Pattern Matching in Rust
- Creating a minimal RESTful song request API using Rocket
- Compiling Rust libraries for Android apps: a deep dive
- Inline Crates
- Writing a HashMap in Rust without unsafe
- A Rust web app with HTML templates
- Nine Rules for Creating Procedural Macros in Rust: Practical Lessons from anyinput, a New Macro for Easily Accepting String/Path/Iterator/Array-Like Inputs
- [series] Sqlite File Parser Pt 4
- MacroKata: Rustlings style exercises for learning macros
Miscellaneous
- [video] Web-native Rust apps (what will YOU build?)
- [video] Rapid Prototyping in Rust: Write fast like Python; Run fast like C
- [video] Let our rusty crab explore the depths of the C by Yvan Sraka
- [video] Case Study: Rust in axle OS by Philip Tennen
- [video] Aya: Extending the Linux Kernel with eBPF and Rust by Michal Rostecki
- [video] Building a Lightweight IR and Backend for YJIT / Maxime Chevalier-Boisvert
- [video] RustcContributor::explore: @compiler-errors session - RPITIT deep dive
- Step-by-step guide to building a web-crawler
- SQLx in 12 minutes - Rust + Actix Web + PostgreSQL
- Bevy Basics Scenes(re-upload)
Crate of the Week
This week's crate is humantime, a parser and formatter for std::time::
{Duration
, SystemTime
}.
Thanks to Aleksey Kladov 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.
- zerocopy - Optimize caching in CI
- boa - hacktoberfest issues
- boa - bugs that cause boa to panic
- Ockam - Show "help" output when no args passed on subscription show clap command
- Ockam - Add argument to node create clap command to terminate on EOF on STDIN
- Ockam - Extract duplicated code into a shared helper function
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
398 pull requests were merged in the last week
- linker: fix weak lang item linking with combination windows-gnu + LLD + LTO
- recover when unclosed char literal is parsed as a lifetime in some positions
- allow
#[unstable]
impls for fn() with unstable abi - allow
Vec::leak
when usingno_global_oom_handling
- allow semicolon after closure within parentheses in macros
- change
unknown_lint
applicability toMaybeIncorrect
- require
Drop
impls to have the same constness on its bounds as the bounds on the struct have - require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes
- add default trait implementations for "c-unwind" ABI function pointers
- filtering spans when emitting json
- suggest let for assignment, and some code refactor
- do not suggest trivially false const predicates
- standardize "use parentheses to call" suggestions between typeck and trait selection
- escape string literals when fixing overlong char literal
- handle return-position
impl Trait
in traits properly inregister_hidden_type
- improve "
~const
is not allowed here" message - add diagnostic for calling a function with the same name with unresolved Macro
- chalk: consider ADT's generic parameters
- miri: fix ICE when trying to GC a Stack with an unknown bottom
- miri: add
scalar-abi-only
field retagging option - erase regions before checking for
Default
in uninitialized binding error - introduce deduced parameter attributes, and use them for deducing
readonly
on indirect immutable freeze by-value function parameters - let expressions on RHS shouldn't be terminating scopes
- make diagnostic for unsatisfied
Termination
bounds more precise - make
order_dependent_trait_objects
show up in future-breakage reports - reduce false positives in msys2 detection
- enable LTO for
rustc_driver.so
- remove byte swap of valtree hash on big endian
- remove more attributes from metadata
- use Set instead of Vec in
transitive_relation
- sort tests at compile time, not at startup
- use already checked RHS ty for LHS deref suggestions
- stabilize
proc_macro::Span::source_text
- stabilize
duration_checked_float
- stabilize
asm_sym
- make transpose const and inline
- mark
std::os::wasi::io::AsFd
etc. as stable - eliminate 280-byte memset from
ReadDir
iterator - optimize
slice_iter.copied().next_chunk()
- implement
String::leak
- adjust argument type for mutable
with_metadata_of
- hashbrown: add support for 16-bit targets
- futures: do not store items field in
ReadyChunks
- cargo: fix publishing with a dependency on a sparse registry
- cargo: improve the error message if
publish
isfalse
or empty list - cargo: publish: check remote git registry more than once post-publish
- rustdoc: eliminate uses of
EarlyDocLinkResolver::all_traits
- rustdoc: do not filter out cross-crate
Self: Sized
bounds - crates.io: introduce daily limit of published versions per crate
- docs.rs: perf: change the link in the topbar to avoid a redirect
- bindgen: avoid suppressing panic messages
- bindgen: use panic hooks instead of using
catch_unwind
- clippy: add
missing_trait_methods
lint - clippy: add lint to tell about let else pattern
- clippy: enable test
no_std_main_recursion
- clippy: fix
allow_attributes_without_reason
applying to external crate macros - clippy: fix ICE due to out-of-bounds array access
- clippy: improvement for
equatable_if_let
- clippy:
collapsible_match
specify field name when destructuring structs - clippy:
unwrap_used
,expect_used
do not lint intest
cfg - clippy:
ref_option_ref
do not lint when inner reference is mutable - clippy: add
from_raw_with_void_ptr
lint - clippy: fix
box-default
ignoring trait objects' types - clippy: support
map_or
foror_fun_call
lint - rust-analyzer: support const generics for builtin derive macro
- rust-analyzer: workaround the python vscode extension's polyfill
- rust-analyzer: add multiple getters mode in
generate_getter
- rust-analyzer: don't catch the server activation error
- rust-analyzer: don't respond with an error when requesting a shutdown while starting
- rust-analyzer: fix
DidSaveDocument
requests blocking the server on startup - rust-analyzer: fix standard flycheck command not being executed in the workspace it is being invoked for
- rust-analyzer: handle multiple projects sharing dependency correctly in
once
strategy
Rust Compiler Performance Triage
An amazing week. We saw more wins than losses; I want to call out specifically the wins from removing attributes from metadata (up to 8.2% faster builds for 18 benchmarks) and from enabling LTO for rustc_driver.so (up to 9.6% faster builds for an epic 230 benchmarks, with zero regressions).
Triage done by @pnkfelix. Revision range: e0f8e60d..629a414d
2 Regressions, 6 Improvements, 2 Mixed; 2 of them in rollups 53 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:
- No RFCs issued a call for testing this week.
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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error
- [disposition: merge] Elaborate supertrait obligations when deducing closure signatures
- [disposition: merge] Tracking Issue for Integer::{ilog,ilog2,ilog10}
- [disposition: close] Propagate deref coercion into block
- [disposition: merge] Derive
Eq
andHash
forControlFlow
New and Updated RFCs
- [new] Warning on unintended implicit drops
- [new] Niches
- [new] Deprecate PhantomData dropck
Upcoming Events
Rusty Events between 2022-10-26 - 2022-11-23 🦀
Virtual
- 2022-10-26 | Virtual (Redmond, WA, US / New York, NY, US / Toronto, CA / Stockholm, SE / London, UK) | Microsoft Reactor Redmond
- 2022-10-27 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2022-10-27 | Virtual (Karlsruhe, DE) | The Karlsruhe Functional Programmers Meetup Group
- 2022-10-27 | Virtual (Linz, AT) | Rust Linz
- 2022-10-29 | Virtual (Ludwigslust, DE) | Ludwigslust Rust Meetup
- 2022-11-01 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
- 2022-11-01 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2022-11-02 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 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-02 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 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 (Malaysia, MY) | Rust Malaysia
- 2022-11-10 | Virtual (Budapest, HU) | HWSW free!
- 2022-11-12 | Virtual | Rust GameDev
- 2022-11-15 | Virtual (Washington, DC, US) | Rust DC
- 2022-11-15 | Virtual (Nairobi, KE / New York, NY, US)| Data Umbrella Africa
- 2022-11-16 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2022-11-17 | Virtual (Amsterdam, NL) | ITGilde Tech-Talks
- 2022-11-21 | Virtual (Paris, FR) | Meetup Paris - École Supérieure de Génie Informatique (ESGI)
Asia
- 2022-11-08 | Bangkok, TH | Tech@Agoda
Europe
- 2022-10-26 | London, UK | Rust London User Group
- 2022-10-26 | Bristol, UK | Rust and C++ Cardiff/Rust Bristol
- 2022-10-27 | København, DK | Copenhagen Rust Group
- 2022-11-23 | Bratislava, SK | Bratislava Rust Meetup Group
North America
- 2022-10-27 | Lehi, UT, US | Utah Rust
- 2022-11-10 | Columbus, OH, US | Columbus Rust Society
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
Also, I don't know how much of this is because Rust is special or because BurntSushi is a national treasure and his CSV library is impeccably constructed and documented.
Thanks to scottmcm 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, mariannegoldin, bennyvasquez.
Email list hosting is sponsored by The Rust Foundation