External Publication
Visit Post

Idea: Borrowck Transparent Function Calls

Rust Internals [Unofficial] March 20, 2026
Source

I can understand the "ability to reason" argument, and I agree it's a strong point of Rust. But as I stated in the motivation part, current function signature for helpers is often too restricting. It's a common encounter that trying out a small change needs large refactor, which often leads to refactoring again.

TBF most use cases I have in minds just access 1 or 2 fields of self, and doesn't call other functions transparently, or at most 1 call deep. The reasoning would be nearly trivial.

What's your stance if functions that can be called transparently must be annotated with #[helper]? It's not supposed to mark every private function with #[helper]. You could think this as softer and checked escape hatch than unsafe blocks, or a much more ide-friendly version of macro.

On compile times: I believe borrowck basically takes no time (<1%) compared to other part of the compilation process. So I won't worry too much about it.

Discussion in the ATmosphere

Loading comments...