Stream: t-compiler/const-eval

Topic: aligning const and const fn?


RalfJ (Jun 04 2019 at 07:33, on Zulip):

Is there a timeline for aligning the abilities of const and const fn so that these are not covered by two different checks (const_qualif vs min_const) any more?

oli (Jun 04 2019 at 11:10, on Zulip):

not that I know of. Note that const fn is const_qualif + min_const, so essentially the work is to eliminate min_const

RalfJ (Jun 04 2019 at 11:13, on Zulip):

yes

RalfJ (Jun 04 2019 at 11:13, on Zulip):

for example min_const contains another intrinsic whitelist and I am not sure why that is there (as opposed to in const_qualif)

RalfJ (Jun 04 2019 at 11:14, on Zulip):

do we not want to allow the same intrinsics in stable const fn and const?

centril (Jun 04 2019 at 13:25, on Zulip):

@RalfJ It does seems like we should -- so the whitelist should be moved?

centril (Jun 04 2019 at 13:25, on Zulip):

or just used in const_qualif

centril (Jun 04 2019 at 13:25, on Zulip):

(latter is my preference)

RalfJ (Jun 04 2019 at 13:35, on Zulip):

hm I may have misunderstood what that file is even about

RalfJ (Jun 04 2019 at 13:36, on Zulip):

the main difference between stable const and const fn AFAIK is access to union fields, but that check is in qualify_consts. all the stuff in min_const should apply to everything on stable, not just functions.

centril (Jun 04 2019 at 13:36, on Zulip):

@RalfJ FP math as well iirc

Matthew Jasper (Jun 04 2019 at 13:37, on Zulip):

casts to function pointers and trait objects

centril (Jun 04 2019 at 13:37, on Zulip):

I feel I should know this by heart but I have amnesia about stable const fn

centril (Jun 04 2019 at 13:37, on Zulip):

@Matthew Jasper :face_palm:

RalfJ (Jun 04 2019 at 13:39, on Zulip):

the cast and arithmetic checks are in min_const

RalfJ (Jun 04 2019 at 13:39, on Zulip):

but they are also duplicated in qualify_consts for promotion^^

Last update: Nov 15 2019 at 20:00UTC