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
Newsletters
Project/Tooling Updates
- rust-analyzer changelog #211
- PC Music Generator
- Announcing mfio - Completion I/O for Everyone
- Watchexec Library 3.0 and CLI 1.24
- [series] Spotify-Inspired: Elevating Meilisearch with Hybrid Search and Rust
Observations/Thoughts
- Rust Is Beyond Object-Oriented, Part 3: Inheritance
- Being Rusty: Discovering Rust's design axioms
- Non-Send Futures When?
for await
and the battle of buffered streams- poll_progress
- Rust and ThreadX - experiments with an RTOS written in C, a former certified software component
- Nine Rules for SIMD Acceleration of Your Rust Code (Part 1): General Lessons from Boosting Data Ingestion in the range-set-blaze Crate by 7x
- Contributing to Rust as a novice
- [audio] Exploring Rust's impact on efficiency and cost-savings, with Stefan Baumgartner
Rust Walkthroughs
- Common Mistakes with Rust Async
- Embassy on ESP: UART Transmitter
- Writing a CLI Tool in Rust with Clap
- Memory and Iteration
- Getting Started with Axum - Rust's Most Popular Web Framework
- Exploring the AWS Lambda SDK in Rust
- Practical Client-side Rust for Android, iOS, and Web
- [video] Advent of Code 2023
Miscellaneous
- Turbofish ::<>
- Rust Meetup and user groups
- Adopting Rust: the missing playbook for managers and CTOs
- SemanticDiff 0.8.8 adds support for Rust
Crate of the Week
This week's crate is io-adapters, a crate that lets you convert between different writeable APIs (io
vs. fmt
).
Thanks to Alex Saveau for the self-suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
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.
- greptimedb - API improvement for pretty print sql query result in http output 1
- greptimedb - Unify builders' patterns
- tokio - Run loom tests in oss-fuzz 4
- Ockam - Library - Validate CBOR structs according to the cddl schema for
kafka/protocol_aware
andnodes/services
- Ockam - Command - refactor to use typed interfaces to implement commands for
relays
- Ockam - Make install.sh not fail when the latest version is already installed
- zerocopy - Use cargo-semver-checks to make sure
derive
feature doesn't change API surface - zerocopy - Verify that
all-jobs-succeeded
CI job depends on all other jobs - Hyperswitch - [REFACTOR]: [Nuvei] MCA metadata validation
- Hyperswitch - [Feature] : [Noon] Sync with Hyperswitch Reference
- Hyperswitch - [BUG] : MCA metadata deserialization failures should be 4xx
- Hyperswitch - [Feature] : [Zen] Sync with Hyperswitch Reference
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
391 pull requests were merged in the last week
- introduce support for
async gen
blocks - implement 2024-edition lifetime capture rules RFC
riscv32
platform support- add teeos std impl
never_patterns
: Parse match arms with no bodyrustc_symbol_mangling,rustc_interface,rustc_driver_impl
: Enforcerustc::potential_query_instability
lint- add ADT variant infomation to StableMIR and finish implementing
TyKind::internal()
- add
deeply_normalize_for_diagnostics
, use it in coherence - add comment about keeping flags in sync between bootstrap.py and bootstrap.rs
- add emulated TLS support
- add instance evaluation and methods to read an allocation in StableMIR
- add lint against ambiguous wide pointer comparisons
- add method to get type of an Rvalue in StableMIR
- add more SIMD platform-intrinsics
- add safe compilation options
- add support for
gen fn
- add support for making lib features internal
- added shadowed hint for overlapping associated types
- avoid adding builtin functions to
symbols.o
- avoid instantiating infer vars with infer
- change prefetch to avoid deadlock
- compile-time evaluation: detect writes through immutable pointers
- coverage: be more strict about what counts as a "visible macro"
- coverage: merge refined spans in a separate final pass
- coverage: simplify the heuristic for ignoring
async fn
return spans - coverage: use
SpanMarker
to improve coverage spans forif !
expressions - dedup for duplicate suggestions
- discard invalid spans in external blocks
- do not parenthesize exterior
struct
lit inside match guards - don't include destruction scopes in THIR
- don't print host effect param in pretty
path_generic_args
- don't warn an empty pattern unreachable if we're not sure the data is valid
- enforce
must_use
on associated types and RPITITs that have a must-use trait in bounds - explicitly implement
DynSync
andDynSend
forTyCtxt
- fix
is_foreign_item
for StableMIR instance - fix const drop checking
- fix in-place collect not reallocating when necessary
- fix parser ICE when recovering
dyn
/impl
afterfor<...>
- fix: correct the arg for 'suggest to use associated function syntax' diagnostic
- generalize LLD usage in bootstrap
- generalize: handle occurs check failure in aliases
- implement
--env
compiler flag (withouttracked_env
support) - implement
repr(packed)
forrepr(simd)
- improve
print_tts
- interpret: make
numeric_intrinsic
accessible from Miri - make async generators fused by default
- make sure
panic_nounwind_fmt
can still be fully inlined (e.g. forpanic_immediate_abort)
- only check principal trait ref for object safety
- pretty print
Fn<(..., ...)>
trait refs with parentheses (almost) always - privacy: visit trait def id of projections
- provide context when
?
can't be called because ofResult<_, E>
- rearrange
default_configuration
andCheckCfg::fill_well_known
- recurse into refs when comparing tys for diagnostics
- remove
PolyGenSig
since it's always a dummy binder - remove the
precise_pointer_size_matching
feature gate - resolve associated item bindings by namespace
- streamline MIR dataflow cursors
- structured
use
suggestion on privacy error - tell MirUsedCollector that the pointer alignment checks calls its panic symbol
- tip for define macro name after
macro_rules!
- tweak
.clone()
suggestion to work in more cases - tweak unclosed generics errors
- unescaping cleanups
- uplift the (new solver) canonicalizer into
rustc_next_trait_solver
- use
immediate_backend_type
when reading from a const alloc - use default params until effects in desugaring
- miri: fix promising a very large alignment
- miri: fix x86 SSE4.1 ptestnzc
- miri: move some x86 intrinsics code to helper functions in
shims::x86
- miri: return
MAP_FAILED
when mmap fails - stablize
arc_unwrap_or_clone
- add
LinkedList::{retain,retain_mut}
- simplify Default for tuples
- restore
const PartialEq
- split
Vec::dedup_by
into 2 cycles - futures: fillBuf: do not call
poll_fill_buf
twice - futures:
FuturesOrdered
: use 64-bit index - futures:
FuturesUnordered
: fix clear implementation - futures: use
cfg(target_has_atomic)
on no-std targets - cargo: spec: Extend PackageIdSpec with source kind + git ref for unambiguous specs
- cargo toml: disallow inheriting of dependency public status
- cargo toml: disallow
[lints]
in virtual workspaces - cargo: schema: Remove reliance on cargo types
- cargo: schemas: Pull out mod for proposed schemas package
- cargo: trim-paths: assert
OSO
andSO
cannot be trimmed - cargo: avoid writing CACHEDIR.TAG if it already exists
- cargo: fix bash completion in directory with spaces
- cargo: explicitly remap current dir by using
.
- cargo: print rustc messages colored on wincon
- cargo: limit exported-private-dependencies lints to libraries
- rustdoc-search: do not treat associated type names as types
- rustdoc: Don't generate the "Fields" heading if there is no field displayed
- rustdoc: Fix display of features
- rustdoc: do not escape quotes in body text
- rustdoc: remove unused parameter
reversed
fromonEach(Lazy)
- bindgen: support float16
- rustfmt: add
StyleEdition enum
andStyleEditionDefault
trait - clippy:
fix(ptr_as_ptr)
: handlestd::ptr::null{_mut}
- clippy:
needless_borrows_for_generic_args
: Handle when field operand impl Drop - clippy:
uninhabited_reference
: new lint - clippy: add a function to check whether binary oprands are nontrivial
- clippy: fix
is_from_proc_macro
patterns - rust-analyzer: check if lhs is also a binexpr and use its rhs in flip binexpr assist
- rust-analyzer: fallback to method resolution on unresolved field access with matching method name
- rust-analyzer: add
trait_impl_reduntant_assoc_item
diagnostic - rust-analyzer: allow navigation targets to be duplicated when the focus range lies in the macro definition site
- rust-analyzer: implicit format args support (hooray!)
- rust-analyzer: prioritize import suggestions based on the expected type
- rust-analyzer: fix WideChar offsets calculation in
line-index
- rust-analyzer: fix panic with closure inside array len
- rust-analyzer: bug in
extract_function.rs
- rust-analyzer: don't emit "missing items" diagnostic for negative impls
- rust-analyzer: don't print proc-macro panic backtraces in the logs
- rust-analyzer: fix
concat_bytes!
expansion emitting an identifier - rust-analyzer: fix completion failing in
format_args!
with invalid template - rust-analyzer: fix diagnostics panicking when resolving to different files due to macros
- rust-analyzer: fix item tree lowering
pub(self)
topub()
- rust-analyzer: fix runnable cwd on Windows
- rust-analyzer: fix token downmapping being quadratic
- rust-analyzer: fix view mir, hir and eval function not working when cursor is inside macros
- rust-analyzer: insert fn call parens only if the parens inserted around field name
- rust-analyzer: make drop inlay hint more readable
- rust-analyzer: resolve Self type references in delegate method assist
- rust-analyzer: smaller spans for unresolved field and method diagnostics
- rust-analyzer: make ParamLoweringMode accessible
- rust-analyzer: query for nearest parent block around the hint to resolve
- rust-analyzer: replace
doc_comments_and_attrs
withcollect_attrs
- rust-analyzer: show placeholder while run command gets runnables from server
- rustc-perf: add support for benchmarking Cranelift codegen backend
Rust Compiler Performance Triage
A quiet week overall. A few smaller crate (e.g., helloworld) benchmarks saw significant improvements in #118568, but this merely restores performance regressed earlier.
Triage done by @simulacrum. Revision range: 9358642..5701093
5 Regressions, 2 Improvements, 3 Mixed; 2 of them in rollups
69 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
- [disposition: merge] Tracking Issue for
Bound::map
- [disposition: merge] Stabilize THIR unsafeck
- [disposition: merge] Exhaustiveness: reveal opaque types properly
- [disposition: merge] Properly reject
default
on free const items - [disposition: merge] Make inductive cycles in coherence ambiguous always
Language Reference
- No Language Reference RFCs entered Final Comment Period this week.
Unsafe Code Guidelines
- No Unsafe Code Guideline RFCs entered Final Comment Period this week.
New and Updated RFCs
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:
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.
Upcoming Events
Rusty Events between 2023-12-13 - 2024-01-10 🦀
Virtual
- 2023-12-14 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-12-14 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-12-17 | Virtual (Tel Aviv, IL) | Code Mavens
- 2023-12-18 | Virtual (Munich, DE) | Rust Munich
- 2023-12-19 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-12-19 | Virtual (Washington, DC, US) | Rust DC
- 2023-12-19 | Virtual (Linz, AT) Rust Linz
- 2023-12-20 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-12-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-12-28 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-03 | Virtual (Indianapolis, IN, US) | Indy Rust
Asia
- 2023-12-16 | Delhi, IN | Rust Delhi
Europe
- 2023-12-14 | Augsburg, DE | Rust - Modern Systems Programming in Leipzig
- 2023-12-14 | Basel, CH | Rust Basel
- 2023-12-18 | Munich, DE + Virtual | Rust Munich
- 2023-12-19 | Heidelberg, DE | Nix Your Bugs & Rust Your Engines
- 2023-12-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2023-12-27 | Copenhagen, DK | Copenhagen Rust Community
North America
- 2023-12-13 | Chicago, IL, US | Deep Dish Rust
- 2023-12-14 | Lehi, UT, US | Utah Rust
- 2023-12-14 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-12-15 | Somerville, MA, US | Boston Rust Meetup
- 2023-12-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-12-27 | Austin, TX, US | Rust ATX
- 2024-01-09 | Minneapolis, MN, US | Minneapolis Rust Meetup
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
Sadly, the week went by without a nominated quote.
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