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
Project/Tooling Updates
- This month in Servo: gamepad support, font fallback, Space Jam, and more!
- Announcing Jco 1.0
- This month in Pavex, #9
- argmin 0.10.0 - a Rust crate for numerical optimization
Observations/Thoughts
- Text labels rendering on a map with Rust - research and design
- Rust developers fear language is getting too complex and prefer bug fixes to new features
- Lessons learnt from building a distributed system in Rust
- How Rust Could Change Robotics
- Asynchronous clean-up
- Edge IoT with Rust on ESP: Ping!
- ESP Embedded Rust: Command Line Interface
- ESP Embedded Rust: Ping CLI App Part 2
- Convert a String to int in Rust
- Mastering
ManuallyDrop<T>
- A Guide to Explicit Resource Management in Rust - Rust, but async
Rust Walkthroughs
- Matching and iterators in Rust
- Practical guide to Error Handling in Rust
- Building an Async Runtime with mio
- [HE] [video] Rust Course
Miscellaneous
- Guide to using TensorFlow in Rust
- A Twist on Wadler's Printer
- Implementing API Rate Limiting in Rust
- How to benchmark Rust code with Iai
- Sequential-storage: efficiently store data in flash
- [audio] Sentry - Rust in Production Podcast
- [video] A First Look at Lifetimes in Rust
- [video] Firmware for an ESP32 to read from a noise sensor in Rust
Crate of the Week
This week's crate is web-audio-api-rs, a Rust implementation of the Web Audio API for use outside the browser.
Thanks to Otto Rottier 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 RFCs issued a call for testing 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.
- Hyperswitch - [FEATURE] : add
offset
field to disputes list - Hyperswitch - [FEATURE]: add
offset
field to mandates list - Ockam -
ockam node create --identity X
should fail ifX
doesn't exist - Ockam - Output for
ockam project ticket
is improved and information is not opaque - Ockam - Output for both
ockam project ticket
andockam project enroll
is improved, with support for--output json
- ZeroCopy - In zerocopy-derive UI tests, detect whether we're building with
RUSTFLAGS='-Wwarnings'
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.
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
430 pull requests were merged in the last week
- Avoid non-local definitions in functions (RFC #3373)
- wasm: store rlib metadata in wasm object files
- account for RPITIT in E0310 explicit lifetime constraint suggestion
- actually use the right closure kind when checking async Fn goals
- add
#[rustc_no_mir_inline]
for standard library UB checks - allow for a missing
adt_def
inNamePrivacyVisitor
- avoid generalization inside of aliases
- by changing some attributes to
only_local,
reducing encoding attributes in the crate metadate - do not const prop unions
- don't ICE on anonymous
struct
inenum
variant - expand weak alias types before collecting constrained/referenced late bound regions + refactorings
- fix panic when compiling
Rocket
- make intrinsic fallback bodies cross-crate inlineable
- make it possible for outside crates to inspect a
mir::ConstValue
with the interpreter - make non-PartialEq-typed consts as patterns a hard error
- mark
min_exhaustive_patterns
as complete - match lowering: Introduce a
TestCase enum
to replace most matching onPatKind
- match lowering: eagerly simplify match pairs
- match lowering: simplify empty candidate selection
- match lowering: test one or pattern at a time
- Fix liveness analysis in the presence of never patterns
- no need to
validate_alias_bound_self_from_param_env
inassemble_alias_bound_candidates
- prevent cycle in implied predicates computation
- promotion: don't promote
int::MIN / -1
- properly emit
expected ;
on#[attr] expr
- provide suggestions through
rustc_confusables
annotations - refactor trait implementations in
core::convert::num
- split Diagnostics for Uncommon Codepoints: Add Individual Identifier Types
- support async trait bounds in macros
- unify dylib loading between proc macros and codegen backends
- when encountering
<&T as Clone>::clone(x)
becauseT: Clone
, suggest#[derive(Clone)]
- miri: /miri many-seeds: support
MIRI_SEED_END
to control the end of the seed range - miri: add "cargo miri clean" command
- miri: windows miri-script execution ergonomics
- use
br
instead of a conditional when switching on a constant boolean - stabilize
cfg_target_abi
- improve UEFI stdio
- windows: use ProcessPrng for random keys
- require
simd_insert, simd_extract
indices to be constants - make
Barrier::new()
const - implement
MappedMutexGuard
,MappedRwLockReadGuard
, andMappedRwLockWriteGuard
- add "algebraic" fast-math intrinsics, based on fast-math ops that cannot return poison
- remove useless
'static
bounds onBox
allocator - mpsc: fix race between block initialization and receiver disconnection
- futures: add
'static
bound towaker_ref
- cargo add: Improve error when adding registry packages while vendored
- cargo: Control clap colors through config
- cargo: Respect
CARGO_TERM_COLOR
in '--list' and '-Zhelp' - cargo: error messages when collecting workspace members now mention the workspace root location
- cargo: support
target.<triple>.rustdocflags
officially - rustdoc: include crate name in links for local primitives
- clippy:
box_default
: preserve required path segments - clippy:
read_line_without_trim
: detect string literal comparison and.ends_with()
calls - clippy: add
unnecessary_clippy_cfg
lint - clippy: add new
multiple_bound_locations
lint - clippy: add new
unnecessary_get_then_check
lint - clippy: allow
unused_imports,
andunused_import_braces
onuse
- clippy: don't lint
infinite_loop
in external or proc macros - clippy: make
redundant_guards
take constness into account - clippy:
unused_unit
: be careful with expressions with attributes - clippy: new lint:
empty docs
- clippy: extend
unnecessary_to_owned
to handleBorrow
trait in map types - clippy: fix sign-handling bugs and false negatives in
cast_sign_loss
- clippy: fix suggestion error in
useless_vec
- clippy: fix
no_effect_underscore_binding
firing on ignored parameters of async fns - clippy: look for
implied_bounds_in_impls
in more positions - clippy: take lifetime extension into account in
ref_as_ptr
- rust-analyzer: add assist for filling fields by replacing ellipsis in record syntax
- rust-analyzer: add short flag -V for consistency with other rust tooling
- rust-analyzer: add "make tuple" tactic to term search
- rust-analyzer:
replace_filter_map_next_with_find_map
shouldn't work for dyn trait - rust-analyzer: don't panic on synthetic syntax in inference diagnostics
- rust-analyzer: fix completions panicking with certain macro setups
- rust-analyzer: fix deadlock in
recreate_crate_graph <-> file_line_index
- rust-analyzer: fix modules in blocks not resolving in ide layer
- rust-analyzer: fix proc-macro server not accounting for string delimiters correctly
- rust-analyzer: fix recompiles due to
RUSTC_BOOTSTRAP
- rust-analyzer: panic when inlining callsites inside macros' parameters
- rust-analyzer: merge
BorrowKind::Unique
intoBorrowKind::Mut
- rust-analyzer: speed up Method Completions By Taking Advantage of Orphan Rules
Rust Compiler Performance Triage
A rare week where regressions out powered improvements to make the compiler roughly half a percent slower on average on nearly 100 benchmarks. Some regressions have fixes in the pipeline, but some remain elusive or were introduced to address correctness issues.
Triage done by @rylev. Revision range: 5af21304..71ffdf7f
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.0% | [0.2%, 4.4%] | 69 |
Regressions ❌ (secondary) |
1.4% | [0.2%, 4.9%] | 66 |
Improvements ✅ (primary) |
-1.1% | [-3.3%, -0.2%] | 28 |
Improvements ✅ (secondary) |
-0.6% | [-1.5%, -0.2%] | 33 |
All ❌✅ (primary) | 0.4% | [-3.3%, 4.4%] | 97 |
4 Regressions, 6 Improvements, 5 Mixed; 2 of them in rollups 58 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
- No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
Rust
- [disposition: merge] Lint singleton gaps after exclusive ranges
- [disposition: merge] Tracking Issue for slice::split_at_unchecked() and split_at_mut_unchecked()
- [disposition: merge] Tracking Issue for generic
NonZero
- [disposition: merge] Made
INVALID_DOC_ATTRIBUTES
lint deny by default - [disposition: merge] Tracking Issue for ARM CRC32 intrinsics
- [disposition: merge] use
confstr(_CS_DARWIN_USER_TEMP_DIR, ...)
as aTMPDIR
fallback on Darwin
New and Updated RFCs
Upcoming Events
Rusty Events between 2024-02-28 - 2024-03-27 🦀
Virtual
- 2024-02-29 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-02-29 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-06 | Virtual (Dublin, IE) | Rust Dublin
- 2024-03-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-03-07 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-03-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-03-12 | Hybrid (Virtual + In-person) Munich, DE | Rust Munich
- 2024-03-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2024-03-14 | Virtual (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-03-14 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-03-21 | Seattle, WA, US | Seattle Rust User Group
- 2024-03-26 | Virtual + In Person (Barcelona, ES) | BcnRust
Europe
- 2024-02-29 | Berlin, DE | Rust Berlin
- 2024-02-29 | Copenhagen, DK | Copenhagen Rust Community
- 2024-03-06 | Zürich, CH | Rust Zürisee
- 2024-03-12 | Munich, DE + Virtual | Rust Munich
- 2024-03-13 | Paris, FR | Paris Rustaceans
- 2024-03-14 | Reading, UK | Reading Rust Workshop
- 2024-03-19 | Aarhus, DK | Rust Aarhus
- 2024-03-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-03-20 | Girona, ES | Rust Girona
- 2024-03-21 | Augsburg, DE | Rust Meetup Augsburg
- 2024-03-21 | Lille, FR | Rust Lille
- 2024-03-26 | Barcelona, ES + Virtual | BcnRust
- 2024-03-26, 2024-03-28 | London, UK | Rust Nation UK
North America
- 2024-02-28 | Austin, TX, US | Rust ATX
- 2024-02-28 | Chicago, IL, US | Deep Dish Rust
- 2024-03-04 | Cambridge, MA, US | Boston Rust Meetup
- 2024-03-07 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-03-13 | Boston, MA, US | Boston Rust Meetup
- 2024-03-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-03-27 | Austin, TX, US | Rust ATX
- 2024-03-27 | Hawthorne, CA, US | Freeform
Oceania
- 2024-02-29 | Brisbane, QLD, AU | Rust Brisbane
- 2024-03-05 | Auckland, NZ | Rust AKL
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
That would take 18 million terabytes of RAM. You don't have that much memory.
– Alice Ryhl answering "What is MAX array size" on rust-users
Thanks to Zeroexcuses 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