Rust folks, is there a reason rustc couldn't implement this kind of lowering? godbolt.org/z/8KbEGYY1s

That is, fn(Self, ...) -> Self would be lowered to fn(*mut Self, ...) to prevent copies. You could use an ABI-dependent lowering for different types so that fn(i32, ...) -> i32, etc, can still go through registers.

@pervognsen He doesn't seem too active on mastodon, but @pcwalton has done (is doing?) a bunch of work on eliminating copies so might be a fine person to ask

Sign in to participate in the conversation
Mastodon

a Schelling point for those who seek one