Skip to content

avoid relying on implicit promotion of const fn calls#2

Merged
denisandroid merged 1 commit intoclucompany:masterfrom
RalfJung:promotion
Dec 28, 2020
Merged

avoid relying on implicit promotion of const fn calls#2
denisandroid merged 1 commit intoclucompany:masterfrom
RalfJung:promotion

Conversation

@RalfJung
Copy link
Copy Markdown
Contributor

@RalfJung RalfJung commented Dec 28, 2020

There are plans to change the rules for implicit promotion such that calls to const fn are not implicitly promoted to 'static lifetime any more. A crater experiment showed that only very few crates would be affected by this change, and this is one of them.

This PR adjusts the code to no longer rely on implicit promotion, by explicitly putting the result of the function call into a const item. Long-term, there will be the possibility of using inline const expressions instead, which will be more ergonomic.

@denisandroid
Copy link
Copy Markdown
Member

Interesting, good.

@denisandroid denisandroid merged commit 2b7d093 into clucompany:master Dec 28, 2020
@RalfJung RalfJung deleted the promotion branch December 28, 2020 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants