Hacker News new | ask | show | jobs
by imtringued 58 days ago
ok but what if you call

buf_create(SIZE)

and

buf_destroy(buf)

now the compiler has to infer that buf_create creates a lifetime and buf_destroy destroys it.

we're back to Rust's Box.

1 comments

Congratulations, you have hit upon one of the reasons why c is a bad choice. Other languages make this easier.