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

I wonder if there is a simple way to stop compilation quickly, with a readable error message, if the optimizer isn't able to eliminate the check.

edit: There is https://github.com/dtolnay/no-panic



> Functions that require some amount of optimization to prove that they do not panic may no longer compile in debug mode after being marked #[no_panic].

So you’re probably going to have to protect this with a cfg_attr to only apply the no_panic in release only.


Probably, yes.

That or forcing compilation to always target release.




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

Search: