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
Foundation
Newsletters
Project/Tooling Updates
- lilos v1.0 released
- medium-to-markdown v0.1.1 : Convert your medium blogs easily into markdown files
- Fluvio v0.11.6 release and project updates
- venndb 0.4.0 - custom validators
- Tantivy 0.22: Performance improvements, new aggregations and stability fixes
- Announcing r3bl_terminal_async - build async interactive CLIs in Rust
- [video] Demo + architecture overview of Ferrostar, a cross-platform turn-by-turn navigation SDK with a Rust core
Observations/Thoughts
- The Rust Calling Convention We Deserve
- Sized, DynSized, and Unsized
- Coroutines and effects
- Porting a cross-platform GUI application to Rust
- Adventures In Rust: Bringing Exchange Support To Thunderbird
Rust Walkthroughs
- Why SQLite Performance Tuning made Bencher 1200x Faster
- drop, the destructor of Rust structs
- Building with AWS S3 using Rust
- Rust tokio task cancellation patterns
- [video] Build with Naz - Published crate r3bl_terminal_async for building async interactive CLIs in Rust
- [video] Trent Billington - Bevy ECS - Power tool for data oriented applications
- [video] Building a procedural art generator
- [audio] Isograph with Robert Balicki
Research
- A Study of Undefined Behavior Across Foreign Function Boundaries in Rust Libraries
- Rust Digger: Does size matter? The biggest crate is 450MB; More than 100 crates are over 50MB
Miscellaneous
- GitHub Sponsor Rust developer David Tolnay
- Learn how to write TCP servers using Rust's std::net module
- RustFest Zürich 🇨 Talks announced
Crate of the Week
This week's crate is scandir, a high-performance file tree scanner.
Thanks to Marty B. for the self-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:
- 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.
- awesome-alternatives-in-rust - Add
dqy
alternative todig
- fluvio - When a topic is deleted, connected clients should have their connection closed
- fluvio - MQTT Connector: Prefix auto generated Client ID to prevent connection drops
- fluvio - Remove localhost from fluvio in favor of 127.0.0.1
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.
- RustConf 2024 | Closes 2024-04-25 | Montreal, Canada | Event date: 2024-09-10
- RustLab 2024 | Closes 2024-05-01 | Florence, Italy | Event date: 2024-11-09 - 2024-11-11
- 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
432 pull requests were merged in the last week
- add simple async drop glue generation
- llvm backend: Prevent creating the same
Instance::mono
multiple times static_mut_refs
: use raw pointers to remove the remaining FIXME- add a lower bound check to
unicode-table-generator
output - add an opt-in to store incoming edges in
VecGraph
+ misc - add llvm-bitcode-linker to build manifest
- allow workproducts without object files
- at debuginfo=0, don't inline debuginfo when inlining
- correctly change type when adding adjustments on top of
NeverToAny
- coverage: branch coverage tests for lazy boolean operators
- coverage: prepare for improved branch coverage
- delay interning errors to after validation
- delay span bug when
Self
kw resolves toDefKind::{Mod,Trait}
- don't ICE for kind mismatches during error rendering
- don't ascend into parent bodies when collecting stmts for possible return suggestion
- don't error on subtyping of equal types
- don't inline integer literals when they overflow - new attempt
- don't repeatedly duplicate TAIT lifetimes for each subsequently nested TAIT
- fix ICE in
eval_body_using_ecx
- fix ICE when there is a non-Unicode entry in the incremental crate directory
- fix capturing duplicated lifetimes via parent in
precise_captures
(impl use<'...>
) - fix normalizing in different
ParamEnv
s with the same InferCtxt - fix trait solver overflow with
non_local_definitions
lint - flip spans for precise capturing syntax not capturing a ty/const param, and for implicit captures of lifetime params
- give a name to each distinct manipulation of pretty-printer FixupContext
- ignore
-C strip
on MSVC - implement Modified Condition/Decision Coverage
- implement
PROBLEMATIC_CONSTS
generalization - implement syntax for
impl Trait
to specify its captures explicitly (feature(precise_capturing)
) - improve ICE message for forbidden dep-graph reads
- interpret: pass MemoryKind to
adjust_alloc_base_pointer
- interpret: pass MemoryKind to
before_memory_deallocation
- interpret: use ScalarInt for bin-ops; avoid PartialOrd for ScalarInt
- introduce perma-unstable
wasm-c-abi
flag - let inherent associated types constrain opaque types during projection
- make
suggest_deref_closure_return
more idiomatic/easier to understand - make
thir_tree
andthir_flat
into hooks - make the comments for
ReturnDest
variants doc comments - match ergonomics 2024: Implement eat-one-layer
- match ergonomics 2024:
mut
doesn't reset binding mode - match hyphen in multi-revision comment matchers
- opaque types have no namespace
- outline default query and hook provider function implementations
- prefer identity equality over equating types during coercion
- print note with closure signature on type mismatch
- properly handle emojis as literal prefix in macros
- remove
default_hidden_visibility: false
from wasm targets - remove uneeded clones now that TrustedStep implies Copy
- silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls
- simplify shallow resolver to just fold ty/consts
- stop taking
ParamTy
/ParamConst
/EarlyParamRegion
/AliasTy
by ref - subtype predicates only exist on inference types, so we can allow them to register opaque types within them
- tell LLVM
Vec::len
is invariant across growth - use raw-dylib for Windows synchronization functions
- refactor clippy in bootstrap
- when suggesting
RUST_BACKTRACE=1,
add a special note for Miri's env var isolation - miri:
data_race
: make the release/acquire API more clear - miri:
no_std
works on Windows now - miri: add
localtime_r
shim - miri: address reuse improvements and fixes
- miri: deadlock: show backtrace for all threads
- miri: directly call
handle_alloc_error
- miri: implement support for
__rust_alloc_error_handler
- miri: make realloc with a size of zero fail
- miri: move
read_byte_slice
to general helpers file, next toread_c_str
- miri: threads: keep track of why we are blocked, and sanity-check that when waking up
Box::into_raw
: make Miri understand that this is a box-to-raw castPatRangeBoundary::compare_with
: also add a fast-path for signed integers- codegen ZSTs without an allocation
- stabilize Wasm target features that are in phase 4 and 5
- stabilize
const_io_structs
- stabilize checking of cfgs at compile-time:
--check-cfg
option - stabilize generic
NonZero
- make
checked
ops emit unchecked LLVM operations where feasible - improve
std::fs::Metadata
Debug representation - fix negating
f16
andf128
constants - force exhaustion in
iter::ArrayChunks::into_remainder
checked_ilog
: improve performance- add an intrinsic for
ptr::from_raw_parts(_mut)
- fix: make
str::from_raw_parts_mut mut
- use queue-based
RwLock
on more platforms - add support for Arm64EC to the standard library
- codegen_gcc: fix
PassMode::Indirect
with params - codegen_gcc: fix check for main function already declared
- codegen_gcc: fix panic when calling
get_fn
for a variable - codegen_gcc: fix passing custom
CG_RUSTFLAGS
when building sysroot - codegen_gcc: implement more type kinds
- cargo install: including Locking message
- cargo resolver: add default Edition2024 to resolver v3
- cargo resolver: add v3 resolver for MSRV-aware resolving
- cargo credential: trim newlines in tokens from stdin
- cargo msrv: error, rather than panic, on rust-version 'x'
- cargo msrv: put MSRV-aware resolver behind a config
- cargo toml: don't crash on parse errors that point to multi-byte character
- cargo toml: disallow source-less dependencies
- cargo toml: error on
[project]
in Edition 2024 - cargo toml: report
_
fied variants (e.g.dev_dependencies
) as deprecated - cargo: fix 'cargo build' fails when
list_files()
with gix is triggered - rustdoc: always display stability version even if it's the same as the containing item
- rustdoc: fix copy path button
- rustdoc: support type '/' to search
- rustdoc-search: fix description on aliases in results
- rustdoc-search: single result for items with multiple paths
- clippy:
threadlocal_initializer_can_be_made_const
will not trigger for unreachable initializers - clippy:
arithmetic_side_effects
fix false negative on+=
- clippy:
ptr_as_ptr
: fix duplicate diagnostics - clippy: emit the
needless_pass_by_ref_mut
lint onself
arguments as well - clippy: fix
is_test_module_or_function
- clippy: reduce
single_char_pattern
to only lint on ascii chars - clippy: rework interior mutability detection
- clippy: the
multiple_unsafe_ops_per_block
test needsasm!
- rust-analyzer: cargo script mvp
- rust-analyzer: add convert From to TryFrom assist
- rust-analyzer: allow rust files to be used linkedProjects
- rust-analyzer: VFS should not walk circular symlinks
- rust-analyzer: handle escaped chars in doc comments
- rust-analyzer: replace Just the variable name in Unused Variable Diagnostic Fix
- rust-analyzer: implement
BeginPanic
handling in const eval - rust-analyzer: make test harness arguments configurable and not
--nocapture
- rust-analyzer: render matched macro arm on hover of macro calls
- rust-analyzer: try to generate more meaningful names in json converter
Rust Compiler Performance Triage
A week dominated by small mixed changes to perf with improvements slightly outweighing regressions. There were no pure regressions, and many of the mixed perf results were deemed worth it for their potential improvements to runtime performance through further optimization from LLVM.
Triage done by @rylev. Revision range: ccfcd950..a77f76e2
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.4% | [0.2%, 1.8%] | 57 |
Regressions ❌ (secondary) |
0.4% | [0.2%, 1.9%] | 26 |
Improvements ✅ (primary) |
-0.8% | [-3.4%, -0.2%] | 50 |
Improvements ✅ (secondary) |
-0.6% | [-1.9%, -0.1%] | 32 |
All ❌✅ (primary) | -0.2% | [-3.4%, 1.8%] | 107 |
0 Regressions, 5 Improvements, 6 Mixed; 2 of them in rollups 62 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:
- 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
- [disposition: merge] experimental project goal program for 2024 H2
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking Issue for
std::path::absolute
- [disposition: merge] Tracking Issue for convenience methods on
NonNull
- [disposition: merge] Inline more svg images into CSS
- [disposition: merge] Edition 2024: Make
!
fall back to!
- [disposition: merge] static_mut_refs: Should the lint cover hidden references?
Cargo
- [disposition: merge] fix(toml): Warn, rather than fail publish, if a target is excluded
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-04-24 - 2024-05-22 🦀
Virtual
- 2024-04-24 | Virtual + In Person (Prague, CZ) | Rust Czech Republic
- 2024-04-25 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-01 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-05-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-05-02 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-05-07 | Virtual (Buffalo, NY) | Buffalo Rust Meetup
- 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-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 (Vancouver, BC, CA) | Vancouver Rust
- 2024-05-16 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2024-05-21 | Virtual (Washington, DC, US) | Rust DC
Africa
- 2024-05-04 | Kampala, UG | Rust Circle Kampala
Asia
- 2024-05-11 | Bangalore, IN | Rust Bangalore
Europe
- 2024-04-24 | Virtual + In Person (Prague, CZ) | Rust Czech Republic
- 2024-04-25 | Aarhus, DK | Rust Aarhus
- 2024-04-25 | Berlin, DE | Rust Berlin
- 2024-04-25 | København/Copenhagen, DK | Copenhagen Rust Community
- 2024-04-25 | Vienna, AT | Rust Vienna
- 2024-04-27 | Basel, CH | Rust Basel
- 2024-04-27 | Stockholm, SE | Stockholm Rust
- 2024-04-30 | Budapest, HU | Budapest Rust Meetup Group
- 2024-04-30 | Salzburg, AT | Rust Salzburg
- [Rust Salzburg meetup]: 6:30pm - CCC Salzburg, 1. OG, ArgeKultur, Ulrike-Gschwandtner-Straße 5, 5020 Salzburg
- 2024-05-01 | Köln/Cologne, DE | Rust Cologne
- 2024-05-01 | Utrecht, NL | NL-RSE Community
- 2024-05-06 | Delft, NL | GOSIM
- 2024-05-07 & 2024-05-08 | Delft, NL | RustNL
- 2024-05-08 | Cambridge, UK | Cambridge Rust Meetup
- 2024-05-09 | Gdańsk, PL | Rust Gdansk
- 2024-05-14 | Virtual + In-Person (München/Munich, DE) | Rust Munich
- 2024-05-14 | Prague, CZ | Rust Prague
- 2024-05-21 | Aarhus, DK | Rust Aarhus
- 2024-05-21 | Zurich, CH | Rust Zurich
North America
- 2024-04-24 | Austin, TX, US | Rust ATX
- 2024-04-25 | Nashville, TN, US | Music City Rust Developers
- 2024-04-26 | Boston, MA, US | Boston Rust Meetup
- 2024-05-04 | Cambridge, MA, US | Boston Rust Meetup
- 2024-05-09 | Spokane, WA, US | Spokane Rust
- 2024-05-12 | Brookline, MA, US | Boston 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
Oceania
- 2024-04-30 | Auckland, NZ | Rust AKL
- 2024-04-30 | Canberra, ACT, AU | Canberra Rust User Group
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
The learning curve for Rust is relatively steep compared to other languages, but once you climb it you'll never look down.
Thanks to BD103 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