[features] Should the default be checked or unchecked?
Lokathor opened this issue · 5 comments
So, we have to fix up the stable
feature into being an unstable
feature, so that the create builds properly on stable with "no default features" enabled like people expect a crate to do.
There's also a "checked" feature that's not currently on by default. I guess we've been doing unchecked operations basically this whole time.
Question: Should the base form be to have checked or unchecked operation?
Keeping in mind that whichever we want to be the "no features" version doesn't have to be the feature set used by compiler-builtins
, should we swap it around so that all operations are checked when there's no features at all, and then it's the feature flag that enables unchecked opearations?
cc @alexcrichton , @gnzlbg , @ anyone else who has a strong opinion
What problem does the checked
feature solve ? Looking at how it is used through the code, it appears that it replaces returning some result with panicking in some functions, but I'm not sure why this is done this way. cc @japaric ?
The features in this crate afaik were added ad-hoc and don't necessarily have a rhyme or reason for their existence. It seems reasonable to me though that unchecked stable arithmetic is the default, and then accelerating with unstable features and/or using checked arithemetic for debugging could be layered on.
If they're checks for debugging, should we just use the normal debug_assertions
cfg flag?
Seems reasonable to me!