-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE when checking size_of of closure in const generics #86033
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@rustbot label +A-closures +A-zst |
@bookofportals, sorry for bothering you, but probably ZST is not a real cause of a problem. I'm very far from compiler internals, but it looks like issue is coming from using Upd: Making closure non-ZST still crashes the compiler: playground |
After googling a bit I finally learned how to become a better contributor :) @rustbot label +F-const_evaluatable_checked +A-const-eval +F-const_generics +A-const-generics -A-zst |
That's quite alright! You don't need to worry about bothering me. I appreciate any advice on how to make my categorizations more helpful. That said, I might suggest editing the title and opening post to make the probable source of the problem a bit more clear. :) @rustbot label +requires-nightly |
…al, r=jackh726 Add tests fixed by rust-lang#90023 The following issues were fixed by rust-lang#90023 Fixes rust-lang#79674 Fixes rust-lang#83765 Fixes rust-lang#86033 Fixes rust-lang#90318 Fixes rust-lang#88468 The following issues were duplicates of rust-lang#90654 Fixes rust-lang#86850 Fixes rust-lang#89022 r? `@jackh726`
…al, r=jackh726 Add tests fixed by rust-lang#90023 The following issues were fixed by rust-lang#90023 Fixes rust-lang#79674 Fixes rust-lang#83765 Fixes rust-lang#86033 Fixes rust-lang#90318 Fixes rust-lang#88468 The following issues were duplicates of rust-lang#90654 Fixes rust-lang#86850 Fixes rust-lang#89022 r? ``@jackh726``
…al, r=jackh726 Add tests fixed by rust-lang#90023 The following issues were fixed by rust-lang#90023 Fixes rust-lang#79674 Fixes rust-lang#83765 Fixes rust-lang#86033 Fixes rust-lang#90318 Fixes rust-lang#88468 The following issues were duplicates of rust-lang#90654 Fixes rust-lang#86850 Fixes rust-lang#89022 r? ```@jackh726```
Uh oh!
There was an error while loading. Please reload this page.
In some cases compiler panicks when, I believe, computing const generic argument containing
std::mem::size_of::<T>()
, whereT
is some closure type. Interestingly, it works well when I put closure into associated type, so expression looks likesize_of::<T::Assoc>()
. Changing closure type to something more simple makes everything fine.Code
This gives panic: (playground)
Interestingly, following code also requires closure type to be ZST, but compiles well: (playground)
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: