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
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #128
- Fornjot 0.6
- Announcing the Kani Rust Verifier Project
- Slint (UI crate) weekly update -- Version 0.2.2 Release
- This week in Fluvio #32: the programmable streaming platform
- Rocket's 2nd v0.5 Release Candidate - Rocket Web Framework
- rustc_codegen_gcc: Progress Report #11
- GCC Rust Monthly Report #16 April 2022
- RepliByte - An open-source tool to seed your dev database with real data
- Introducing Crane: Composable and Cacheable Builds with Cargo and Nix
- The run-up to v1.0 for Postcard
Observations/Thoughts
- Programming languages are platforms, not products
- Introducing Rust in security research
- Xilem: an architecture for UI in Rust
- Modeling Finite State Machines with Rust | Ramnivas Laddad
- Secure computation in Rust: Using Intel's SGX instructions with Teaclave and Fortanix
- Securing Crates
- Over-Engineering A Fairly Simple Coding Challenge
- Building Rust code for my OpenWrt Wi-Fi router
- Lisp interpreter in Rust
- Demystifying Rust Embedded HAL Split and Constrain Methods
- An O(1) Generic Blog Post About Rust
Rust Walkthroughs
- Building a crawler in Rust: Crawling a JSON API
- Rust-raspberrypi-OS-tutorials: Tutorial 17 - Kernel Symbols
- Rust-raspberrypi-OS-tutorials: Tutorial 18 - Backtracing
- Parsing/Recursive Descent Parser
- Converting Integers to Floats Using Hyperfocus
- Easy Lossless Trees with Nom and Rowan
Research
- Evolving Collaboration, Dependencies, and Use in the Rust Open Source Software Ecosystem
- Modeling Interconnected Social and Technical Risks in Open Source Software Ecosystems
Miscellaneous
- Building a startup with Rust
- Decentralized cluster membership implementation in Rust
- Black Hat Rust discount: Happy 2022
- [DE] Redox OS: Ein Betriebssystem, geschrieben in Rust
- [video] Let's Code Minesweeper with Rust and WASM
- [audio] Rust Safety with Quentin Ochem and Florian Gilcher
Crate of the Week
This week's crate is enum_dispatch, a proc-macro-attribute to replace dynamic dispatch with enum dispatch to gain performance.
Thanks to David Mason 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
377 pull requests were merged in the last week
- rustc + avr = ❤️❤️ back again
- support tool lints with the
#[expect]
attribute (RFC #2383) - remove
#[rustc_deprecated]
- suggest fully qualified path with appropriate params
- report that opaque types are not allowed in impls even in the presence of other errors
- warn on unused
#[doc(hidden)]
attributes on trait impl items - use source callsite in
check_argument_types
suggestion - followups for method call error change
- don't cache results of coinductive cycle
- speed up
Token::{ident,lifetime}
- overhaul
MacArgs
- generalize "incoherent impls" impl for user defined types
- optimize
promote_consts
by caching the results ofvalidate_local
- codegen_gcc: implement more SIMD intrinsics
- codegen_gcc: use the provided pointee type in
<Builder as BuilderMethods>::load
- stabilize
bool::then_some
- add a dedicated length-prefixing method to
Hasher
- fix panic in
Path::strip_prefix
- make
sys::windows::os_str::Slice
repr(transparent)
- futures: remove
Fuse
s fromselect
, and only poll non-terminated streams - hashbrown: remove third copy operation for
RustcOccupiedEntry::insert
- cargo: extend pkgid syntax with
@
support - cargo: improve support of condition compilation checking
- cargo: when documenting private items in a binary, ignore warnings about links to private items
- rust-analyzer: remove handling of
#[rustc_deprecated]
- rust-analyzer: lower values of char and byte literals
- rust-analyzer: sort items by trait definition assist
- rust-analyzer: allow auto importing starting segments of use items
- rust-analyzer: don't show assoc. type binding completions when invalid
- rust-analyzer: fix import insertion inserting after last comment in a file
- rust-analyzer: fix panic when a macro passes a float token to another macro
- rust-analyzer: fix snippets triggering where they shouldn't
- rust-analyzer: remap float parts as integers when parsed as indices
- rust-analyzer: resolve assoc. types of supertraits in the IDE layer
- rust-analyzer: try not to invalidate state when the proc macro preference didn't change
- rust-analyzer: fix macro expansion with float tokens
- rust-analyzer: split float literal tokens at
.
to fix parsing of tuple field accesses - clippy: address
unnecessary_to_owned
false positive - clippy: create lint against unexpectedly late drop for temporaries in match scrutinee expressions
- clippy: fix
cast_lossless
to avoid warning onusize
tof64
conversion - clippy: ignore type aliases in
init_numbered_fields
- clippy: lint
empty_lint_after_outer_attr
on argumentless macros - clippy: move
only_used_in_recursion
to nursery - clippy: optionally allow
expect
andunwrap
in tests - clippy: support negative ints in
manual_range_contains
- clippy:
identity_op
false positive in front of if - rustfmt: fix
wrap_comments
breaking up type links
Rust Compiler Performance Triage
A good week: Several performance improvements, many around macro expansion. Only one regression of note, and that PR author opened an issue to follow up on it.
Triage done by @pnkfelix. Revision range: 468492c2..c51871c4
Summary:
Regressions 😿 (primary) |
Regressions 😿 (secondary) |
Improvements 🎉 (primary) |
Improvements 🎉 (secondary) |
All 😿 🎉 (primary) |
|
---|---|---|---|---|---|
count | 11 | 37 | 117 | 65 | 128 |
mean | 0.7% | 0.7% | -1.2% | -1.6% | -1.1% |
max | 1.5% | 1.9% | -6.5% | -5.2% | -6.5% |
2 Regressions, 4 Improvements, 1 Mixed; 1 of them in rollups 59 artifact comparisons made in total
See the full report for more.
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 RwLockReadGuard covariant
- [disposition: merge] Extend ptr::null and null_mut to all thin (including extern) types
- [disposition: merge] Modify MIR building to drop repeat expressions with length zero
- [disposition: merge] Tracking issue for explicit_generic_args_with_impl_trait
New and Updated RFCs
- [new] RFC: Precise Pre-release Deps
- [new] Rolling co-lead roles for T-compiler
- [new] RFC: extended_hrtbs
- [new] Deprecating UnwindSafe
Upcoming Events
Rusty Events between 2022-05-11 - 2022-06-08 🦀
Virtual
- 2022-05-11 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-05-11 | Malaysia, MY | Rust Malaysia Meetup
- 2022-05-12 | Nürnberg, DE | Rust Nurnberg DE
- 2022-05-12 | San Diego, CA, US | San Diego Rust
- 2022-05-12 | Stuttgart, DE | Rust Community Stuttgart
- 2022-05-17 | Washington, DC, US | Rust DC
- 2022-05-18 | Philadelphia, PA, US | Rust Philly (Rust Philadelphia)
- 2022-05-18 | Vancouver, BC, CA | Vancouver Rust
- 2022-05-24 | Berlin, DE | OpenTechSchool Berlin
- 2022-05-24 | San Francisco, CA, US | Rust Bay Area
- 2022-05-25 | Stuttgart, DE | Rust Community Stuttgart
- 2022-06-01 | Indianapolis, IN, US | Indy Rust
- 2022-06-01 | Philadelphia, PA, US | Rust Philly (Rust Philadelphia)
- 2022-06-07 | Buffalo, NY, US | Buffalo Rust Meetup
- 2022-06-08 | Boulder, CO, US | Boulder Elixir and Rust
North America
- 2022-05-11 | Atlanta, GA, US | Rust ATL
- 2022-05-12 | Columbus, OH, US | Columbus Rust Society
- 2022-05-17 | Austin, TX, US | Rust ATX
- 2022-05-17 | San Francisco, CA, US | San Francisco Rust Study Group
- 2022-05-24 | San Francisco, CA, US | Rust Bay Area
- 2022-06-08 | Atlanta, GA, US | Rust ATL
Europe
- 2022-05-17 | Stuttgart, DE | Rust Community Stuttgart
- 2022-05-18 | Stockholm, SE | Stockholm Rust
- 2022-05-19 & 05-20 | Berlin, DE | Entwickler.de
- 2022-05-24 | Amsterdam, NL | Rust Developers Amsterdam Group
Oceania
- 2022-05-26 | Brisbane City, QL | Rust Brisbane
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
Element
NXLog
Quickwit
Timescale
Enso
Estuary
- Developer Evangelist (New York, NY, US, Columbus, OH, US, or Remote)
- Senior Backend Engineer (New York, NY, US, Columbus, OH, US, or Remote)
Stockly
- Technical Engineer - Product Specialist (Paris, FR)
- Back-end developer - Engine (Rust, gRPC, PostgreSQL) (Paris, FR)
Kraken
- Engineering Manager - Rust - Core Backend (Remote)
- Backend Engineer - Rust - Core Backend (Remote)
- Backend Engineer, Kraken Futures - Rust (Remote)
Tempus Ex
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
At Cloudflare we have big Rust projects/teams and onboard new developers regularly.
There is a learning curve. Rust is rigid and unforgiving, and noobs need assistance when the compiler says “no” (although error messages and Clippy do a good job for common mistakes).
However, the big upside is that noobs can contribute safely to Rust projects. Rust limits severity of the damage an inexperienced programmer can cause. Once they manage to get the code to compile, it already has lots of correctness guarantees. “Bad” Rust code may just clone more than strictly necessary, or write 10 lines of code for something that has a helper method in the stdlib, but it won’t corrupt memory or blindly run the happy path without checking for errors. Rust prefers to be locally explicit, so it’s also easy to review.
– Kornel.Lesiński on lobste.rs
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.
Email list hosting is sponsored by The Rust Foundation