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 #198
- Meet Yazi: Blazing fast terminal file manager, written in Rust, based on async I/O
- Candle: A New Machine Learning Framework for Rust
- Wasmer 4.2 is Released: Upping the Ante with 50% Faster Module Load Times! 🚀
- Roadmap to Tauri 2.0
- Introducing RustRover – A Standalone Rust IDE by JetBrains
Observations/Thoughts
- How Ferrocene improves Rust
- Owned values and Futures in Rust
- Semver violations are common, better tooling is the answer
- Rethinking Rust’s unsafe keyword
- Async Rust Is A Bad Language
- Why you might actually want async in your project
- I Wrote A String Type
- Writing a Web Scraper in Rust using Reqwest
- Gotchas in Rust-Python binding with pyo3
Rust Walkthroughs
- How Rust can build an elegant API around raw memory
- Deploy Your Rust Project to Any Hosting Provider in Minutes
- Rust embedded at Espressif @ Copenhagen Rust Community
Miscellaneous
- What's The Time In Tokio?
- Teaching Rust in 5 days
- Time Travel Debugging Rust in NeoVim
- Semantic Search with Qdrant, OpenAI and Shuttle
- ESP32 Standard Library Embedded Rust: GPIO Interrupts
- [audio] RustShip: Trustfall and cargo-semver-checks with Predrag Gruevski
- [video] How to Do Embedded Development with Rust • Steve Klabnik • GOTO 2023
Crate of the Week
This week's crate is irsenv, a hierarchical environmant variable manager.
Thanks to sysid 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.
- zerocopy - Prevent panics statically
- zerocopy - Implement traits for tuple types (and maybe other container types?)
- zerocopy - [CI] Deduplicate
actions/cache
directives - zerocopy - Refactor version comparison logic in
check_versions
CI job - r3bl_rs_utils - Add styling support so that selected and unselected styles can be passed in
- r3bl_rs_utils - Create a function that allows multiple selections from a list of strings
- r3bl_rs_utils - Add support for syntect output
- Ockam - Use the Terminal to print out RPC response instead of printlns - Issue #5904 - build-trust/ockam - GitHub
- Ockam - Investigate and fix breaking changes in upgrading from nix crate 0.26.2 to 0.27.1
- Ockam - Give user feedback on using Ockam Command CLI
- RustQuant - Increase test coverage.
- RustQuant - Create Python bindings.
- RustQuant - Add/improve documentation.
- RustQuant - Implement jump-diffusion simulator.
- Hyperswitch - merchant account delete does not delete the
merchant_key_store
- Hyperswitch - add domain type for client secret
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
382 pull requests were merged in the last week
- move wasm32-wasi-preview1-threads target to Tier 2
-Cllvm-args
usability improvement- debuginfo: add compiler option to allow compressed debuginfo sections
rustc_layout, rustc_abi
: make sure the types are well-formed- abort if check nightly options failed on stable
- add CL and CMD into to pdb debug info
- add support to return value in StableMIR interface and not crash due to compilation error
- allow
large_assignments
for Box/Arc/Rc initialization - allow redirecting subprocess stdout to our stderr etc. (redux)
- avoid a
source_span
query when encoding Spans into query results - better Debug for
Ty
in smir - bubble up opaque
<eq>
opaque operations instead of picking an order - call
LateLintPass::check_attribute
fromwith_lint_attrs
- do not require associated types with Self: Sized to uphold bounds when confirming object candidate
- don't ICE on associated type projection without feature gate in new solver
- don't ICE when computing ctype's
repr_nullable_ptr
for possibly-unsized ty - don't report any errors in
lower_intrinsics
- don't require
Drop
for[PhantomData<T>; N]
whereN
andT
are generic, ifT
requiresDrop
- don't suggest dereferencing to unsized type
- dont suggest use between
use
and cfg attr - emit error instead of ICE when optimized MIR is missing
- enable incremental-relative-spans by default
- explain why we can mutate the FPU control word
- expose more information with DefId in smir
- extract parallel operations in
rustc_data_structures::sync
into a newparallel
submodule - fix ICE in
improper_ctypes_definitions
lint - fix Step Skipping Caused by Using the
--exclude
Option - fix
homogeneous_aggregate
not ignoring some ZST - fix error report for size overflow from transmute
- fix overflow in array length computation
- fix: return early when has tainted in mir-lint
- implement fallback for effect param
- implement refinement lint for RPITIT
- implied bounds: do not ICE on unconstrained region vars
- improve "associated type not found" diagnostics
- improve
AttrTokenStream
- improve diagnostic for generic params from outer items (E0401)
- fix
unnecessary_unsafe
false positive - fix incorrect mutable suggestion information for binding in ref pattern like:
let &b = a;
- lint node for
private_bounds
/private_interfaces
is the item which names the private type - lint on invalid usage of
UnsafeCell::raw_get
in reference casting - make if let guard parsing consistent with normal guards
- make the deadlock panic clearly refer to a deadlock
- make unknown/renamed/removed lints passed via command line respect lint levels
- point out if a local trait has no implementations
- preserve ASAN-related symbols during LTO
- print the path of a return-position impl trait in trait when
return_type_notation
is enabled - remove the unhelpful let binding diag comes from
FormatArguments
- replace
rustc_data_structures
dependency withrustc_index
inrustc_parse_format
- suggest
iter_mut()
where trying to modify elements from.iter()
- support debuginfo for custom MIR
- take
&mut Results
inResultsVisitor
- use
newtype_index
forIntVid
andFloatVid
- use relative positions inside a SourceFile
- use the same DISubprogram for each instance of the same inlined function within a caller
- represent MIR composite debuginfo as projections instead of aggregates
- encode only MIR reachable from other crates
- allow loading the SMIR for constants and statics
- implement SMIR generic parameter instantiation
- miri: catch function calls where the argument is caller-invalid / the return value callee-invalid
- miri: use
#!/usr/bin/env
shebang - add optimized lock methods for
Sharded
and refactorLock
- add
FreezeLock
type and use it to storeDefinitions
- use
FreezeLock
forCStore
- use
Freeze
forSourceFile
- span tweaks
- use a specialized varint + bitpacking scheme for DepGraph encoding
- add
char::MIN
- stabilize
io_error_other
feature - hashbrown: make allocator not
Clone
- codegen_gcc: fix const handling in ATT syntax
- codegen_gcc: set the correct gimple output format
- cargo-credential: change serialization of cache expiration
- cargo: Add styling to help output
- cargo: Make resolver behavior independent of package order
- cargo: error out if
cargo clean --doc
is mixed with-p
- cargo: stabilize lints
- cargo: fix: don't print
_TOKEN
suggestion when not applicable - cargo: fix: improve warning for both token & credential-provider
- rustdoc: add impl items from aliased type into sidebar
- rustdoc: add missing "Aliased type" title in the sidebar
- rustdoc: change syntax for anonymous functions set in JS
- rustdoc: list matching impls on type aliases
- rustdoc: render private fields in tuple
struct
as/* private fields */
- rustdoc: show inner
enum
andstruct
in type definition for concrete type - rustfmt: Prefer
light_rewrite_comment
if it is not a doccomment - rustfmt: fix checking if newline is needed before
else
in let-else statement - clippy:
implied_bounds_in_impls
: include (previously omitted) associated types in suggestion - clippy:
slow_vector_initialization
: use the source span ofvec![]
macro and fix another FP - clippy: add suggestions for
std_instead_of_core
- clippy: auto deref does not apply on union field
- clippy: check binary operators and attributes in
disallowed_macros
- clippy: ignore wildcards in function arguments and local bindings
- clippy: preserve literals and range kinds in
manual_range_patterns
- clippy: rename
incorrect_impls
tonon_canonical_impls,
move them to warn by default - rust-analyzer: add "Bind unused parameter" assist
- rust-analyzer: add
into_to_qualified_from
assist - rust-analyzer: diagnose mismatched arg count for tuple
struct
patterns - rust-analyzer: diagnose private fields in record constructor
- rust-analyzer: enable
rust_analyzer
for cfgs when code is being analyzed by rust-analyzer - rust-analyzer: implement
builtin#format_args,
using rustc'sformat_args
parser - rust-analyzer: on type format '(', by adding closing ')' automatically
- rust-analyzer: parse builtin# syntax and add typechecking for
builtin#offset_of
expression - rust-analyzer: clear native diagnostics on file closing
- rust-analyzer: disallow renaming of non-local items
- rust-analyzer: use crate name for
CARGO_CRATE_NAME
Rust Compiler Performance Triage
An interesting week. We saw a massive improvement to instruction-counts across over a hundred benchmarks, thanks to #110050 an improved encoding scheme for the dependency graphs that underlie incremental-compilation. However, these instruction-count improvements did not translate to direct cycle time improvements. We also saw an improvement to our artifact sizes due to #115306. Beyond that, we had a scattering of small regressions to instruction-counts that were justified because they were associated with bug fixes.
Triage done by @pnkfelix. Revision range: 15e52b05..7e0261e7
3 Regressions, 2 Improvements, 5 Mixed; 2 of them in rollups 84 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
- [disposition: merge] Cargo Check T-lang Policy
- [disposition: merge] [RFC2603] Extend
<const>
to includestr
and structural constants.
Tracking Issues & PRs
- [disposition: merge] Raise minimum supported Apple OS versions
- [disposition: merge] Stabilize const_transmute_copy
- [disposition: merge] Don't resolve generic impls that may be shadowed by dyn built-in impls
- [disposition: merge] closure field capturing: don't depend on alignment of packed fields
- [disposition: merge] Accept additional user-defined syntax classes in fenced code blocks
New and Updated RFCs
- [new] Unify crate categories and keywords as tags
- [new] RFC: Cargo feature visibility (private/public)
- [new] RFC: Cargo feature deprecation
- [new] RFC: Cargo feature descriptions
- [new] Unsafe Extern Blocks
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.
Upcoming Events
Rusty Events between 2023-09-13 - 2023-10-11 🦀
Virtual
- 2023-09-12 - 2023-09-15 | Virtual (Albuquerque, NM, US) | RustConf
- 2023-09-13 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-09-13 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-09-14 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-09-19 | Virtual (Washington, DC, US) | Rust DC
- 2023-09-20 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-09-20 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-09-21 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-09-21 | Virtual (Cologne, DE) | Cologne AWS User Group #AWSUGCGN
- 2023-09-21 | Virtual (Linz, AT) | Rust Linz
- 2023-09-21 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-09-25 | Virtual (Dublin, IE) | Rust Dublin
- 2023-09-26 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-10-03 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-10-04 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-10-04 | Virtual (Various) | Ferrous Systems
- 2023-10-07 | Virtual (Kampala, UG) | Rust Circle Kampala
- 2023-10-10 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-10-11| Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- [Monthly Meetup]https://www.meetup.com/boulder-elixir-rust/events/zvxcsryfcnbpb/)
Asia
- 2023-10-03 | Taipei, TW | WebAssembly and Rust Meetup (Wasm Empowering AI)
Europe
- 2023-09-13 | Cologne, DE | Rust User Group Cologne
- 2023-09-14 | Reading, UK | Reading Rust Workshop
- 2023-09-15 | Stuttgart, DE | Rust Community Stuttgart
- 2023-09-15 | Tiel, NL | Rust, Getting Started
- 2023-09-16 | Brussels, BE | HSBXL
- 2023-09-19 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2023-09-21 | Aarhus, DK | Rust Aarhus
- 2023-09-21 | Bern, CH | Rust Bern
- 2023-09-26 | Berlin, DE | OpenTechSchool Berlin
- 2023-09-28 | Berlin, DE | React Berlin
- 2023-09-28 | Madrid, ES | MadRust
- 2023-09-30 | Saint Petersburg, RU | Rust Saint Petersburg meetups
- 2023-10-10 | Berlin, DE | OpenTechSchool Berlin
North America
- 2023-09-12 - 2023-09-15 | Albuquerque, NM, US + Virtual | RustConf
- 2023-09-14 | Seattle, WA, US | Seattle Rust User Group Meetup
- 2023-09-16 | Mountain View, CA, US | Rust Breakfast and Learn
- 2023-09-19 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-09-21 | Lehi, UT, US | Utah Rust
- 2023-09-21 | Mountain View, CA, US| Mountain View Rust Meetup
- 2023-09-21 | Nashville, TN, US | Music City Rust Developers
- 2023-09-23 | Mountain View, CA, US | Rust Breakfast and Learn
- 2023-09-26 | Pasadena, CA, US | Pasadena Thursday Go/Rust
- 2023-09-27 | Austin, TX, US | Rust ATX
- 2023-09-30 | Mountain View, CA, US | Rust Breakfast and Learn
- 2023-10-07 | Mountain View, CA, US | Rust Breakfast and Learn
Oceania
- 2023-09-14 | Perth, WA, AU | Rust Perth
- 2023-09-19 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-09-26 | Canberra, ACT, AU | Rust Canberra
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
It's very much a positive feedback loop: good tooling makes good tooling easier to build, so more of it gets built and the cycle repeats.
cargo-semver-checks
stands on the shoulders of giants likerustc
andrustdoc
and Trustfall. Remove any one of them (or even justrustc
's high-quality diagnostics!) andcargo-semver-checks
wouldn't have been a viable project at all.
Thanks to Vincent de Phily 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