Skip to content

Support negative, char & bool const generics#12778

Merged
bors merged 4 commits into
rust-lang:masterfrom
Logarithmus:feature/fix-negative-const-generics
Jul 17, 2022
Merged

Support negative, char & bool const generics#12778
bors merged 4 commits into
rust-lang:masterfrom
Logarithmus:feature/fix-negative-const-generics

Conversation

@Logarithmus

@Logarithmus Logarithmus commented Jul 17, 2022

Copy link
Copy Markdown
Contributor

Before:
Before

After:
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

@Logarithmus Logarithmus changed the title feature/fix negative const generics Support negative, char & bool const generics Jul 17, 2022
* feat: support `bool` & `char` const generics
@Logarithmus Logarithmus force-pushed the feature/fix-negative-const-generics branch from cee0781 to a96f0aa Compare July 17, 2022 01:22
@flodiebold flodiebold self-assigned this Jul 17, 2022

@flodiebold flodiebold left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...).

Comment thread lib/la-arena/src/lib.rs Outdated
Comment thread crates/hir-def/src/body/lower.rs Outdated
Comment thread crates/hir-def/src/path/lower.rs Outdated
Comment thread crates/hir-def/src/type_ref.rs Outdated
Comment thread crates/hir-ty/src/infer/pat.rs
Comment thread crates/hir-ty/src/consteval.rs Outdated
Comment thread crates/hir-ty/src/interner.rs
Comment thread crates/hir-ty/src/tests/simple.rs Outdated
@Logarithmus Logarithmus requested a review from flodiebold July 17, 2022 15:22
@Logarithmus

Copy link
Copy Markdown
Contributor Author

@flodiebold please, take a look again after CI is passed

@flodiebold

Copy link
Copy Markdown
Member

LGTM, thanks!

@bors r+

@bors

bors commented Jul 17, 2022

Copy link
Copy Markdown
Contributor

📌 Commit 83177a7 has been approved by flodiebold

It is now in the queue for this repository.

@bors

bors commented Jul 17, 2022

Copy link
Copy Markdown
Contributor

⌛ Testing commit 83177a7 with merge db6a85d...

@bors

bors commented Jul 17, 2022

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: flodiebold
Pushing db6a85d to master...

@bors bors merged commit db6a85d into rust-lang:master Jul 17, 2022
@Logarithmus Logarithmus deleted the feature/fix-negative-const-generics branch July 17, 2022 17:27
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`
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.

3 participants