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
- A tale of broken badges and 23,000 features
- crates.io: Dropping support for non-canonical downloads
- Generators are dead, long live coroutines, generators are back
Project/Tooling Updates
- ratatui 0.24.0 is released! (Rust library that's all about cooking up terminal user interfaces)
- git-cliff 1.4.0 is released! (highly customizable changelog generator)
- rust-analyzer changelog #205
- Progress report on rustc_codegen_cranelift (Oct 2023)
Observations/Thoughts
- System dependencies are hard (so we made them easier)
- Was Rust Worth It?
- Can Rust prevent logic errors?
- Faster Rust Serialization
- Dealing with Dependencies in Rust
- How I learned to stop worrying and love byte ordering
- How To Move Fast With Rust
- Starting a virtual Rust meet-up
- [video] Impl Trait aka Look ma’, no generics! by Jon Gjengset
Rust Walkthroughs
- Fully Automated Releases for Rust Projects
- The beauty of a Rust message processor
- interrupts is threads
- htmx, Rust & Shuttle: A New Rapid Prototyping Stack
- [video] Async Not Required 🦀
Research
- Functional Ownership through Fractional Uniqueness
- Grading on a Curve: How Rust can Facilitate New Contributors while Decreasing Vulnerabilities
Miscellaneous
Crate of the Week
This week's crate is silkenweb, a library for building web apps with fine-grained reactivity and a clean separation of logic and UI.
Thanks to henrik 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.
- pubgrub - Move to edition 2021
- pubgrub - Fix CI for conventional commits
- pubgrub - Rename v0.3 Range into BoundedRange
- pubgrub -
OfflineDependencyProvider
should get its own module - Ockam - Library - Slim down the
NodeManagerWorker
fornode / tcp
- Ockam - Make
ockam vault delete
(no args) interactive by asking the user to choose from a list of vaults to delete (tuify) - Ockam - Command - refactor to use typed interfaces to implement commands for
services
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
408 pull requests were merged in the last week
- -Zunpretty help: add missing possible values
- NVPTX: allow
PassMode::Direct
for ptx kernels for now OptWithInfcx
naming nits, trait bound simplificationsdeduce_param_attrs
: explain a read-only caserustc_interface
cleanupsstack_overflow: get_stackp
usingMAP_STACK
flag on dragonflybsd too- add bootstrap flag
--skip-stage0-validation
- add method to convert internal to stable constructs
- add support for i586-unknown-netbsd as target
- add support for mipsel-unknown-netbsd, 32-bit LE mips
- add target features for LoongArch
- add way to differentiate argument locals from other locals in Stable MIR
- allow partially moved values in match
- allow target specs to use an LLD flavor, and self-contained linking components
- allows
#[diagnostic::on_unimplemented]
attributes to have multiple - avoid repeated interning of
env!("CFG_RELEASE")
- avoid unbounded
O(n^2)
when parsing nested type args - avoid unnecessary builds/rebuilds of
rust-demangler
- avoid unnecessary renumbering during borrowck
- c-variadic error improvements
- consider alias bounds when computing liveness in NLL (but this time sound hopefully)
- const stabilize
mem::discriminant
- correctly handle nested or-patterns in exhaustiveness
- coverage: consistently remove unused counter IDs from expressions/mappings
- coverage: replace manual debug indents with nested tracing spans in
counters
- create
windows/api.rs
for safer FFI - create a new ConstantKind variant (ZeroSized) for StableMIR
- declare
rustc_target's
dependency on object/macho - deny providing explicit effect params
- derive
Ord
,PartialOrd
andHash
forSocketAddr*
- detect when trait is implemented for type and suggest importing it
- do not suggest
'Trait<Assoc=arg>'
when in trait impl - don't normalize to an un-revealed opaque when we hit the recursion limit
- don't treat closures/coroutine types as part of the public API
- don't use LFS64 symbols on musl
- eat close paren if
capture_cfg
to avoid unbalanced parens - enable
cg_clif
tests for riscv64gc - fail typeck for illegal break-with-value
- fix ICE: Restrict param constraint suggestion
- fix failure to detect a too-big-type after adding padding
- fix inline const pattern unsafety checking in THIR
- fix missing leading space in suggestion
- fix unused variables lint issue for args in macro
- fix unwrap suggestion for async fn
- generate aggregate constants in DataflowConstProp
- handle
ReErased
in responses in new solver - ignore RPIT duplicated lifetimes in
opaque_types_defined_by
- implement C ABI lowering for CSKY
- implement
gen
blocks in the 2024 edition - improve android-ndk property interface
- improve some diagnostics around
?Trait
bounds - improve the warning messages for the
#[diagnostic::on_unimplemented]
- increase the reach of
panic_immediate_abort
- intern
LocalDefId
list fromopaque_types_defined_by
query - introduce
-C instrument-coverage=branch
to gate branch coverage - invalid
?
suggestion on mismatchedOk(T)
- lint overlapping ranges as a separate pass
- mark
.rmeta
files as/SAFESEH
on x86 Windows - mark constructor of
BinaryHeap
as const fn - never consider raw pointer casts to be trival
- on object safety error, mention new
enum
as alternative - on unresolved imports, suggest a disambiguated path if necessary to avoid collision with local items
- only call
mir_const_qualif
if absolutely necessary - only emit one error per unsized binding, instead of one per usage
- poison
check_well_formed
if method receivers are invalid to prevent typeck from running on it - print variadic argument pattern in HIR pretty printer
- properly restore snapshot when failing to recover parsing ternary
- quietly fail if an error has already occurred
- rand use getrandom for freebsd (available since 12.x)
- refactor type visitor walking
- remap Cargo dependencies to /rust/deps
- remove -Zdep-tasks
- remove Apple RNG fallbacks and simplify implementation
- remove fold code and add
Const::internal()
to StableMIR - remove support for alias
-Z instrument-coverage
- require target features to match exactly during inlining
- return multiple object-safety violation errors and code improvements to the object-safety check
- return unfixed len if pat has reported error
- rework negative coherence to properly consider impls that only partly overlap
- rustdoc: elide cross-crate default generic arguments
- rustdoc: use
ThinVec
inGenericParamDefKind
- see through aggregates in GVN
- separate move path tracking between borrowck and drop elaboration
- share some
track_caller
logic between interpret and codegen - small
ty::print
cleanups - some diagnostics improvements of
gen
blocks - stash and cancel cycle errors for auto trait leakage in opaques
- stop telling people to submit bugs for internal feature ICEs
- store
#[stable]
attribute'ssince
value in structured form - suggest assoc fn
new
when trying to build tuplestruct
with private fields - suggest unwrap/expect for let binding type mismatch
- tvOS simulator support on Apple Silicon for rustc
- tweak suggestion span for outer attr and point at item following invalid inner attr
- uplift
Canonical
torustc_type_ir
- uplift
ClauseKind
andPredicateKind
intorustc_type_ir
- use ImageDataType for allocation type
- validate
feature
andsince
values inside#[stable(…)]
- when encountering sealed traits, point types that implement it
- when expecting closure argument but finding block provide suggestion
- work around the fact that
check_mod_type_wf
may spuriously returnErrorGuaranteed
- time: use
clock_gettime
on macos - windows: support sub-millisecond sleep
- refactor some
char
,u8
ASCII functions to be branchless - add
#[inline]
to some recalcitrantops::range
methods - stabilize ratified RISC-V Target Features
- stabilize
[const_]pointer_byte_offsets
- stabilize inline asm usage with
rustc_codegen_cranelift
- futures: add
TryAll
andTryAny
adapters - futures: fix
Sync
impl ofFuturesUnordered
- futures: provide AtomicWaker if portable-atomic feature is enabled, even if atomic CAS is not available
- codegen_gcc: add basics for
test
command in build system - codegen_gcc: fix
volatile_load
- cargo toml: Allow version-less manifests
- cargo toml: Decouple parsing from interning system
- cargo: shell: Write at once rather than in fragments
- cargo: add new packages to
[workspace.members]
automatically - cargo: move up looking at index summary
enum
- cargo: remove duplicate binaries during install
- cargo: remove outdated option to
-Zcheck-cfg
warnings - rustfmt: fixed error caused by combination of
match_arm_blocks
andcontrol_brace_style
- clippy:
ignored_unit_patterns
: check &(), &&(), - clippy:
iter_without_into_iter
: fix papercuts in suggestion and restrict linting to exported types - clippy:
let_and_return
: Wrap with parenthesis if necessary - clippy: add
waker_clone_and_wake
lint to check needlessWaker
clones - clippy: fix missing parenthesis in suboptimal floating point help
- clippy: ignore lower-camel-case words in
doc_markdown
- clippy: move
read_zero_byte_vec
to nursery - clippy: remove internal feature from
clippy_utils
- clippy: remove the
internal_warn
lint category - rust-analyzer: make
extract_variable
assist in place
Rust Compiler Performance Triage
This week we have two sets of results as last week's arrived later than the publish date:
Triage done by @rylev and @simulacrum.
Revision range: b9832e72..650991d
Across both reports:
9 Regressions, 7 Improvements, 5 Mixed 127 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] Lifetime Capture Rules 2024
- [disposition: merge] Add "crates.io Policy Update" RFC
Tracking Issues & PRs
- [disposition: merge] Override
Waker::clone
_from to avoid cloning Wakers unnecessarily - [disposition: merge] dropck_outlives check whether generator witness needs_drop
- [disposition: merge] stricter hidden type wf-check
- [disposition: merge] Tracking Issue for the GroupBy and GroupByMut iterators
- [disposition: merge] Don't panic in
<BorrowedCursor as io::Write>::write
- [disposition: merge] Guarantee that
char
has the same size and alignment asu32
- [disposition: merge] Stabilize
const_maybe_uninit_zeroed
andconst_mem_zeroed
- [disposition: merge] Clarify UB in
get_unchecked(_mut)
- [disposition: merge] document that the null pointer has the 0 address
- [disposition: close] regression: parameter type may not live long enough
Language Reference
- [disposition: merge] Guarantee that raw pointer conversions preserve slice element count
Unsafe Code Guidelines
- No Unsafe Code Guideline RFCs entered Final Comment Period this week.
New and Updated RFCs
- No New or Updated RFCs were created this week.
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-11-01 - 2023-11-29 🦀
Virtual
- 2023-11-01 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-11-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2023-11-02 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-11-07 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-11-07 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
- 2023-11-09 | Virtual (Nuremberg, DE) | Rust Nuremberg
- 2023-11-14 | Virtual (Dallas, TX, US) | Dallas Rust
- 2023-11-15 | Virtual (Cardiff, UK)| Rust and C++ Cardiff
- 2023-11-15 | Virtual (Richmond, VA, US) | Linux Plumbers Conference
- 2023-11-15 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2023-11-16 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2023-11-21 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2023-11-21 | Virtual (Washington, DC, US) | Rust DC
- 2023-11-28 | Virtual (Dallas, TX, US) | Dallas Rust
Europe
- 2023-11-01 | Cologne, DE | Rust Cologne
- 2023-11-07 | Bratislava, SK | Bratislava Rust Meetup Group
- 2023-11-07 | Aarhus, DK | Rust Aarhus
- 2023-11-07 | Lyon, FR | Rust Lyon
- 2023-11-09 | Barcelona, ES | BcnRust
- 2023-11-09 | Paris, FR | Paris Rustaceans
- 2023-11-09 | Reading, UK | Reading Rust Workshop
- 2023-11-21 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2023-11-23 | Biel/Bienne, CH | Rust Bern
North America
- 2023-11-01 | Brookline, MA, US | Boston Rust Meetup
- 2023-11-02 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-11-08 | Boulder, CO, US | Boulder Rust Meetup
- 2023-11-14 | New York, NY, US | Rust NYC
- 2023-11-14 | Seattle, WA, US | Cap Hill Rust Coding/Hacking/Learning
- 2023-11-15 | Richmond, VA, US + Virtual | Linux Plumbers Conference
- 2023-11-16 | Mountain View, CA, US | Mountain View Rust Meetup
- 2023-11-16 | Nashville, TN, US | Music City Rust Developers
- 2023-11-16 | Seattle, WA, US | Seattle Rust User Group
- 2023-11-21 | San Francisco, CA, US | San Francisco Rust Study Group
- 2023-11-22 | Austin, TX, US | Rust ATX
Oceania
- 2023-11-06 | Perth, WA, AU | Rust Perth Meetup Group
- 2023-11-21 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2023-11-28 | 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
After doing a best fit, we found Rust projects were less likely to introduce vulnerabilities than their equivalent C++ projects at all relevant experience levels, but more importantly, we found the effect was most significant for first-time contributors, who were almost two orders of magnitude less likely to contribute vulnerabilities. That is, even though Rust may have a reputation as a harder language to learn, there is a very measurable effect that makes it better for newbies. Reviewers should not have to put as much effort into reviewing code to be confident that someone making their first foray into their project is accidentally adding a vulnerability.
Thanks to Brian Kung 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