Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust does not implement true linear types, only affine, so I believe your parent is mistaken.

You can do a dynamic check to encode this, but that's not super popular. You can also issue a warning, and in theory turn that warning into an error, but it may also trigger on code unrelated to the specific struct you want it to, so I don't think that's a full solution either, and others may use your code without the warning, getting less guarantees.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: