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
Foundation
Newsletters
Project/Tooling Updates
- Maestro - Introduction
- Polars
- rust-analyzer changelog #215
- argmin 0.9.0 - a Rust crate for numerical optimization
- Continuous benchmarking for rustls
- embedded-hal v1.0 now released!
Observations/Thoughts
- Arrays: index out of bounds error? Not always!
- What I'd like to see for Async Rust in 2024
- Securing the Web: Rustls on track to outperform OpenSSL
- Inception style builds with private GitHub dependencies
- Verifying Rust Zeroize with Assembly...including portable SIMD
- Why stdout is faster than stderr?
- [audio] Rust Audio Programming with Ian Hobson
- [audio] Polars with Ritchie Vink
Rust Walkthroughs
- Getting Started with Tracing in Rust
- Doing First Grade Math in Rust's Type System
- Let's make an information display in rust
Miscellaneous
- 3 ways to handle number overflow or underflow in Rust
- Rocket - multi-counter using cookies
- unwrap, one way to handle errors in Rust
- [video] Top 10 Games from Bevy Jam 4
- [video] you need to build a RUST desktop app!!
Crate of the Week
This week's crate is named-sem, a wrapper library for named semaphores on Linux & Windows.
Thanks to EvianZhang for the self-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.
- Ockam - refactor to use typed interfaces to implement commands for
kafka services
- Ockam - refactor to use typed interfaces to implement commands for
workers
- Ockam - Validate CBOR structs according to the cddl schema for
nodes/models/transport
andnodes/models/workers
- Hyperswitch - Make cache configuration configurable at runtime
- Hyperswitch - Implement Code cov for local system using makefile
- Hyperswitch - Setup code coverage for local tests & CI
- Hyperswitch - Add domain type for client secret
- Hyperswitch - Have get_required_value to use ValidationError in OptionExt
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 calls for submissions sent this week.
If you are an event organizer hoping to expand the reach of your event, please submit a link to the submission website through a PR to TWiR.
Updates from the Rust Project
446 pull requests were merged in the last week
- promote
riscv32{im|imafc}
targets to tier 2 - add
riscv32imafc-esp-espidf
tier 3 target for the ESP32-P4 - support
reg_addr
register class in s390x inline assembly - add -Zuse-sync-unwind
macro_rules
: Add an expansion-local cache to span markermacro_rules
: Less hacky heuristic for usingtt
metavariable spansrustc_mir_transform
: Enforcerustc::potential_query_instability
lintrustc_mir_transform
: Make DestinationPropagation stable for queriesrustc_span
: More consistent span combination operationsrustc_span
: Optimize syntax context comparisons- allow coverage tests to ignore test modes, and to enable color in coverage reports
- avoid specialization in the metadata serialization code
- check yield terminator's resume type in borrowck
- coverage:
llvm-cov
expects column numbers to be bytes, not code points - coverage: anonymize line numbers in branch views
- coverage: avoid a query stability hazard in
function_coverage_map
- coverage: hoist some complex code out of the main span refinement loop
- deny defaults for higher-ranked generic parameters
- don't synthesize host effect args inside trait object types
- don't synthesize host effect params for trait associated functions marked const
- enable address sanitizer for MSVC targets using INFERASANLIBS linker flag
- exhaustiveness: statically enforce revealing of opaques
- fix scoping for let chains in match guards
- handle ForeignItem as TAIT scope
- hide foreign
#[doc(hidden)]
paths in import suggestions - impl trait diagnostic tweaks
- imply outlives-bounds on lazy type aliases
- improved support of
collapse_debuginfo
attribute for macros - inline a few utility functions around MIR
- llvm: allow
noundef
in codegen tests - make
derive(Trait)
suggestion more accurate - make
named_asm_labels
lint not trigger on unicode and trigger on format args - make inductive cycles in coherence ambiguous always
- mark myself as back from leave
- migrate memory overlap check from validator to lint
- populate
yield
andresume
types in MIR body while body is being initialized - pretty-print always-const trait predicates correctly
- query
panic!()
to useful diagnostic - recover parentheses in range patterns
- reland optimized-compiler-builtins config
- reorder
check_item_type
diagnostics so they occur next to the correspondingcheck_well_formed
diagnostics - replace a number of FxHashMaps/Sets with stable-iteration-order alternatives
- separate immediate and in-memory ScalarPair representation
- set the
in-rust-tree
feature for all rust-analyzer{-proc-macro-srv} steps - skip threading over no-op SetDiscriminant
- stabilize THIR unsafeck
- stop feed vis when cant access for trait item
- support
~const
in associated functions in trait impls - suppress change-tracker warnings in CI containers
- switch from using
//~ERROR
annotations with--error-format
toerror-pattern
- temporarily disable M1 runners on GitHub Actions
- tweak suggestions for bare trait used as a type
- use
resolutions(()).effective_visiblities
to avoid cycle errors inreport_object_error
- custom mir: make it clear what the return block is
- miri: implement the rounding intrinsics using apfloat rounding
- miri: use jemalloc as global allocator
- miri: only use jemalloc on Linux and macOS
- strip lld-wrapper binaries
- two small bitset optimisations
- codegen-cranelift: restructure x86 signed pack instructions
- make
intrinsics::assume
const stable - rewrite
Iterator::position
default impl - make
offset_of
field parsing use metavariable which handles any spacing - mark
vec::IntoIter
pointers as!nonnull
- cargo fix: Call rustc fewer times
- cargo fix: set
OUT_DIR
for all units with build scripts - cargo cli: add colors to
-Zhelp
console output - cargo embedded: Add multiple experimental manifest syntaxes
- cargo embedded: Add prefix-char frontmatter syntax support
- cargo manifest: Provide unused key warnings for lints table
- cargo: deprecate rustc plugin support
- cargo: test: support publish package with a
public
field - rustdoc: Fix invalid handling for static method calls in jump to definition feature
- rustdoc ui: adjust tooltip z-index to be above sidebar
- rustdoc-search: fix inaccurate type descriptions
- rustdoc-search: tighter encoding for f index
- rustdoc: search for tuples and unit by type with
()
- rustfmt: fix
enum
variant doc comments wrapped beforecomment_width
- clippy: add
.as_ref()
to suggestion to remove.to_string()
- clippy: extend
map_clone
lint to also work on non-explicit closures - clippy: extend
unconditional_recursion
lint to check forDefault
trait implementation - clippy: do not suggest
[T; n]
instead ofvec![T; n]
ifT
is notCopy
- clippy: do not suggest
bool::then()
andbool::then_some
inconst
contexts - clippy: don't change eagerness for
struct
literal syntax with significant drop - clippy: don't emit
struct_field_names
lint if all fields are booleans and don't start with the type's name - clippy: don't lint
let_unit_value
when()
is explicit - clippy: don't look for safety comments in doc tests
- clippy: fix false positive
unconditional_recursion
- clippy: don't escape
"
in'"'
- clippy: fix ICE in
iter_filter_is_some
/iter_filter_is_ok
- clippy: allow 3-digit-grouped binary in
non_octal_unix_permissions
- clippy: fix: metadata-collector lists wrong affected lints
- clippy:
identity_op
: correctly suggest a deference for coerced references - clippy: handle "calls" inside the closure as well in
map_clone
lint - clippy: improve
cast_sign_loss
to skip warning on always positive expressions - clippy: lint nested binary operations and handle field projections in
eager_transmute
- clippy: new lint:
option_as_ref_cloned
- rust-analyzer: completion: make the expected type a tad smarter with
Fn
s - rust-analyzer: builtin derives are hygienic
- rust-analyzer: don't trim trailing whitespace from doc comments
- rust-analyzer: IDE features for primitive tuple fields
- rust-analyzer: add assoc func quickfix for
unresolved_method
diagnostic - rust-analyzer: add inlay hint for exclusive ranges
- rust-analyzer: add proc-macro rebuild on save option
- rust-analyzer: add quickfix for
redundant_assoc_item
diagnostic - rust-analyzer: add unresolved associated item diagnostic
- rust-analyzer: resolve inherent and implemented associated items in docs
- rust-analyzer:
extract_struct_from_enum_variant
assist should resolve Self generic arg - rust-analyzer: assists panic when trying to edit usage inside macro
- rust-analyzer: correct references from
rust-analyzer.cargo.check
torust-analyzer.check
- rust-analyzer: fix focus range being discarded in attributes/derives when upmapping
- rust-analyzer: fix panic on unaligned packed attribute
- rust-analyzer: fix type inference with
IndexMut
returning references - rust-analyzer: give a userful error when rustc cannot be found in explicit sysroot
- rust-analyzer: make callable fields not complete in method access no parens case
- rust-analyzer: make functions in impl have a container name
- rust-analyzer: no code action
'introduce_named_generic'
for impl inside types - rust-analyzer: notify user that linkedProjects is set when failing to discover projects
- rust-analyzer: pick up new names when the name conflicts in
'introduce_named_generic'
- rust-analyzer: remove completion limit for trait importing method completions
- rust-analyzer: rewrite
code_action generate_delegate_trait
- rust-analyzer: self type replacement in inline-function
Rust Compiler Performance Triage
Not a particularly notable week. Large swings aren't spurious but also are driven by changes in high-level behavior (diagnostics going from zero to one emission primarily), which causes a lot more work to happen. This isn't really representative of the underlying rustc performance changing though.
Triage done by @simulacrum. Revision range: 67b6975..76101ee
4 Regressions, 4 Improvements, 6 Mixed; 1 of them in rollups 33 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
- [disposition: merge] RFC: constants in patterns
- [disposition: merge] Add RFC combining Infra and Release teams
- [disposition: merge] RFC: Precise Pre-release
cargo update
- [disposition: postpone] [Draft] RFC: Patch dependencies using unidiff patchfiles
Tracking Issues & PRs
- [disposition: merge] error on incorrect implied bounds in wfcheck except for Bevy dependents
- [disposition: merge] Stabilize
slice_first_last_chunk
- [disposition: merge] Warn on references casting to bigger memory layout
- [disposition: merge] const-eval interning: get rid of type-driven traversal
- [disposition: merge] Tracking Issue for
round_ties_even
- [disposition: merge] Stabilize single-field offset_of
- [disposition: merge] revert stabilization of const_intrinsic_copy
- [disposition: merge] [rustdoc] Allows links in headings
- [disposition: merge] Use version-sorting for all sorting
- [disposition: merge] Deny braced macro invocations in let-else
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 2024-01-10 - 2024-02-07 🦀
Virtual
- 2024-01-11 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-11 | Virtual (Nürnberg, DE) | Rust Nuremberg
- 2024-01-11 | Virtual (San Diego, CA, US) | San Diego Rust
- 2024-01-16 | Virtual (Washington, DC, US) | Rust DC
- 2024-01-17 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-01-21 | Virtual | Rust Maven
- 2024-01-23 | Virtual (Halifax, NS, CA) | Rust Halifax
- 2024-01-24 | Virtual (Berlin, DE) | WeAreDevelopers Community
- 2024-01-25 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-01-25 | Virtual (Mexico City, DF, MX) | Rust MX
- 2024-01-28 | Virtual (Wrocław, PL) | Stacja IT Wrocław
- 2024-01-30 | Virtual | Bevy Game Development
- 2024-01-30 | Virtual (Buffalo, NY, US) | Buffalo Rust User Group
- 2024-01-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-02-01 | Virtual (Berlin, DE) | OpenTechSchool Berlin
- 2024-02-03 | Virtual + In-person (Brussels, BE) | FOSDEM 2024
- 2024-02-03 | Virtual (Kampala, UG) | Rust Circle
- 2024-02-07 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-02-08 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
Europe
- 2024-01-10 | Cologne, DE | Rust Cologne
- 2024-01-11 | Reading, UK | Reading Rust Workshop
- 2024-01-11 | Wrocław, PL | Rust Wrocław
- 2024-01-13 | Tampere, FI | Finland Rust-lang Group
- 2024-01-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-01-17 | Girona, ES | Rust Girona
- 2024-01-17 | Praha / Prague, CZ | Rust Prague
- 2024-01-17 | Zurich, CH | Rust Zurich
- 2024-01-23 | Aarhus, DK | Rust Aarhus
- 2024-01-23 | Paris, FR | Rust Paris
- 2024-02-01 | Barcelona, ES | BcnRust
- 2024-02-03 | Brussels, BE | FOSDEM '24
North America
- 2024-01-11 | Lehi, UT, US | Utah Rust
- 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
- 2024-01-18 | Seattle, WA, US | Seattle Rust User Group
- 2024-01-22 | Boston, MA, US | Boston Rust Meetup
- 2024-01-24 | Austin, TX, US | Rust ATX
- 2024-01-27-28 | Calgary, AB, CA | Rust Calgary
- 2024-01-30 | Cambridge, MA, US | Boston Rust Meetup
- 2024-02-07 | Brookline, MA, US | Boston Rust Meetup
Oceania
- 2024-01-16 | Christchurch, NZ | Christchurch Rust Meetup Group
- 2024-02-06 | Perth, WA, AU | Perth Rust Meetup Group
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
- Modular
- Very high quality construction compared to its competitors
- If you leave it lying around forget about it, stepping into a project is painful?
– Leonardo Giovanni Scur on mastodon explaining how bevy is like Lego™
Thanks to Jan Riemer 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