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.
This week's crate is cargo-unfmt, a formatter that formats your code into block-justified text, which sacrifices some readability for esthetics.
Thanks to Felix Prasanna for the self-suggestion!
Please submit your suggestions and votes for next week!
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 calls for testing were issued 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.
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.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
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.
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.
431 pull requests were merged in the last week
- CFI: (actually) check that methods are object-safe before projecting their receivers to
dyn Trait in CFI
- CFI: abstract Closures and Coroutines
- CFI: fix drop and
drop_in_place
- CFI: fix methods as function pointer cast
- CFI: support calling methods on supertraits
- add a
CurrentGcx type to let the deadlock handler access TyCtxt
- add basic trait impls for
f16 and f128
- add detection of (
Partial )Ord methods in the ambiguous_wide_pointer_comparisons lint
- add rust-lldb pretty printing for Path and PathBuf
- assert that ADTs have the right number of args
- codegen const panic messages as function calls
- coverage: re-enable
UnreachablePropagation for coverage builds
- delegation: fix ICE on wrong
Self instantiation
- delegation: fix ICE on wrong
self resolution
- do not attempt to write
ty::Err on binding that isn't from current HIR Owner
- don't check match scrutinee of postfix match for unused parens
- don't inherit codegen attrs from parent static
- eagerly instantiate closure/coroutine-like bounds with placeholders to deal with binders correctly
- eliminate
UbChecks for non-standard libraries
- ensure std is prepared for cross-targets
- fix diagnostics for async block cloning
- fixup parsing of
rustc_never_type_options attribute
- function ABI is irrelevant for reachability
- improve example on inserting to a sorted vector to avoid shifting equal elements
- in
ConstructCoroutineInClosureShim , pass receiver by mut ref, not mut pointer
- load missing type of impl associated constant from trait definition
- make
TyCtxt::coroutine_layout take coroutine's kind parameter
- match ergonomics 2024: implement mutable by-reference bindings
- match lowering: build the
Place instead of keeping a PlaceBuilder around
- match lowering: consistently merge simple or-patterns
- match lowering: handle or-patterns one layer at a time
- match lowering: sort
Eq candidates in the failure case too
- pattern analysis: Require
enum indices to be contiguous
- replace regions in const canonical vars' types with
'static in next-solver canonicalizer
- require Debug for
Pointee::Metadata
- require
DerefMut and DerefPure on deref!() patterns when appropriate
- rework opaque type region inference
- simplify proc macro bridge state
- simplify trim-paths feature by merging all debuginfo options together
- store segment and module in
UnresolvedImportError
- suggest associated type bounds on problematic associated equality bounds
- suggest correct path in
include_bytes!
- use the
Align type when parsing alignment attributes
- warn against implementing Freeze
- enable cargo miri test doctests
- miri: avoid mutating the global environment
- miri: cotrol stacked borrows consistency check with its own feature flag
- miri: experiment with macOS M1 runners
- miri: extern-so: give the version script a better name; show errors from failing to build the C lib
- miri: speed up Windows CI
- miri: tree Borrows: Make tree root always be initialized
- don't emit load metadata in debug mode
- avoid some unnecessary query invocations
- stop doing expensive work in
opt_suggest_box_span eagerly
- stabilize
ptr.is_aligned, move ptr.is_aligned_to to a new feature gate
- stabilize
unchecked_{add,sub,mul}
- make
{integer}::from_str_radix constant
- optimize
core::char::CaseMappingIter
- implement
Vec::pop_if
- remove len argument from
RawVec::reserve_for_push
- less generic code for Vec allocations
UnixStream : override read_buf
num::NonZero::get can be 1 transmute instead of 2
- fix error message for
env! when env var is not valid Unicode
- futures: make access inner of
futures::io::{BufReader,BufWriter} not require inner trait bound
- regex-syntax: accept
{,n} as an equivalent to {0,n}
- cargo add: Preserve comments when updating simple deps
- cargo generate-lockfile: hold lock before querying index
- cargo toml: Warn on unused workspace.dependencies keys on virtual workspaces
- cargo fix: bash completion fallback in
nounset mode
- clippy:
large_stack_frames : print total size and largest component
- clippy:
type_id_on_box : lint on any Box<dyn _>
- clippy: accept
String in span_lint* functions directly to avoid unnecessary clones
- clippy: allow
filter_map_identity when the closure is typed
- clippy: allow
manual_unwrap_or_default in const function
- clippy: don't emit
duplicated_attribute lint on "complex" cfg s
- clippy: elide unit variables linted by
let_unit and use () directly instead
- clippy: fix
manual_unwrap_or_default suggestion ignoring side-effects
- clippy: fix suggestion for
len_zero with macros
- clippy: make sure checked type implements
Try trait when linting question_mark
- clippy: move
box_default to style, do not suggest turbofishes
- clippy: move
mixed_attributes_style to style
- clippy: new lint
legacy_numeric_constants
- clippy: restrict
manual_clamp to const case, bring it out of nursery
- rust-analyzer: add
rust-analyzer.cargo.allTargets to configure passing --all-targets to cargo invocations
- rust-analyzer: implement resolving and lowering of Lifetimes (no inference yet)
- rust-analyzer: fix crate IDs when multiple workspaces are loaded
- rust-analyzer: ADT hover considering only type or const len not lifetimes
- rust-analyzer: check for client support of relative glob patterns before using them
- rust-analyzer: lifetime length are not added in count of params in highlight
- rust-analyzer: revert debug extension priorities
- rust-analyzer: silence mismatches involving unresolved projections
- rust-analyzer: use lldb when debugging with C++ extension on MacOS
- rust-analyzer: pattern analysis: Use contiguous indices for
enum variants
- rust-analyzer: prompt the user to reload the window when enabling test explorer
- rust-analyzer: resolve tests per file instead of per crate in test explorer
A pretty quiet week, with most changes (dropped from the report below) being
due to continuing bimodality in the performance data. No particularly notable
changes landed.
Triage done by @simulacrum.
Revision range: 73476d49..3d5528c
1 Regressions, 2 Improvements, 5 Mixed; 0 of them in rollups
61 artifact comparisons made in total
Full report here
Changes to Rust follow the Rust RFC (request for comments) process. These
are the RFCs that were approved for implementation this week:
Every week, the team announces the 'final comment period' for RFCs and key PRs
which are reaching a decision. Express your opinions now.
- No RFCs entered Final Comment Period this week.
Rusty Events between 2024-04-03 - 2024-05-01 🦀
- 2024-04-03 | Virtual (Cardiff, UK) | Rust and C++ Cardiff
- 2024-04-03 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-04-04 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-04-09 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-04-11 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-11 | Virtual (Nürnberg, DE) | Rust Nüremberg
- 2024-04-15 & 2024-04-16 | Virtual | Mainmatter
- 2024-04-16 | Virtual (Dublin, IE) | Rust Dublin
- 2024-04-16 | Virtual (Washinigton, DC, US) | Rust DC
- 2024-04-17 | Virtual (Vancouver, BC, CA) | Vancouver Rust
- 2024-04-18 | Virtual (Charlottesville, NC, US) | Charlottesville Rust Meetup
- 2024-04-25 | Virtual + In Person (Berlin, DE) | OpenTechSchool Berlin + Rust Berlin
- 2024-04-30 | Virtual (Dallas, TX, US) | Dallas Rust
- 2024-05-01 | Virtual (Indianapolis, IN, US) | Indy Rust
- 2024-04-10 | Cambridge, UK | Cambridge Rust Meetup
- 2024-04-10 | Cologne/Köln, DE | Rust Cologne
- 2024-04-10 | Manchester, UK | Rust Manchester
- 2024-04-10 | Oslo, NO | Rust Oslo
- 2024-04-11 | Bordeaux, FR | Rust Bordeaux
- 2024-04-11 | Reading, UK | Reading Rust Workshop
- 2024-04-15 | Zagreb, HR | impl Zagreb for Rust
- 2024-04-16 | Bratislava, SK | Bratislava Rust Meetup Group
- 2024-04-16 | Leipzig, DE | Rust - Modern Systems Programming in Leipzig
- 2024-04-16 | Munich, DE + Virtual | Rust Munich
- 2024-04-17 | Bergen, NO | Hubbel kodeklubb
- 2024-04-20 | Augsburg, DE | Augsburger Linux-Infotag 2024
- Augsburger Linux-Infotag 2024: Workshop Einstieg in Embedded Rust mit dem Raspberry Pico WH
- 2024-04-23 | Berlin, DE | Rust Berlin
- 2024-04-25 | Aarhus, DK | Rust Aarhus
- 2024-04-25 | Berlin, DE | Rust Berlin
- 2024-04-27 | Basel, CH | Rust Basel
- 2024-04-04 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-04-04 | Portland, OR, US | PDXRust Meetup
- 2024-04-09 | New York, NY, US | Rust NYC
- 2024-04-10 | Boulder, CO, US | Boulder Rust Meetup
- 2024-04-11 | Seattle, WA, US | Seattle Rust User Group
- 2024-04-11 | Spokane, WA, US | Spokane Rust
- 2024-04-15 | Somerville, MA, US | Boston Rust Meetup
- 2024-04-16 | San Francisco, CA, US | San Francisco Rust Study Group
- 2024-04-16 | Seattle, WA, US | Seattle Rust User Group
- 2024-04-18 | Mountain View, CA, US | Mountain View Rust Meetup
- 2024-04-24 | Austin, TX, US | Rust ATX
- 2024-04-25 | Nashville, TN, US | Music City Rust Developers
- 2024-04-26 | Boston, MA, US | Boston Rust Meetup
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.
Please see the latest Who's Hiring thread on r/rust
Panstromek: I remember reading somewhere (probably here) that borrow checking has O(n^3) asymptotic complexity, relative to the size of the function.
Nadrieril: Compared to match exhaustiveness which is NP-hard and trait solving which is undecidable, a polynomial complexity feels refreshingly sane.
– Panstromek and Nadrieril on zulip
Thanks to Kevin Reid 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
Discuss on r/rust
|