We want to switch to a scheme where everything inside the standard library requires min_const_fn by default. If an additional #[rustc_not_min_const_fn] is present, then the function will be uncallable from any min_const_fn.
It's also important to note that a function #[rustc_const_unstable(feature "foo")] const fn bar() {} without #[rustc_not_min_const_fn] should a) enforce that that the function is min_const_fn even without the feature gate active, b) not be callable as min_const_fn without the the feature gate active.
Relevant code exists in:
Context: Centril@93ad760#r34994115 (also see my branch master...Centril:stabilize-vec-new-const)
Conversation replayed (keep-safe):
@oli-obk:
One thing that could be done is what's essentially the opposite scheme. Everything requires min_const_fn by default, unless it has an additional rustc_not_min_const_fn attribute (which makes the function uncallable from any min_const_fn).
Or rename the attribute to rustc_require_min_const_fn, to make it sound less like an override
@Centril:
One thing that could be done is what's essentially the opposite scheme.
Oh... I like that! -- but what about user-land const fn? Do we only enforce this for staged_api crates?
@oli-obk:
user land const fn just keeps doing what it does now. As long as there's a const fn feature gate active, everything is not min_const_fn. The reason we have a complex scheme in libstd is stability. Users using nightly with feature gates already opt out of stability.
We want to switch to a scheme where everything inside the standard library requires
min_const_fnby default. If an additional#[rustc_not_min_const_fn]is present, then the function will be uncallable from anymin_const_fn.It's also important to note that a function
#[rustc_const_unstable(feature "foo")] const fn bar() {}without#[rustc_not_min_const_fn]should a) enforce that that the function ismin_const_fneven without the feature gate active, b) not be callable asmin_const_fnwithout the the feature gate active.Relevant code exists in:
Context: Centril@93ad760#r34994115 (also see my branch master...Centril:stabilize-vec-new-const)
Conversation replayed (keep-safe):
@oli-obk:
@Centril:
@oli-obk: