Hacker News new | ask | show | jobs
by htfy96 1535 days ago
This reminds me of the -Wlifetime proposal, which provides similar checks but requires annotation of ownership at struct level (hence the check only applies to new structs):

An example: https://github.com/llvm/llvm-project/blob/main/clang/test/Se...

More details can be found at https://herbsutter.com/2018/09/20/lifetime-profile-v1-0-post...

Unfortunately it was never upstreamed according to https://github.com/mgehre/llvm-project/issues/98

1 comments

There's a lot of overlap between the authors and implementors, and this proposal has extensive comparisons with the -Wlifetime one!