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. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Official
- Announcing Rust 1.66.1
- Security advisory for Cargo (CVE-2022-46176)
- Updating the Android NDK in Rust 1.68
Foundation
Newsletters
Project/Tooling Updates
- Announcing turmoil
- rust-analyzer changelog #163
- rustc_codegen_gcc: Progress Report #19
- Fyrox 0.29 Feature Highlights
- Release of
how-u-doin
; a progress reporting abstraction - Introducing OkayWAL: A write-ahead log for Rust
Observations/Thoughts
- Rust Atomics and Locks by Mara Bos
- Oh the Crates You'll Go! A 2022 Retrospective
- Rust for Java developers, an introduction
- On Random Numbers
- Potential DoS Vulnerability in Rust Hyper
- Is coding in Rust as bad as in C++?
- Rust vs C++ Formatting
- My impressions of Rust after a year of working with it
- [audio] Fermyon with Matt Butcher
Rust Walkthroughs
- Rust and Default Parameters
- Testing SIMD instructions on ARM with Rust on Android
- Running Zola on WebAssembly
- Who needs Haskell? Straight to Rust Hell
- Sharing Data Among Tasks in Rust Embassy: Synchronization Primitives
- Cross compiling Rust with Drone CI and Gitea
Crate of the Week
This week's crate is schnellru, which contains a fast and flexible LRU map.
Thanks to Squirrel 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.
- Rust Playground - Call for contributors
- meilisearch - When the
lat
andlng
are strings the wrong error message is returned - meilisearch - Bad latitude / Bad longitude should share a common message between the invalid sort and invalid filte
- meilisearch - When both
lat
andlng
are missing it doesn't return the right error - meilisearch - We must return an error for when _geo is not an object
- diesel - A pure rust postgres diesel connection
- diesel - A pure rust mysql diesel connection implementation
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
443 pull requests were merged in the last week
- playStation Vita support
- add JSON output to -Zdump-mono-stats
- add default and latest stable edition to --edition in rustc (attempt 2)
- split
-Zchalk
flag into-Ztrait-solver=(classic|chalk|next)
flag - only specify
--target
by default for-Zgcc-ld=lld
on wasm - do not add
noalias
in return position has_overflow
only if value is not within limit- account for return-position
impl Trait
in trait inopt_suggest_box_span
- add help diag. for
const = Enum
missing braces aroundEnum
- add retry mechanism for rustdoc GUI tests to reduce flakyness
- add type flags support for
Ty
andConst
late-bound variables - always permit
ConstProp
to exploit arithmetic identities - correct detection of elided lifetimes in impl-trait
- default OOM handler: use non-unwinding panic, to match std handler
- detect bindings assigned blocks without tail expressions
- detect closures assigned to binding in block
- do not emit structured suggestion for turbofish with wrong span
- do not emit wrong E0308 suggestion for closure mismatch
- don't deduce a signature that makes a closure cyclic
- point at expressions where inference refines an unexpected type
- point out span where we could introduce higher-ranked lifetime
- reenable limited top-down MIR inlining
- remove invalid case for mutable borrow suggestion
- structured suggestion for
&mut dyn Iterator
when possible - suggest
impl Fn*
andimpl Future
in-> _
return suggestions - suggest
mut self: &mut Self
for?Sized
impls - suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs
- suggest using clone when we have &T and T implemented Clone
- suppress type errors that come from private fields
- inference: change a
commit_if_ok
call to probe - miri: ignore symbol shim clash when symbol is provided by
compiler_builtins
- miri: make
env::current_exe
work on Windows - only include metadata for non-dynamic libraries in rustc-dev
- merge borrowck permission checks
- don't normalize in AstConv
- perform
SimplifyLocals
beforeConstProp
- use
FxIndexSet
when updating obligation causes inadjust_fulfillment_errors_for_expr_obligation
- shrink
ParseResult
in the hot path - stabilize
main_separator_str
Split*::as_str
refactor- loosen the bound on the
Debug
implementation ofWeak
- customize
Debug
impl forOnceWith
&RepeatWith
- futures: add
PhantomData
marker to Context to make Context !Send and !Sync - futures: set to
None
only if necessary - arch: stabilize cmpxchg16b instrinsic
- cargo: cargo by default saves credentials to
.cargo/credentials.toml
- cargo: fix panic on target dependency errors
- rustdoc: fix rustdoc ICE on bad typedef with mismatching types
- clippy:
drop_ref
: don't lint idiomatic in match arm - clippy:
arithmetic_side_effects
: Consider negative numbers and add more tests - clippy: don't lint
field_reassign
when field in closure - clippy: expand derivable-impls to cover enums with a default unit variant
- clippy: fix false positive in
single_element_loop
- clippy: fix
empty_structs_with_brackets
suggestion errors - clippy: make the
iter_kv_map
lint handleref
/mut
annotations - clippy: suggest using
Path
for comparing extensions - clippy: trim paths in
box_default
anddefault_trait_access
/clone_on_copy
suggestions - rust-analyzer: add wrapping/checked/saturating assist
- rust-analyzer: apply fallback before final obligation resolution
- rust-analyzer: complete record enum variants without parens when snippets are disabled
- rust-analyzer:
extract_expressions_from_format_string
- rust-analyzer: add
unqualify_method_call
assist - rust-analyzer: add action to expand a declarative macro once, inline. Fixes #13598
- rust-analyzer: add the ability to limit the number of threads launched by
main_loop
- rust-analyzer: colorize
cargo check
diagnostics in VSCode via text decorations - rust-analyzer: add generic
TypeBoundList
in generated derivable impl - rust-analyzer: generate async delegate methods
- rust-analyzer: keep whitespace in extract function handler
- rust-analyzer: only set machine-applicable rustc diagnostics as preferred
- rust-analyzer: unescape inline module names in module resolution
- rust-analyzer: postfix adjustment hints
- rust-analyzer: skip lifetime elision on fn pointers and fn trait types
- rust-analyzer: use ZWNJ to prevent VSCode from forming ligatures between hints and code
- rust-analyzer: use diagnostic code as link to full message
Rust Compiler Performance Triage
A very quiet week, with few changes in either direction, and none of significant magnitude.
Triage done by @simulacrum. Revision range: b435960..0442fba
1 Regressions, 1 Improvements, 3 Mixed; 1 of them in rollups 48 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] Create an Operational Semantics Team
- [disposition: merge] RFC: Move
std::net::IpAddr
types intocore::net
.
Tracking Issues & PRs
- [disposition: merge] Add
SEMICOLON_IN_EXPRESSIONS_FROM_MACROS
to future-incompat report - [disposition: merge] Tracking issue for RFC 2515, "Permit impl Trait in type aliases"
- [disposition: merge] Check ADT fields for copy implementations considering regions
- [disposition: merge] Stabilise inline_const
- [disposition: merge] Partial stabilization of
once_cell
- [disposition: merge] Loosen
From<&[T]> for Box<[T]>
bound toT: Clone
- [disposition: merge] Leak amplification for peek_mut() to ensure BinaryHeap's invariant is always met
- [disposition: merge] rustdoc: simplify JS search routine by not messing with lev distance
- [disposition: merge] Only include stable lints in
rustdoc::all
group
New and Updated RFCs
- [new] The
#[diagnostic]
attribute namespace - [new] RFC: Multi-Type Return Position Impl Trait (MTRPIT)
- [new] RFC: re-export stdlib macros from submodules
- [new] Command improvements for ergonomics and error handling
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-01-11 - 2023-02-08 🦀
Virtual
- 2023-01-11 | Virtual (Boulder, CO, US) | Boulder Elixir and Rust
- 2023-01-12 | Virtual (San Francisco, CA, US; Stockholm, SE; New York, NY US) | Microsoft Reactor New York and Microsoft Reactor San Francisco and Microsoft Reactor Stockholm
- 2023-01-12 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2023-01-14 | Virtual | Rust GameDev
- 2023-01-16 | Virtual (San Francisco, CA, US; São Paulo, BR; New York, NY, US) | Microsoft Reactor San Francisco and Microsoft Reactor São Paulo and Microsoft Reactor New York
- 2023-01-17 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-01-17 | Virtual (San Francisco, CA, US; São Paulo, BR; New York, NY, US) | Microsoft Reactor San Francisco and Microsoft Reactor São Paulo and Microsoft Reactor New York
- 2023-01-17 | Virtual (Washington, DC, US) | Rust DC
- 2023-01-18 | Virtual (San Francisco, CA, US; São Paulo, BR; New York, NY US) | Microsoft Reactor San Francisco and Microsoft Reactor São Paulo and Microsoft Reactor New York
- 2023-01-18 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-01-19 | Virtual (Redmond, WA, US; San Francisco, CA, US; New York, NY, US; Stockholm, SE) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco and Microsoft Reactor Stockholm
- 2023-01-19 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-01-23 | Virtual (Durham, NC, US) | Triangle Rust
- 2023-01-23 | Virtual (New York, NY, US; San Francisco, CA, US) | Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-01-24 | Virtual (Redmond, WA, US; New York, NY, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-01-25 | Virtual (Redmond, WA, US; San Francisco, CA, US) | Microsoft Reactor Redmond | Microsoft Reactor San Francisco
- 2023-01-26 | Virtual (Charlottesville, VA, US) | Charlottesville Rust Meetup
- 2023-01-26 | Virtual (Redmond, WA, US; San Francisco, CA, US; New York, NY, US; Stockholm, SE) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco and Microsoft Reactor Stockholm
- 2023-01-30 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-01-31 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-01-31 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-01-31 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-02-01 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-01 | Virtual (Stuttgart, DE) | Rust Community Stuttgart
- 2023-02-06| Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-07 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
- 2023-02-07 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-02-07 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Reactor New York and Microsoft Reactor San Francisco
- 2023-02-08 | Virtual (Redmond, WA, US; New York, NY, US; San Francisco, CA, US) | Microsoft Reactor Redmond and Microsoft Rector New York and Microsoft Reactor San Francisco
Asia
- 2023-01-15 | Tokyo, JP | Tokyo Rust Meetup
Europe
- 2023-01-12 | Enschede, NL | Dutch Rust Meetup
- 2023-01-20 | Stuttgart, DE | Rust Community Stuttgart
- 2023-01-25 | Paris, FR | Rust Paris
- 2023-01-26 | Copenhagen, DK | Copenhagen Rust Meetup Group
- 2023-02-02 | Hamburg, DE | Rust Meetup Hamburg
- 2023-02-02 | Lyon, FR | Rust Lyon
North America
- 2023-01-11 | Austin, TX, US | Rust ATX
- 2023-01-17 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-01-26 | Copenhagen, DK | Copenhagen Rust group
- 2023-01-26 | Lehi, UT, US | Utah 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
Now macros are fine, I mean we use them for implementing internals and you know if you have something that [...] needs to be implemented for lots and lots of different concrete types, then macros are a fine choice for that, but exposing that to users is something to be very careful about.
llogiq is a tad sad there were no suggestions, but still likes the quote he ended up with!
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