rust-lang / rfcs

RFCs for changes to Rust
https://rust-lang.github.io/rfcs/
Apache License 2.0
5.78k stars 1.55k forks source link

RFC: RArrow for Pointer Ergonomics #3576

Closed EEliisaa closed 4 months ago

EEliisaa commented 4 months ago

This RFC improves ergonomics for pointers in unsafe Rust. It adds the RArrow token as a single-dereference member access operator. x->field desugars to (*x).field, and x->method() desugars to (*x).method().

clarfonthey commented 4 months ago

For an RFC, you're not supposed to edit the template; you're supposed to copy it into a new file. As-is, this couldn't be merged.