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? Tag us at @ThisWeekInRust on X(formerly Twitter) or @ThisWeekinRust on mastodon.social, or send us a pull request. Want to get involved? We love contributions.
This Week in Rust is openly developed on GitHub and archives can be viewed at this-week-in-rust.org. If you find any errors in this week's issue, please submit a PR.
Want TWIR in your inbox? Subscribe here.
Updates from Rust Community
Newsletters
Project/Tooling Updates
- Zed: Linux when? Linux now.
- r3bl_terminal_async v0.5.4 released
- r3bl_test_fixtures v0.0.1 released
- 📦 Cratery, a lightweight private cargo registry with batteries included, built for organisations, is now open-source
Observations/Thoughts
- The missing parts in Cargo
- How HappyLock Works
- Implementing a generic range parser in Rust
- [video] My favorite Rust design pattern
- [audio] Fusion Engineering with Jakub Valtar
- [audio] On the Road: RustNL & Oxidize
Rust Walkthroughs
- Global Registration
- Gray-Scott with Rust
- How to make Rust Desktop App with Egui and ChatGPT
- Writing eBPF Tracepoint Program with Rust Aya: Tips and Example
- Surprises with Rust's
as
(and Python division) - Build with Naz : Box and Pin exploration in Rust
- How to organize large Rust codebases
- Playing guitar tablatures in Rust
Research
- An Empirical Study of Rust-for-Linux: The Success, Dissatisfaction, and Compromise
- Bringing Rust to Safety-Critical Systems in Space
Miscellaneous
Crate of the Week
This week's crate is cargo-wizard, a cargo subcommand that applies profile and config templates to your Cargo project to configure it for maximum performance, fast compile times or minimal binary size.
Thanks to Jakub Beránek for the suggestion!
Please submit your suggestions and votes for next week!
Calls 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:
RFCs
- No calls for testing were issued this week.
Rust
- No calls for testing were issued this week.
Rustup
- No calls for testing were issued 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.
Call for Participation; projects and speakers
CFP - Projects
Always wanted to contribute to open-source projects but did not 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.
No Calls for participation were submitted this week.
If you are a Rust project owner and are looking for contributors, please submit tasks here or through a PR to TWiR or by reaching out on X (Formerly twitter) or Mastodon!
CFP - Events
Are you a new or experienced speaker looking for a place to share something cool? This section highlights events that are being planned and are accepting submissions to join their event as a speaker.
No Calls for papers or presentations were submitted this week.
If you are an event organizer hoping to expand the reach of your event, please submit a link to the website through a PR to TWiR or by reaching out on X (Formerly twitter) or Mastodon!
Updates from the Rust Project
385 pull requests were merged in the last week
- add AMX target-features and
x86_amx_intrinsics
feature flag - add
constness
toTraitDef
- add classify and related methods for f16 and f128
- add lint for inline asm labels that look like binary
- add suggestions for possible missing
fn
, struct, or enum
keywords - added the
xop
target-feature and thexop_target_feature
feature gate - allows
#[diagnostic::do_not_recommend]
to supress trait impls in suggestions as well - automatically taint when reporting errors from ItemCtxt
- avoid "no field" error and ICE on recovered ADT variant
- avoid follow-up errors and ICEs after missing lifetime errors on data structures
- check
is_ident
beforeparse_ident
- clear
inner_attr_ranges
regularly - consolidate region error reporting in
rustc_infer
- coverage: restrict
ExpressionUsed
simplification toCode
mappings - ensure floats are returned losslessly by the Rust ABI on 32-bit x86
- fire
unsafe_code
lint on unsafe extern blocks - fix
DebugParser
- fix import suggestion ice
- fix incorrect NDEBUG handling in LLVM bindings
- fix interleaved output in the default panic hook when multiple threads panic simultaneously
- fix regression in the MIR lowering of or-patterns
- gate the type length limit check behind a nightly flag
- generalize
fn allocator
for Rc/Arc - generalize search graph to enable fuzzing
- guard against calling
libc::exit
multiple times on Linux - implement simple, unstable lint to suggest turning closure-of-async-block into async-closure
- instantiate higher ranked goals in candidate selection again
- make
visit_clobber
's impl safe - make parse error suggestions verbose and fix spans
- make sure that labels are defined after the primary span in diagnostics
- mark
builtin_syntax
as internal - migration lint for
expr2024
for the edition 2024 - more suggestion for converting
Option<&Vec<T>>
toOption<&[T]>
- more trait error reworking
- only track mentioned places for jump threading
- suggest borrowing on fn argument that is
impl AsRef
- suggest using
map_or
whenOption<&T>::unwrap_or where T: Deref
fails - suggest using precise capturing for hidden type that captures region
- use verbose style when suggesting changing
const
withlet
- miri: TB: reserved + Protected + IM + lazy is a horrible combination that should not exist
- miri: implement support for multiple TLS destructors on macOS
- miri: implement the
os_unfair_lock
functions on macOS - fix
Parser::look_ahead
- stabilize
const_cstr_from_ptr (CStr::from_ptr, CStr::count_bytes)
- stabilize
io_slice_advance
- stabilize const unchecked conversion from u32 to char
- add
f16
andf128
as simd types in LLVM - add cache for
allocate_str
offset_from
: always allow pointers to point to the same address- std:
#![deny(unsafe_op_in_unsafe_fn)]
in platform-independent code - std: removes logarithms family function edge cases handling for solaris
- impl FusedIterator and a size hint for the error sources iter
- use
pidfd_spawn
for faster process spawning when a PidFd is requested - make os/windows and pal/windows default to
#![deny(unsafe_op_in_unsafe_fn)]
- windows: add experimental support for linking std-required system DLLs using raw-dylib
- windows: remove some unnecessary type aliases
- exposing STARTUPINFOW.wShowWindow in CommandExt trait
- cargo:
docs(ref)
: Note MSRV for features in the docs - cargo: add
cargo_test
to test-support prelude - cargo: overrides: Don't warn on duplicate packages from using '..'
- cargo: source: Don't warn about unreferenced duplicate packages
- cargo: test: Redact elapsed time in the minutes time frame
- cargo: test: Reduce over-prescription to the caller
- cargo: add workflow to publish Cargo automatically
- cargo: fix: ensure dep/feature activates the dependency on 2024
- cargo: fix: rename to
rustdoc::broken_intra_doc_links
- cargo: refactor: move
get_source_id
out of registry - clippy:
unwrap_or_default
: skip warning when calling inside of suggested method's implementation - clippy: add more doc-valid-idents
- clippy: fix
manual_unwrap_or
false positive - clippy: fix
needless_option_as_deref
false-positive onstruct
literals - clippy: fix and rename
overflow_check_conditional
- clippy: fix guidance of
float_cmp
andfloat_cmp_const
to not incorrectly recommendf__::EPSILON
as the error margin - clippy: make
or_fun_call
recursive - clippy: fix
doc_lazy_continuation
lints - rust-analyzer: add
f16
andf128
support - rust-analyzer: encode ident rawness and literal kind separately in
tt::Leaf
- rust-analyzer: add incorrect case diagnostics for
enum
variant fields and all variables/params - rust-analyzer: add inlay hints for generic parameters
- rust-analyzer: do not add new
enum
if it already exists - rust-analyzer: fix incorrect encoding of literals in the proc-macro-api on version 4
- rust-analyzer: implement symbol interning infra
- rust-analyzer: trigger VSCode to rename after extract variable assist is applied
- rustfmt: impl
StyleEditionDefault
trait for all configs - rustfmt: return RewriteResult for
rewrite_block
andrewrite_closure
Rust Compiler Performance Triage
Fairly quiet week with the only pure regressions being small and coming from correctness fixes. The biggest single change came from turning off the -Zenforce-type-length-limit
check which had positive impacts across many different benchmarks since the compiler is doing strictly less work.
Triage done by @rylev. Revision range: a2d58197..5572759b
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.3% | [0.2%, 0.7%] | 12 |
Regressions ❌ (secondary) |
0.4% | [0.2%, 0.9%] | 45 |
Improvements ✅ (primary) |
-0.7% | [-1.5%, -0.2%] | 37 |
Improvements ✅ (secondary) |
-3.3% | [-13.5%, -0.4%] | 21 |
All ❌✅ (primary) | -0.4% | [-1.5%, 0.7%] | 49 |
2 Regressions, 3 Improvements, 2 Mixed; 1 of them in rollups 56 artifact 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:
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
Rust
- [disposition: merge] Fix supertrait associated type unsoundness
- [disposition: merge] Graciously handle
Drop
impls introducing more generic parameters than the ADT - [disposition: merge] Reorder trait bound modifiers after
for<...>
binder in trait bounds - [disposition: merge] size_of_val_raw: for length 0 this is safe to call
- [disposition: merge] Implement lint against ambiguous negative literals
Cargo
- No Cargo Tracking Issues or PRs entered Final Comment Period this week.
Language Team
- No Language Team Tracking Issues or PRs entered Final Comment Period this week.
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline Tracking Issues or PRs entered Final Comment Period this week.
New and Updated RFCs
- [new] RFC for project goals
Upcoming Events
Rusty Events between 2024-07-17 - 2024-08-14 🦀
Virtual
- 2024-07-17| Virtual (Cardiff, UK)| Rust and C++ Cardiff
- Rust for Rustaceans Book Club: Chapter 10: Concurrency (and Parallelism)
- 2024-07-17 | Hybrid - Virtual and In-person (Vancouver, BC, CA) | Vancouver Rust
- 2024-07-18 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-07-18 | Virtual (IL) | Rust in Israel
- 2024-07-18 | Virtual (Rotterdam, NL)| Bevy Game Development
- 2024-07-23 | Hybrid - Virtual and In-Person (München/Munich, DE) | Rust Munich
- 2024-07-24 | Virtual | Women in Rust
- 2024-07-25 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-07-27 | Hybrid - Virtual and In-Person (Kyiv, UA) | UA Rust
- 2024-07-27 | Virtual | Leptos Monthly Meetup
- 2024-07-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-07-31 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-01 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-08-06 | Virtual | Women in Rust
- 2024-08-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2024-08-06 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-08-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-08-08 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-08-08 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-08-13 | Virtual (Dallas, TX, US) | Dallas Rust
Africa
- 2024-08-02 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-07-20 | Bangalore/Bengaluru, IN | Rust Bangalore
Europe
- 2024-07-17 | Cambridge, UK | Cambridge Rust Meetup
- 2024-07-18 | Bern, CH | Rust Bern
- 2024-07-23 | Manchester, UK | Rust Manchester
- 2024-07-23 | Hybrid - Virtual and In-Person (München/Munich, DE) | Rust Munich
- 2024-07-25 | Augsburg, DE | Rust Meetup Augsburg
- 2024-07-25 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-07-27 | Hybrid - Virtual and In-Person (Kyiv, UA) | UA Rust
- 2024-07-30 | Basel, CH | Rust Basel
- 2024-08-14 | Reading, UK | Reading Rust Workshop
North America
- 2024-07-17 | Hybrid - Vancouver, BC, CA | Vancouver Rust
- 2024-07-18 | Nashville, TN, US | Music City Rust Developers
- 2024-07-18 | Seattle, WA, US | Seattle Rust User Group
- 2024-07-21 | Boston, MA, US | Boston Rust Meetup
- 2024-07-24 | Austin, TX, US | Rust ATC
- 2024-07-25 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-07-29 | Cambridge, MA, US| Boston Rust Meetup
- 2024-08-01 | St. Louis, MO, US | STL Rust
- 2024-08-08 | Mountain View, CA, US | Mountain View Rust Meetup
Oceania
- 2024-08-01 | Brisbane, QLD, AU | 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.
Jobs
Please see the latest Who's Hiring thread on r/rust
Quote of the Week
I have a dream. A dream that Cargo has its own release cadence, so it is free from the strict stability curse and can then ship major version releases.
Thanks to Brian Kung 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