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 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.
Updates from Rust Community
Official
- Announcing Rust 1.78.0
- Announcing Rustup 1.27.1
- Automatic checking of cfgs at compile-time
- Announcing Google Summer of Code 2024 selected projects
- Rust participates in OSPP 2024
- This Development-cycle in Cargo: 1.79
- Rust Project Goals Submission Period
Foundation
Newsletters
- This Month in Rust OSDev: April 2024
- This Month in Rust GameDev #50 - April 2024
- RustFest.ch - All talks announced
Project/Tooling Updates
- image v0.25: performance improvements, production-ready WebP
- rust-analyzer changelog #232
- rustc_codegen_gcc: Progress Report #32
- Introducing graphql-lint and gqlint
- Meilisearch releases v1.8
- r3bl_terminal_async v0.5.2 released
- Zed Decoded: Linux when?
Observations/Thoughts
- Pair Your Compilers At The ABI Café - Faultlore
- Unwind considered harmful?
- Async Rust Complexity
- Download Accelerator - Async Rust Edition
- [video] David Lattimore - A Linker in the Wild
- [audio] curl - Daniel Stenberg, Open Source Maintainer and Public Speaker
Rust Walkthroughs
- How to rewrite a C++ codebase successfully
- Building a Redis / Kafka Data Sink in Rust
- [ZH | EN] Writing a GPT Plugin in Rust, and Lost Gems
- What is in a Rust Allocator?
- How hard can generating 1024-bit primes really be?
- STM32F4 Embedded Rust at the PAC: System Clock Configuration
- [video] Make a port scanner in #rustlang with Tokio and learn async Rust
Research
- Rust Digger: 47,764 (32.92%) of the crates include a Cargo.lock file
- VERT: Verified Equivalent Rust Transpilation with Few-Shot Learning
Miscellaneous
Crate of the Week
This week's crate is derive_more, a crate for deriving a whole lot of traits
Thanks to teor for the suggestion!
Please submit your suggestions and votes for next week!
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:
RFCs
- RFC: Make Cargo respect minimum supported Rust version (MSRV) when selecting dependencies
- Testing steps
Rustup
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.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
CFP - Speakers
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.
- EuroRust 2024| Closes 2024-06-03 | Vienna, Austria & online | Event date: 2024-10-10
- Scientific Computing in Rust 2024| Closes 2024-06-14 | online | Event date: 2024-07-17 - 2024-07-19
- Conf42 Rustlang 2024 | Closes 2024-07-22 | online | Event date: 2024-08-22
If you are an event organizer hoping to expand the reach of your event, please submit a link to the submission website through a PR to TWiR.
Updates from the Rust Project
426 pull requests were merged in the last week
- AST pretty: Use
builtin_syntax
for type ascription const_eval_select
: add tracking issuedefault_alloc_error_hook
: explain difference to default__rdl_oom
in alloc- account for immutably borrowed locals in MIR copy-prop and GVN
- add
normalize()
in run-makeDiff
type - add
rustfmt
cfg to well known cfgs list - add a lint against never type fallback affecting unsafe code
- add support for inputing via stdin with run-make-support
- adjust
#[macro_export]
/doctest help suggestion fornon_local_defs
lint - always print nice 'std not found' error when std is not found
- borrowck: prepopulate opaque storage more eagerly
- consider inner modules to be local in the
non_local_definitions
lint - deref patterns: impl
DerefPure
for more std types - don't consider candidates with no failing where clauses when refining obligation causes in new solver
- enable
--check-cfg
by default in UI tests - enable reusing CI Docker cache when running CI images locally
- fix
NormalizesTo
proof tree issue - fix unwinding on 32-bit watchOS ARM
- fix unwinding on 32-bit watchOS ARM (v2)
- generalize
adjust_from_tcx
forAllocation
- implement
do_not_recommend
in the new solver - implement
ptr_as_ref_unchecked
- improve check-cfg CLI errors with more structured diagnostics
- interpret, miri: uniform treatments of intrinsics/functions with and without return block
- interpret: drop: always evaluate place
- interpret: hide some reexports in rustdoc
- lazily normalize inside trait ref during orphan check & consider ty params in rigid alias types to be uncovered
- let miri and const eval execute intrinsics' fallback bodies
- only consider ambiguous goals when finding best obligation for ambiguities
- prefer lower vtable candidates in select in new solver
- record impl args in the proof tree
- record impl args in the proof tree in new solver
- remove redundant union check in
KnownPanicsLint
const prop - rewrite select (in the new solver) to use a
ProofTreeVisitor
- shallow resolve in orphan check
- split mcdc code to a sub module of coverageinfo
- stop
llvm.expect
ing assert terminators - support
Result<T, E>
across FFI when niche optimization can be used - tweak
consts_may_unify
- use
ObligationCtxt
in favor ofTraitEngine
in many more places - use
super_fold
inRegionsToStatic
visitor - use
tcx.types.unit
instead ofTy::new_unit(tcx)
- use a proof tree visitor to refine the
Obligation
for error reporting in new solver - miri: /miri run: support -v flag to print what it is doing
- miri: don’t print
Preparing a sysroot
when-q
/--quiet
is passed - miri: macos: use getentropy from libc
- miri: make file descriptors into refcount references
- miri: make many-seeds a mode of ./miri run rather than a separate command
- miri: only show the 'basic API common for this target' message when this is a missing foreign function
- miri: pthread shims: reorganize field offset handling, and add sanity checks
- miri: solaris: make pre-main code work
- miri: sync: better error in invalid synchronization primitive ID
- miri: tls dtors: treat all unixes uniformly
- miri: tree Borrows: first apply transition, then check protector with new 'initialized'
- miri: unix/thread: properly use
pthread_t
for thread IDs - some hir cleanups
- stabilize
exclusive_range_pattern
- stabilize
exclusive_range_pattern
(v2) - stabilize
split_at_checked
- improve several
Read
implementations - add constants for f16 and f128
- compiler builtins for
f16
/f128
float conversions - cargo lint: Warn not Error on unsupported lint tool
- cargo lints: Prevent inheritance from bring exposed for published packages
- cargo lints: Remove ability to specify
-
in lint name - cargo resolver: Treat unset MSRV as compatible
- cargo toml: Don't lose 'public' when inheriting a dep
- cargo toml: On 2024 Edition, disallow ignored
default-features
when inheriting - cargo toml: Remove unstable rejrected frontmatter syntax for cargo script
- cargo toml: Validate
crates_types/proc-macro
for bin like others - cargo toml: Avoid inferring when targets are known
- cargo clean package perf improvements
- cargo: error when unstable lints are specified but not enabled
- cargo: populate git information when building Cargo from Rust's source tarball
- cargo: stabilize
-Zcheck-cfg
as always enabled - cargo: workaround copying file returning EAGAIN on ZFS on mac OS
- rustdoc-search: search for references
- clippy: allow more attributes in
clippy::useless_attribute
- clippy: don't lint
assigning_clones
on nested late init locals - clippy: don't suggest
Box::default()
in functions with differing generics - clippy: fix
FormatArgs
storage when-Zthreads
> 1 - clippy: fix
for x in y unsafe { }
- clippy: fix suggestion error for
manual_is_ascii_check
with missing type - clippy: suggest collapsing nested or patterns if the MSRV allows it
- clippy: type safe CLI implementation for clippy-dev
- rust-analyzer: make generate function assist generate a function as a constructor if the generated function has the name "new" and is an asscociated function
- rust-analyzer: fix Run lens showing when lenses are disabled
- rust-analyzer: fix impl trait params not being counted properly
- rust-analyzer: correctly handle
no_core
/no_std
for preludes - rust-analyzer: discard path when the path is invalid
- rust-analyzer: fix implicit ty args being lowered where they shouldn't
- rust-analyzer: implement creating generics for impl traits in associated types
- rust-analyzer: lifetime's Bound Var Debrujin Index in Dyn Traits
Rust Compiler Performance Triage
Largely uneventful week; the most notable shifts were considered false-alarms
that arose from changes related to cfg-checking (either cargo enabling it, or
adding cfg's like rustfmt
to the "well-known cfgs list").
Triage done by @pnkfelix. Revision range: c65b2dc9..69f53f5e
3 Regressions, 2 Improvements, 3 Mixed; 5 of them in rollups 54 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:
- Merge RFC 3325: Unsafe attributes
- Merge RFC 3593: Reserve unprefixed guarded strings
- Merge RFC 3606: Shorter temp lifetimes in tail exprs
- Merge RFC 3519: Arbitrary self types v2
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
- [disposition: merge] RFC: New range types for Edition 2024
- [disposition: merge] RFC: cargo-script
Tracking Issues & PRs
Rust
- [disposition: merge] [ptr] Document maximum allocation size
- [disposition: merge] Stabilize
min_exhaustive_patterns
- [disposition: merge] Fix #124275: Implemented Default for Arc<\str>
- [disposition: merge] elaborate obligations in coherence
- [disposition: merge] Tracking Issue for
AtomicBool::fetch_not
New and Updated RFCs
- [new] Function body blocks
- [new]
async T
andgen T
types - [new] Match ergonomics 2024
- [new] Extend format_args implicit arguments to allow field access
- [new] Supertrait item shadowing v2
- [new] RFC: #[derive(SmartPointer)]
Upcoming Events
Rusty Events between 2024-05-08 - 2024-06-05 🦀
Virtual
- 2024-05-09 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-09 | Virtual (Israel) | Rust in Israel
- 2024-05-09 | Virtual (Nuremberg/Nürnberg, DE) | Rust Nuremberg
- 2024-05-10 | Virtual | Training 4 Programmers LLC
- 2024-05-10 | Virtual (Ankara, TR) | Türkiye Rust Community
- 2024-05-12 | Virtual (Bangalore, IN) | CoderRange
- 2024-05-13 | Virtual (Ankara, TR) | Türkiye Rust Community
- 2024-05-14 | Virtual | Rust for Lunch
- 2024-05-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-14 | Virtual (Halifax, NS, CA) | Rust Halifax
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-15 | Virtual (Ankara, TR) | Türkiye Rust Community
- 2024-05-15 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-05-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-05-16 | Virtual (Ankara, TR) | Türkiye Rust Community
- 2024-05-16 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2024-05-17 | Virtual | Training 4 Programmers LLC
- 2024-05-21 | Virtual (Washington, DC, US) | Rust DC
- 2024-05-23 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-05-28 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-30 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-06-04 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
Africa
- 2024-06-01 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-05-11 | Bangalore, IN | Rust Bangalore
- 2024-05-14 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-05-08 | Cambridge, UK | Cambridge Rust Meetup
- 2024-05-09 | Gdańsk, PL | Rust Gdansk
- 2024-05-14 | Copenhagen, DK | Copenhagen Rust Community
- 2024-05-14 | Lille, FR | Rust Lille
- 2024-05-14 | London, UK | Rust London User Group
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-14 | Prague, CZ | Rust Prague
- 2024-05-14 | Reading, UK | Reading Rust Workshop
- 2024-05-16 | Augsburg, DE | Rust Meetup Augsburg
- 2024-05-16 | Paris, FR | Rust Paris
- 2024-05-21 | Aarhus, DK | Rust Aarhus
- 2024-05-21 | Zurich, CH | Rust Zurich
- 2024-05-22 | Leiden, NL | Future-proof Software Development by FreshMinds
- 2024-05-23 | Bern, CH | Rust Bern
- 2024-05-23 | Łodz, PL | Mobica
- 2024-05-24 | Bordeaux, FR | Rust Bordeaux
- 2024-05-28 - 2024-05-30 | Berlin, DE | Oxidize
- 2024-05-30 | Barcelona, ES | BcnRust
- 2024-05-30 | Berlin, DE | Rust Berlin
- 2024-05-30 | Copenhagen, DK | Copenhagen Rust Community
- 2024-05-30 | Oslo, NO | Rust Oslo
North America
- 2024-05-08 | Detroit, MI, US | Detroit Rust
- 2024-05-09 - 2024-05-10 | Estes Park, CO, US | Hackathons Denver
- 2024-05-09 | Lehi, UT, US | Utah Rust
- 2024-05-09 | Spokane, WA, US | Spokane Rust
- 2024-05-12 | Brookline, MA, US | Boston Rust Meetup
- 2024-05-14 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-05-14 | New York, NY, US | Rust NYC
- 2024-05-16 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-05-16 | Seattle, WA, US | Seattle Rust User Group
- 2024-05-20 | Somerville, MA, US | Boston Rust Meetup
- 2024-05-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-05-22 | Austin, TX, US | Rust ATX
- 2024-05-25 | Chicago, IL, US | Deep Dish Rust
- 2024-05-30 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-05-31 | Boston, MA, US | Boston Rust Meetup
- 2024-06-05 | Hamburg, DE | Rust Meetup Hamburg
Oceania
- 2024-05-28 | Sydney, NSW, AU | Rust Sydney
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
Rust and its borrow checker are like proper form when lifting boxes. While you might have been lifting boxes "the natural way" for decades without a problem, and its an initial embuggerance to think and perform proper lifting form, it is learnable, efficient, and prevents some important problems.
Or more succinctly:
C/C++: It'll screw your back(end).
And the reply:
- there’s a largish group of men who would feel their masculinity attacked if you implied they should learn it
- while it's learnable finding usefully targeted educational resources are hard to come by
- proper form while lifting boxes are a really terrible way to model graphs
– Brett Witty and Leon on Mastodon
Thanks to Brett Witty for the self-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