External Publication
Visit Post

Top-level self functions `fn f(self: T)`

Rust Internals [Unofficial] March 7, 2026
Source

CAD97:

Then there's also the "power of the dot" in IDEs. You take an expression and type . and you get a decent fuzzy search for all of the type's available methods, or rather what you can do with the type / what that type can do. If this kind of IDE assistance isn't in use and functionality is all either remembered or found via searching code or documentation, then the "power of the dot" is minimal.

afetisov:

That sounds like a feature request for your IDE.

Regarding IDE experience, I think being able to write from do(it) to do(it.that()) instead of do(that(it)) has a non-trivial improvement since for the latter I need to edit in 2 places, and moving the cursor to 2 places is slower than to 1. My habit for the latter is to drag my cursor to select the whole expression and type ( then click after do( and type that. I'd think it will be a bit clumsy for IDEs to support

  • this edit with a keybinding: it takes 2 pieces of information (start, end), so you will need to select the whole expression (instead of only having to place the cursor somewhere)
  • autocomplete suggestions taking the first argument: if you only place the cursor at the start of a().b().c it is not clear whether you want xxx(a()), xxx(a().b()) or xxx(a().b().c); you can design the IDE to choose the last as default but then for the other 2 cases you will need to select the expression with cursor. (Whereas if the function can be called method-like you only need to put your cursor before the right dot in a().b().c)

Discussion in the ATmosphere

Loading comments...