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
- Announcing
async fn
and return-positionimpl Trait
in traits - Rustc Trait System Refactor Initiative Update: A call for testing
Foundation
Project/Tooling Updates
Observations/Thoughts
- My path to becoming a Rustacean
- Memory Safety is a Red Herring
- The Most Common Rust Compiler Errors as Encountered in RustRover: Part 2
- My reference was dropped, why is the compiler complaining about multiple borrows?
- Can CppRef be ergonomic?
- [video] Rust 1.74.1 & Rust News
Rust Walkthroughs
- The dark side of inlining and monomorphization
- The Heart of a Language Server
- Rust: Multi threading
- [series] Meilisearch Expands Search Power with Arroy's Filtered Disk ANN
- Encrypted Portals between Macs – built in Rust and Swift (sorta similar to ngrok and tailscale)
- [video] Error handling in Rust
Miscellaneous
- An anonymous survey about mutable statics
- Web development in Rust
- Rocket: Web-based Hello World! with tests
Crate of the Week
This week's crate is rouille, a small synchronous web framework.
Thanks to Peter Puetz for the suggestion!
Please submit your suggestions and votes for next week!
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.
- greptimedb - Add more tables into
information_schema
for better compatibility - Ockam - Check that the bootstrap_server command argument is a valid host:port
- Ockam - Refactor to use typed interfaces
- Ockam - Check structs comply with the cddl schema
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.
- No new calls for speakers this week
If you are an event organizer hoping to expand the reach of your event, please submit a link to the submission website either through a PR to TWiR or on the [Rust-lang forums].[link TBD]
Updates from the Rust Project
268 pull requests were merged in the last week
- add support for
for await
loops - add illumos aarch64 target for rust
- add support for hexagon-unknown-none-elf as target
- -Znext-solver: adapt overflow rules to avoid breakage
rustc_codegen_ssa
: Don't dropIncorrectCguReuseType
, makerustc_expected_cgu_reuse
attr worksubtype_predicate
: remove unnecessary probe- add check for possible
CStr
literals in pre-2021 - add method to get instance instantiation arguments
- add missing feature gate for sanitizer CFI cfgs
- avoid redundant Option for
cross_crate_inlinable
- coverage: check for
async fn
explicitly, without needing a heuristic - do not allow ABI mismatches inside
repr(C)
types - do not fetch HIR in
inferred_outlives_of
- emit better suggestions for
&T == T
andT == &T
- emits error if has bound regions
- encode
CoroutineKind
directly - exhaustiveness: improve complexity on some wide matches
- exhaustiveness: keep the original
thir::Pat
around - exhaustiveness: reveal empty opaques in depth
- exhaustiveness: reveal opaque types properly
- fallback
default
toNone
during ast-lowering for lifetime binder - fix ICE when using raw ptr in a pattern
- fix crash due to
CrateItem::kind()
not handling constructors - give temporaries in if let guards correct scopes
- make
soft_unstable
show up in future breakage reports - make closures carry their own ClosureKind
- mark
ty::Const::Error
when meet unsupport ty for const generic params - pass
DeadItem
and lint as consistent group in dead-code - remove
DiagCtxt
API duplication - remove metadata decoding
DefPathHash
cache - resolve: eagerly feed closure visibilities
- resolve: feed visibilities for unresolved trait impl items
- resolve: stop feeding visibilities for import list stems
- rework
-Zverbose
- simple modification of
non_lifetime_binders
's diagnostic information to adapt to type binders - skip duplicate stable crate ID encoding into metadata
- split coroutine desugaring kind from source
- subtree sync for
rustc_codegen_cranelift
- suggest
=
to==
in more cases, even in the face of reference mismatch - add function ABI and type layout to StableMIR
- separate MIR lints from validation
- miri: implement and test
simd_masked_load
andsimd_masked_store
- improve coding efficiency for
RawDefId
- use
Vec
for region constraints instead ofBTreeMap
- stabilize
file_create_new
- stabilize
ip_in_core
feature - add more niches to rawvec
- add
IntoAsyncIterator
- add
hint::assert_unchecked
- cargo: extend the build directive syntax with
cargo:
: - cargo: hold the mutate exclusive lock when vendoring
- cargo: refactor: centralize git checkouts and db paths
- cargo: refactor: custom error types for
cargo-util-schemas
- cargo: rework
--check-cfg
generation comment - rustdoc: Add
is_object_safe
information for traits in JSON output - rustdoc: fix display of warning block if it is first element of the top doc block
- clippy:
question_mark
: also trigger onreturn
statements - clippy: check whether out of bound when access a known length array with a constant index
- clippy: do not consider
async { (impl IntoFuture).await }
as redundant - clippy: extend
UNNECESSARY_TO_OWNED
to handlesplit
- clippy: move
uninhabited_references
tonursery
- clippy: new lints
iter_filter_is_some
anditer_filter_is_ok
- clippy: stop
bool_comparison
's suggestion from consuming parentheses - rust-analyzer: complete exported macros in
#[macro_use($0)]
- rust-analyzer: implement a rust-analyzer span backed proc-macro server mode
- rust-analyzer: auto remove unnecessary braces after remove unused imports
- rust-analyzer: correctly set and mark the proc-macro spans
- rust-analyzer: fix completions analysis not caching all nodes in Semantics
- rust-analyzer: fix span marking for builtin fn macros
- rust-analyzer: fully remove dummy spans
- rust-analyzer: remove wrong comma after remove unnecessary braces
Rust Compiler Performance Triage
Some of the recent noise swings have been appearing again this week, but luckily less often than before. There were a few actual regressions, but most of them were localized to a single stress test. On the other hand, there were a few very nice wins across the board, especially for check and incremental builds, primarily thanks to #118824 and #119265.
Triage done by @kobzol. Revision range: bf9229a2e366b4c311f059014a4aa08af16de5d8..1ab783112ab4e4807304dbd249b39771246013ef
Summary:
(instructions:u) | mean | range | count |
---|---|---|---|
Regressions ❌ (primary) |
0.6% | [0.6%, 0.6%] | 1 |
Regressions ❌ (secondary) |
2.5% | [0.3%, 4.2%] | 10 |
Improvements ✅ (primary) |
-0.8% | [-3.3%, -0.1%] | 180 |
Improvements ✅ (secondary) |
-1.2% | [-5.5%, -0.2%] | 109 |
All ❌✅ (primary) | -0.8% | [-3.3%, 0.6%] | 181 |
5 Regressions, 7 Improvements, 2 Mixed; 1 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
- [disposition: merge] Use version-sorting for all sorting
- [disposition: merge] Tracking issue for exclusive range patterns
- [disposition: merge] rustdoc: clean up source sidebar hide button
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:
- 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-12-27 - 2024-01-24 🦀
Virtual
- 2023-12-28 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-01-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-01-11 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-16 | Virtual (Washington, DC, US) | Rust DC
Europe
- 2023-12-27 | Copenhagen, DK | Copenhagen Rust Community
- 2023-12-28 | Vienna, AT | Rust Vienna
- 2024-01-11 | Reading, UK | Reading Rust Workshop
- 2024-01-11 | Wrocław, PL | Rust Wrocław
- 2024-01-13 | Helsinki, FI | Finland Rust-lang Group
North America
- 2023-12-27 | Austin, TX, US | Rust ATX
- 2024-01-06 | Boston, MA, US | Boston Rust Meetup
- 2024-01-08 | Chicago, IL, US | Deep Dish Rust
- 2024-01-09 | Seattle, WA, US | Cap Hill Rust Coding/Hacking/Learning
- 2024-01-09 | Minneapolis, MN, US | Minneapolis Rust Meetup
- 2024-01-14 | Cambridge, MA, US | Boston Rust Meetup
- 2024-01-16 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-01-17 | Chicago, IL, US | Deep Dish 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
Rust can be rather more verbose than C; there are a lot of invariants that have to be expressed in the code. But that is countered by the need for far less error-handling code; it turns out to be a wash, with the size of the two implementations being about the same.
– Alice Ryhl at the Linux Plumbers Conference as quoted by Jonathan Corbet, LWN
Thanks to Ivan Fraixedes 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