-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language teamneeds-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.
Description
Sub-tracking issue for rust-lang/rfcs#911.
This tracks arithmetic for floating point types in const fn
. These operations are already stable in const
/static
, and are also being promoted on stable (&(1.2*2.1)
has lifetime 'static
). However, in all of these situations, the code is definitely executed at compile-time -- only const fn
code could be executed both at compile-time and run-time, making possible differences in FP behavior observable. Also see #77745.
Open Questions
- Must a
const fn
behave exactly the same at runtime as at compile-time? #77745: Must aconst fn
behave exactly the same at runtime as at compile-time? - See Our floating point semantics were a mess unsafe-code-guidelines#237 for a collection of issues around floating-point semantics.
clinta, jplatte, demurgos, joseluis, ebkalderon and 60 moremichaelkirk, Dushistov, schneiderfelipe, benluelo, musjj and 3 more
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language teamneeds-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.