Support negative, char & bool const generics#12778
Merged
bors merged 4 commits intorust-lang:masterfrom Jul 17, 2022
Merged
Conversation
char & bool const generics
* feat: support `bool` & `char` const generics
cee0781 to
a96f0aa
Compare
flodiebold
requested changes
Jul 17, 2022
Member
flodiebold
left a comment
There was a problem hiding this comment.
Thanks! Handling non-trivial expressions is indeed currently blocked on some larger refactorings to actually handle const expressions (that I have been not making much progress on for a while now...).
Contributor
Author
|
@flodiebold please, take a look again after CI is passed |
flodiebold
approved these changes
Jul 17, 2022
Member
|
LGTM, thanks! @bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
that referenced
this pull request
Jul 17, 2022
…s, r=Veykril fix: un-inline `ConstScalarOrPath::from_expr_opt` Sorry, but I missed these from #12778 `@flodiebold`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:

After:

I tried to implement stuff like
Const<{NUM1 + 3 + NUM2}>by using already existing constant evaluation mechanism for ordinary constants, but turned out to be harder than I thought, maybe because I've never ever tinkered with compilers before