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

LANG: add an operator to dereference an item to call methods or fields that require the owned version #3575

Closed spacey-sooty closed 4 months ago

spacey-sooty commented 4 months ago

Shorthand for

(*my_item).my_method()

Something along the lines of

my_item->my_method()

I'd be interested in fleshing this idea out more and potentially opening an RFC for this as it would improve the readability and explicitness of dereferencing types to access fields and methods requiring owned types.

Lokathor commented 4 months ago

Could you show the types of the functions that don't work right now, but that would work if this was added? I'm a little unclear on when this would come up.

spacey-sooty commented 4 months ago

I realised this was covered by another draft, my mistake sorry!