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
Official
Project/Tooling Updates
- Rustlings Rewrite
- iroh 0.19.0 - Make it your own
- Announcing Polars 1.0
- rust-analyzer changelog #240
- r3bl_cmdr v0.0.14 released
- r3bl_tui v0.5.6 released
- Danube - Pub/Sub messaging broker
- what-the-time 1.0.0
- Meilisearch releases v1.9
- derive-deftly (the template-based derive macro facility) is nearing 1.x - call for review/testing
Observations/Thoughts
- Ergonomic Self-Referential Types for Rust
- More thoughts on claiming
- Async closures
- Rust has three reference types!
- sans-IO: The secret to effective Rust for network services
- [audio] OxidOS with Alexandru Radovici
Rust Walkthroughs
- Resolving Rust Symbols
- #![doc = include_str!()] with intra-doc links
- The Minimal Rust-Wasm Setup
- Build with Naz : Markdown parser in Rust and nom from r3bl_tui
- Adding compile-time safety to the AWS SDK with syn's Visit trait
- Adding GraphQL Support to Loco with Seaography
- Rust patterns: Don't put any code in mod.rs or lib.rs files
- [series] Master Hexagonal Architecture in Rust (part 3):
Service
, the heart of hexagonal architecture
Miscellaneous
- FizzBuzz Multithreaded - synchronization with rendezvous channels
- [video] Zelda Hessler discusses the AWS SDK for Rust
Crate of the Week
This week's crate is asak, a terminal-based audio recording/playback TUI.
Despite a lamentable lack of suggestions this week, llogiq is reasonably pleased with his choice.
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.
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
408 pull requests were merged in the last week
rustc_data_structures
: Explicitly check for 64-bit atomics support- add
()
to themarker_impls
macro forConstParamTy
- add
.ignore
file to makeconfig.toml
searchable in vscode - add more constants, functions, and tests for
f16
andf128
- ast: standardize visiting order
- ast: standardize visiting order for attributes and node IDs
- automatically taint InferCtxt when errors are emitted
- avoid MIR bloat in inlining
- avoid cloning jump threading state when possible
- coverage: avoid getting extra unexpansion info when we don't need it
- coverage: make
#[coverage(..)]
apply recursively to nested functions - de-duplicate all consecutive native libs regardless of their options
- delegation: ast lowering refactor
- deny
use<>
for RPITITs - detect unused structs which derived Default
- do not ICE when suggesting dereferencing closure arg
- don't ICE during RPITIT refinement checking for resolution errors after normalization
- don't suggest awaiting in closure patterns
- eliminate the distinction between
PREC_POSTFIX
andPREC_PAREN
precedence level - enable const casting for
f16
andf128
- fix
x86_64
code being produced for bare-metal LoongArch targets'compiler_builtins
- fix an error suggestion for E0121 when using placeholder
_
as return types on function signature - fix bad replacement for unsafe extern block suggestion
- prefer
(*p).clone
top.clone
if thep
is a raw pointer - ignore
llvm::Lld
if lld is not enabled - implement new effects desugaring
- improve unsafe extern blocks diagnostics
- introduce a
rustc_
attribute to dump all theDefId
parents of aDefId
- less
maybe_whole_expr
, take 2 - let's
#[expect]
some lints: Stabilizelint_reasons
(RFC 2383) - linker: refactor interface for passing arguments to linker
- make
feature(effects)
require-Znext-solver
- make cargo submodule optional
- mark assoc tys live only if the corresponding trait is live
- move binder and polarity parsing into
parse_generic_ty_bound
- not use offset when there is not ends with brace
- patchable-function-entry: add unstable compiler flag and attribute
- print
TypeId
as au128
forDebug
- un-unsafe the
StableOrd
trait - remove (deprecated & unstable)
{to,from}_bits
pointer methods - remove
f16
andf128
ICE paths from smir - remove more
PtrToPtr
casts in GVN - remove unnecessary SeqCst in
impl fmt::Pointer for AtomicPtr
- resolve: tweak some naming around import ambiguities
- show used attribute's kind for user when find it isn't applied to a
static
variable - stall computing instance for drop shim until it has no unsubstituted const params
- support fetching
Attribute
of items - switch back
non_local_definitions
lint to allow-by-default - tighten
fn_decl_span
for async blocks - transmute size check: properly account for alignment
- tweak
FlatPat::new
to avoid a temporarily-invalid state - tweak a confusing comment in
create_match_candidates
- unify
dylib
andbin_helpers
and createshared_helpers::parse_value_from_args
- use
clang-format
intidy
to check the C++ code style underllvm-wrapper
- use full expr span for return suggestion on type error/ambiguity
- various
rustc_codegen_ssa
cleanups - various refactorings to
rustc_interface
- miri:
iter_exported_symbols
: also walk used statics in local crate - miri: remove GetCurrentProcessId's
frame_in_std
check - stabilize
PanicInfo::message()
andPanicMessage
- stabilize
duration_abs_diff
- mark
Hasher::finish
as#[must_use]
- std: separate TLS key creation from TLS access
- cargo: allow
unexpected_builtin_cfgs
lint inuser_specific_cfgs
test - cargo: gix: remove
revision
feature from cargo - cargo: make it clear that
CARGO_CFG_TARGET_FAMILY
is multi-valued - cargo: test: fix several assertions
- cargo: test: omit target-dir name
- cargo: test: replace glob with explicit unordered calls
- rustdoc: check if the disambiguator matches its suffix
- clippy:
doc_lazy_continuation
: blank comment line for gap - clippy: add error message to
manual_inspect
lint - clippy: don't lint
assertions_on_constants
on any const assertions - clippy: fix
doc_markdown
DevOps false positive - clippy: implement a lint to replace manual bit rotations with
rotate_left/rot…
- rust-analyzer: do not normalize
use foo::{self}
touse foo
- rust-analyzer: add
bool_to_enum
assist for parameters - rust-analyzer: completions after async kw
- rust-analyzer: fix expression scope calculation when within macro expansions
- rust-analyzer: pass cargo extra args when debugging
- rust-analyzer: quality of life improvements to term search
- rust-analyzer: use proper
ImplTraits
ininsert_inference_vars_for_impl_trait
Rust Compiler Performance Triage
2024-07-02 Triage Log
We saw a large set of primary benchmarks regress, mostly due to PR #120924 (lint_reasons
and #[expect]
) and PR #120639 (new effects
desugaring). Separate from those, there are a couple rollup PRs (#127076, #127096) with some regressions that were limited to relatively few benchmarks; pnkfelix was unable to isolate a injecting PR that can be identified as a root cause (outside assistance welcome!).
Triage done by @pnkfelix. Revision range: c3d7fb39..cf2df68d
4 Regressions, 3 Improvements, 11 Mixed; 7 of them in rollups 59 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: * RFC: Unblock Cargo feature metadata
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: #[derive(SmartPointer)]
Tracking Issues & PRs
Rust
- [disposition: merge] Tracking issue for const char conversions
- [disposition: merge] Don't make statement nonterminals match pattern nonterminals
- [disposition: merge] Allow
#[deny]
inside#[forbid]
as a no-op - [disposition: merge] Tracking issue for function attribute
#[coverage]
- [disposition: merge] Bump
elided_lifetimes_in_associated_constant
to deny - [disposition: merge] Tracking Issue for
const_cstr_from_ptr
- [disposition: merge] Deny keyword lifetimes pre-expansion
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 Tracking Issues or PRs 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] Async closures
Upcoming Events
Rusty Events between 2024-07-03 - 2024-07-31 🦀
Virtual
- 2024-07-03 | Virtual | Training 4 Programmers LLC
- 2024-07-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-07-04 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-07-06 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2024-07-09 | Virtual | Rust for Lunch
- 2024-07-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-07-10 | Virtual | Centre for eResearch
- 2024-07-11 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-07-11 | Hybrid - Virtual and In-person (Mexico City, DF, MX) | Rust MX
- 2024-07-11 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-07-11 | Virtual (Tel Aviv, IL) | Code Mavens
- 2024-07-16 | Virtual (Tel Aviv, IL) | Code Mavens
- 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-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-30 | Virtual (Dallas, TX, US) | Dallas Rust
Asia
- 2024-07-03 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2024-07-10 | Reading, UK | Reading Rust Workshop
- 2024-07-11 | Prague, CZ | Rust Prague
- 2024-07-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-07-16 | Mannheim, DE | Hackschool - Rhein-Neckar
- 2024-07-23 | Hybrid - Virtual and In-Person (München/Munich, DE) | Rust Munich
- 2024-07-25 | Berlin, DE | OpenTechSchool Berlin + Rust Berlin
- 2024-07-27 | Augsburg, DE | Rust Meetup Augsburg
- 2024-07-30 | Basel, CH | Rust Basel
North America
- 2024-07-05 | Boston, MA, US | Boston Rust Meetup
- 2024-07-11 | Hybrid - Mexico City, DF, MX | Rust MX
- 2024-07-11 | Mountain View, CA, US | Mountain View Rust Meetup
- 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-24 | Austin, TX, US | Rust ATC
- 2024-07-27 | Hybrid - Virtual and In-Person (Kyiv, UA) | UA Rust
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 compiler usually doesn't complain about [you] doing undefined behavior because it doesn't know that you're doing undefined behavior.
Thanks to scottmcm 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