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
- Call for testing: Cargo sparse-registry
- Announcing The RustConf PostConf UnConf
- 1.62.0 pre-release testing
Foundation
Project/Tooling Updates
- rust-analyzer changelog #135
- IntelliJ Rust Changelog #173
- Cross v0.2.2 Released
- Release-plz: release Rust packages from CI
- fmtools: Reinventing Rust formatting syntax
- Fornjot (code-first CAD in Rust) - Weekly Dev Log - 2022-W25
- This week in Databend #48: A Modern Cloud Data Warehouse for Everyone
- This week in Fluvio #37: The programmable streaming platform
- Fetch-Data: New crate to download hash-verified files if necessary
Observations/Thoughts
- Many modes: a GATs pattern
- Complexity
- Fuzzing rust-minidump for Embarrassment and Crashes – Part 2
- PrettySize 0.3 release and a weakness in rust’s type system
- Obscure Rust: reborrowing is a half-baked feature
- An Unfortunate Experience with Rust
- (Ab)using Rust traits to write silly things
- [video] Why Do Programmers Love Rust?
- [video] Day in the Life of Open Source Maintenance
- [video] RTIC: Real time concurrency on ARM Cortex-M
- [audio] What's New in Rust 1.60 and 1.61
- [audio] Zig with Andrew Kelley
- [audio] This Week in Rust - Issue 446
Rust Walkthroughs
- Rust Default Values for Maintainability
- rust-phf: the perfect hash function
- Generative metatag images in Rust
- Play Ping-Pong with Lunatic 🦀 UDP
- Markdown Blog in Rust with Tide
- Integrating a Svelte app with Rust using WebAssembly
- STM32F4 Embedded Rust at the HAL: GPIO Button Controlled Blinking
- Open Source Walk-Through with Rust & SeaORM
- [video] Rc and RefCell Smart Pointers
- [video] Microdosing Rust: Why & How to Get Started with AVR?
Miscellaneous
- Deadlock-free Mutexes and Directed Acyclic Graphs
- Call for applications: Knurling-rs Summer of Code 2022 🦀
- Memory Safety for the World’s Largest Software Project
- Linus Torvalds: Rust For The Kernel Could Possibly Be Merged For Linux 5.20
Crate of the Week
This week's crate is cap-std a std-replacement that introduces capabilities to facilitate defense-in-depth sandboxing.
Thanks to Kinrany 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
388 pull requests were merged in the last week
- LLVM on AVR: fix expanding
MOVW
for overlapping registers - work around llvm 12's memory ordering restrictions
- proc_macro/bridge: cache static spans in proc_macro's client thread-local state
- remove (transitive) reliance on sorting by
DefId
in pretty-printer - avoid an ICE and instead let the compiler report a useful error
- greatly improve error reporting for futures and generators in
note_obligation_cause_code
- improve memory ordering diagnostics
- improve suggestion for calling fn-like expr on type mismatch
- diagnostics: consider parameter count when suggesting smart pointers
- mitigate MMIO stale data vulnerability
- suggest defining variable as mutable on
&mut _
type mismatch in pats - use correct substs in enum discriminant cast
- improve
derive(Debug)
- miri:
freebsd-target-support
- miri: handle wildcard pointers in Stacked Borrows
- miri: require local annotations for local diagnostics
- miri: add
-Zmiri-report-progress
to regularly print a stacktrace of what we are executing - miri: fix ICE when const refers to extern static
- miri: make sure a thread is joined
- expand expressions where possible (RFC #2011)
- partial stabilization of "nonzero_checked_ops"
- stabilize
NonZero*
checked operations constness - add
Iterator::next_chunk
- leak
pthread_
{mutex
,rwlock
}_t
if it's dropped while locked - make
RwLockReadGuard
covariant - windows: Iterative
remove_dir_all
- portable-simd: change
Simd::splat
to not generate a loop - cargo: fetch GitHub commits by long hash more efficiently
- cargo: stabilize config-cli
- compiletest: strip debuginfo by default for mode=ui
- clippy: add
manual_rem_euclid
lint - clippy: add
cargo dev deprecate
- clippy: check for
--force-warn
in Clippy's driver run condition - clippy: fix
extra_unused_lifetimes
false positive - clippy: fix
let_undescore_lock
false-positive when binding without locking - clippy: lint
single_match
onOption
matches - clippy: suggest
pointer::cast
when possible intransmute_ptr_to_ref
- clippy: add
manual_find
lint for function return case - clippy: add
vec.capacity()
toslow_vec_initialization
detection - clippy: confirm using chain in
collapsible_span_lint_calls
- clippy:
enum_variant_names
should ignore when all prefixes are_
- clippy: new lint
manual_retain
- clippy: put parentheses around
neg_multiply
suggestion if needed - rust-analyzer: correct
target_feature
completion - rust-analyzer: fix completions for locals not working properly inside macro calls
- rust-analyzer: improve proc macro errors a bit
- rust-analyzer: completes non exhaustive variant within the defining crate
- rust-analyzer: deduplicate cfg completions
- rust-analyzer: fix
doc_links
link type - Determine link type at start
Rust Compiler Performance Triage
Overall, a positive week for compiler performance with regressions mainly being relegated to smaller issues. This can be see by the fact that 95 test cases in real world crates were improvements while regressions only happened in 22 test cases. The largest improvement was by @nnethercote where the compilation of #[derive(Debug)]
was improved. This led to an average of 1% improvement in compile times across 124 real world crate test cases.
Triage done by @rylev. Revision range: abace0..baf382
Summary:
mean | max | count | |
---|---|---|---|
Regressions 😿 (primary) |
0.6% | 2.4% | 22 |
Regressions 😿 (secondary) |
0.5% | 1.0% | 35 |
Improvements 🎉 (primary) |
-1.1% | -5.2% | 95 |
Improvements 🎉 (secondary) |
-2.3% | -10.3% | 35 |
All 😿🎉 (primary) | -0.8% | -5.2% | 117 |
3 Regressions, 3 Improvements, 4 Mixed; 5 of them in rollups 34 artifact comparisons made in total
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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
- [disposition: merge] Remove restrictions on compare-exchange memory ordering.
- [disposition: merge] ptr::copy and ptr::swap are doing untyped copies
- [disposition: merge] Tracking issue for
IntoFuture
- [disposition: merge] Implement
FusedIterator
forstd::net::[Into]Incoming
- [disposition: merge] Tracking Issue for core_ffi_c
New and Updated RFCs
Upcoming Events
Rusty Events between 2022-06-29 - 2022-07-27 🦀
Virtual
- 2022-06-29 | Stuttgart, DE | Rust Community Stuttgart
- 2022-06-30 | Linz, AT | Rust Linz
- 2022-07-05 | Austin, TX, US | WebAssembly and WasmEdge
- 2022-07-05 | Beijing, CN | WebAssembly and Rust Meetup (Rustlang)
- 2022-07-05 | Buffalo, NY, US | Buffalo Rust Meetup
- 2022-07-06 | Indianapolis, IN, US | Indy Rust
- 2022-07-07 | Charlottesville, VA, US | Charlottesville Rust Meetup
- 2022-07-09 | Virtual | Rust Game Dev
- 2022-07-13 | Boulder, CO, US | Boulder Elixir and Rust
- 2022-07-13 | Malaysia, MY | Rust Malaysia Meetup
- 2022-07-14 | Nürnberg, DE | Rust Nurnberg DE
- 2022-07-16 | Vancouver, BC, CA | Vancouver Rust
- 2022-07-19 | Sydney, NSW, AU | Rust Australia
- 2022-07-19 | Washington, DC, US | Rust DC
- 2022-07-21 | Stuttgart, DE | Rust Community Stuttgart
- 2022-07-31 | Seattle, WA, US | Seattle Rust Meetup
Asia
- 2022-07-04 | Tel Aviv, IL | Rust TLV
Europe
- 2022-06-29 | Nijmegen, NL | Rust Nederland
- 2022-06-30 | Copenhagen, DK | Copenhagen Rust Group
- 2022-07-06 | Paris, FR | Stockly
North America
- 2022-06-29 | Austin, TX, US | Rust ATX
- 2022-07-13 | Atlanta, GA, US | Rust Atlanta
- 2022-07-14 | Columbus, IL | Columbus Rust Society
- 2022-07-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2022-07-26 | Austin, TX, US | ATX Rustaceans
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
We have made some changes to our jobs section, please see this GitHub issue for an explanation and the most current Who's Hiring thread on r/rust for job postings.
Quote of the Week
JG: mem::replace / mem::swap === Indiana Jones swapping the artifact for a bag of sand in a temple
CV: except rustc would tell Indy that's a type mismatch
JG: Yes, that would be the boulder, I assume.
Older compilers were more aggressive in error reporting.
Jake Goulding and Cuviper on the Rust Zulip
Thanks to Josh Triplett 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.
Email list hosting is sponsored by The Rust Foundation