Assert size_of type parameter greater than zero#16
Assert size_of type parameter greater than zero#16spearman wants to merge 1 commit intopolyfractal:masterfrom
Conversation
|
Heya @spearman, sorry for letting this rot. Do you think this is still relevant? I haven't kept up with Rust lately, and haven't used the library actively for a while so you're a better judge than me :) |
|
There has been some progress in constant evaluation in the last few Rust versions, and there is now a One thing that appears to work at least for unit and zero-sized arrays is using an auto trait: So that covers only unit and zero-sized arrays, but not any user-created zero-sized types. Really the main thing with this pull request is the assertion prints out a more informative error message, whereas before the program will just Segfault without explanation. |
|
Closing in favor of #23 |
Partial fix for: #15
I couldn't figure out how to make this a compile-time error. It may be possible to do something with CTFE when that is more fleshed out.