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
Newsletters
Project/Tooling Updates
Observations/Thoughts
- [video] Rust 1.71.1
- Exploring the Rust compiler benchmark suite
- Pre-RFC: Sandboxed, deterministic, reproducible, efficient Wasm compilation of proc macros
- RustShip: a new Rust podcast
Rust Walkthroughs
- [video] Delightful command-line utilities with Rust
- ESP32 Standard Library Embedded Rust: Analog Temperature Sensing using the ADC
- Bare Metal Space Invaders
- [series] Distributed Tracing in Rust, Episode 2: tracing basics
- Secure database access using Ockam
Research
Miscellaneous
Crate of the Week
This week's crate is document-features, a crate to extract documentation for the feature flags from comments in Cargo.toml.
Thanks to Zicklag for the 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 - CI step "Set toolchain version" can fail without stopping CI job 1
- ZeroCopy - Prevent panics statically 1
- RON - Rusty byte strings in RON, deprecate base64 (byte) strings
- heed - create guides on ways to use heed
- Ockam - Use a user-friendly name for the shared services to show it in the tray menu
- Ockam - In the
Share a service
window, thePort
should be renamed toAddress
and support such format - Ockam - In the
Share a service
window, theName
attribute should not have the/service/
prefix - Hyperswitch - remove unused function for merchant connector account
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
342 pull requests were merged in the last week
- Restrict the parsing of
count
(RFC #3086) custom_mir
: changeCall()
terminator syntax to something more readable- add MIR validation for unwind out from nounwind functions + fixes to make validation pass
- add missing Clone/Debug impls to SMIR Trait related tys
- add projection obligations when comparing impl too
- add the
relocation_model
to the cfg - avoid side-effects from
try_coerce
when suggesting borrowing LHS of cast - check projection args before substitution in new solver
- const-eval: ensure we never const-execute a function marked
rustc_do_not_const_check
- couple of global state and driver refactors
- deny
FnDef
in patterns - do not mark
shallow_lint_levels_on
aseval_always
- fix a stack overflow with long else if chains
- fix argument removal suggestion around macros
- fix bad suggestion when wrong parentheses around a dyn trait
- fix suggestion for attempting to define a string with single quotes
- improve
invalid_reference_casting
lint - instantiate response: no unnecessary new universe
- interpret/miri: call the
panic_nounwind
machinery the same way codegen does - match scrutinee need necessary parentheses for structs
- normalize before checking if local is freeze in
deduced_param_attrs
- normalize return type of
deduce_future_output_from_obligations
- only consider object candidates for object-safe dyn types in new solver
- point at return type when it influences non-first
match
arm - point out expectation even if we have
TypeError::RegionsInsufficientlyPolymorphic
- probe when assembling upcast candidates so they don't step on eachother's toes in new solver
- separate
consider_unsize_to_dyn_candidate
from other unsize candidates - speed up compilation of
type-system-chess
- stabilize thread local cell methods
- synchronize with all calls to
unpark
in id-based thread parker - upgrade std to gimli 0.28.0
- usage zero as language id for
FormatMessageW()
- use
unstable_target_features
when checking inline assembly - warn on inductive cycle in coherence leading to impls being considered not overlapping
- we are migrating to askama
- miri: C
mem
function shims: consistently treat "invalid" pointers as UB - miri: avoid unnecessary Vec resize
- miri: on out-of-bounds error, show where the allocation was created
- miri: pin a version of serde without intransparent unreproducible binary blobs
- miri: replace hand-written binary search with
Vec::binary_search_by
- miri: tree borrows: more comments in
foreign_read
transition - miri: when reporting a heap use-after-free, say where the allocation was allocated and deallocated
- only run MaybeInitializedPlaces dataflow once to elaborate drops
- optimize DroplessArena arena allocation
- optimizing the rest of bool's Ord implementation
- don't panic in
ceil_char_boundary
- expose
core::error::request_value
in std - fix UB in
std::sys::os::getenv()
- cleaner
assert_eq!
&assert_ne!
panic messages - inline
strlen_rt
inCStr::from_ptr
- cargo-credential-gnome-secret: dynamically load libsecret
- cargo: crate checksum lookup query should match on semver build metadata
- cargo: credential-providers: make 1password no longer built-in
- cargo: credential: rename cargo:basic to cargo:token-from-stdout
- cargo: fix: change the defaults to always check-in
Cargo.lock
- cargo: improve error message for when no credential providers are available
- cargo: login: allow passing additional args to provider
- cargo: make cargo-credential-gnome-secret built-in as cargo:libsecret
- cargo: print environment variables for
cargo run
in extra verbose mode - rustdoc: add warning block support in rustdoc
- rustdoc: add lint
redundant_explicit_links
- rustdoc: fixes with --test-run-directory and relative paths
- rustfmt: prevent ICE when formatting item-only
vec!{}
- rustfmt: remove newlines in where clauses for v2
- rustfmt: use
OR
operator in Cargo.tomllicense
field - clippy:
iter_overeager_cloned
: detect.cloned().map()
and.cloned().for_each()
- clippy:
new_without_default
: includewhere
clause in suggestions, make applicable - clippy:
useless_conversion
: only lint on paths to fn items and fix FP in macro - clippy: allow calling
to_owned
on borrowed value forimplicit_clone
- clippy: check that the suggested method exists in
unwrap_or_default
- clippy: correctly handle async blocks for
NEEDLESS_PASS_BY_REF_MUT
- clippy: new lint:
should_panic_without_expect
- rust-analyzer: add status bar button to toggle check on save state
- rust-analyzer: implement extern crate completion
- rust-analyzer: record import aliases in symbol index
- rust-analyzer: fix help text for rust-analyzer.check.invocation{Strategy,Location}
- rust-analyzer: fix signature help of methods from macros
- rust-analyzer: fix auto-import (and completions) importing
#[doc(hidden)]
items - rust-analyzer: rewrite DeMorgan assist
- rust-analyzer: start hovering default values of generic constants
- rust-analyzer: increase the buffer size for discover project command
- rust-analyzer: suggest type completions for type arguments and constant completions for constant arguments
- rust-analyzer: the "add missing members" assists: implemented substitution of default values of const params
- rust-analyzer: upgrade lsp server
Rust Compiler Performance Triage
A week with very few real regressions and some good improvements through work done by @cjgillot who found a few spots where the compiler was doing unnecessary work.
Triage done by @rylev. Revision range: e845910..d4a881
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
1.4% | [0.5%, 2.6%] | 13 |
Regressions ❌ (secondary) |
0.6% | [0.3%, 0.8%] | 8 |
Improvements ✅ (primary) |
-0.7% | [-1.4%, -0.3%] | 59 |
Improvements ✅ (secondary) |
-0.8% | [-1.3%, -0.3%] | 38 |
All ❌✅ (primary) | -0.3% | [-1.4%, 2.6%] | 72 |
3 Regressions, 2 Improvements, 2 Mixed; 2 of them in rollups 28 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
- [disposition: merge] Tracking Issue for const
[u8]::is_ascii
(const_slice_is_ascii
) - [disposition: merge] Implement
From<[T; N]>
forRc<[T]>
andArc<[T]>
- [disposition: merge] Tracking Issue for
Saturating
type - [disposition: merge] Implement
From<{&,&mut} [T; N]
> forVec<T>
whereT: Clone
- [disposition: merge] Tracking Issue for os_str_bytes
- [disposition: merge] Tracking Issue for
io::Error::other
- [disposition: merge]
impl TryFrom<char> for u16
- [disposition: merge] rustdoc: show inner enum and struct in type definition for concrete type
- [disposition: merge] Replace old private-in-public diagnostic with type privacy lints
- [disposition: merge] Implement
PartialOrd
andOrd
forDiscriminant
- [disposition: merge] stop adding dropck outlives requirements for
[T; 0]
- [disposition: merge] make Cell::swap panic if the Cells partially overlap
- [disposition: merge] Add note that Vec::as_mut_ptr() does not materialize a reference to the internal buffer
- [disposition: merge] Document lack of panic safety guarantees of
Clone::clone_from
- [disposition: merge] Command: also print removed env vars
- [disposition: merge] impl Step for IP addresses
New and Updated RFCs
- [new] RFC:
expose-fn-type
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-08-23 - 2023-09-20 🦀
Virtual
- 2023-08-23 | Virtual (Linz, AT) | Rust Linz
- 2023-08-24 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-08-24 | Virtual (Ciudad de México, MX) | Rust MX
- 2023-09-05 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-09-05 | Virtual (Munich, DE) | Rust Munich
- 2023-09-06 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-09-07 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-09-12 - 2023-09-15 | Virtual (Albuquerque, NM, US) | RustConf
- 2023-09-12 | Virtual (Dallas, TX, US) | Dallas Rust
- 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
Asia
- 2023-09-06 | Tel Aviv, IL | Rust TLV
Europe
- 2023-08-23 | London, UK | Rust London User Group
- 2023-08-24 | Aarhus, DK | Rust Aarhus
- 2023-08-30 | Copenhagen, DK | Copenhagen Rust Community
- 2023-08-31 | Augsburg, DE | Rust Meetup Augsburg
- 2023-09-05 | Munich, DE + Virtual | Rust Munich
- 2023-09-21 | Bern, CH | Rust Bern
North America
- 2023-08-23 | Austin, TX, US | Rust ATX
- 2023-08-24 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-09-06 | Bellevue, WA, US | The Linux Foundation
- 2023-09-12 - 2023-09-15 | Albuquerque, NM, US + Virtual | RustConf
- 2023-09-19 | San Francisco, CA, US | San Francisco Rust Study Group
Oceania
- 2023-08-24 | Brisbane, QLD, AU | Rust Brisbane
- 2023-09-13 | Perth, WA, AU | Rust Perth
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
[...] there's no benefit to haranguing people.
Unless they use three spaces for indentation. Those people need to be relentlessly mocked and publicly harassed until they see sense and use five spaces like all proper, civilised people do. Damn barbarians...
Thanks to Jonas Fassbender 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