Function pointers as const generic arguments - #64986
Conversation
commented
Oct 2, 2019
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
commented
Oct 2, 2019
|
It would definitely be good not to ICE, or emit a link error here. Let's put the ability to use pointers in const arguments behind |
commented
Oct 2, 2019
Oh I wasn't even worried about that, but UX is a good point, too. I worry about unsoundness because of differences between runtime and compile time for the same const evaluable code. |
commented
Oct 5, 2019
|
I gated the use of both raw pointers and function pointers behind the feature gate |
commented
Oct 7, 2019
|
(@Skinny121: you'll need to run |
commented
Oct 7, 2019
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
function pointer const parameters.
const_compare_raw_pointers.
Co-Authored-By: varkor <github@varkor.com>
fb4631d to
5986fe2
Compare
commented
Oct 8, 2019
|
I forgot that I would have to do that :). I also rebased so that the stderr files reflect the changes from #65154. |
| --> $DIR/raw-ptr-const-param.rs:7:38 | ||
| | | ||
| LL | let _: Const<{15 as *const _}> = Const::<{10 as *const _}>; | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Scalar(0x000000000000000f) : *const u32`, found `Scalar(0x000000000000000a) : *const u32` |
There was a problem hiding this comment.
These diagnostics are not great, but we can file an issue for that.
commented
Oct 8, 2019
|
Thanks! @bors r+ rollup |
commented
Oct 8, 2019
|
📌 Commit 5986fe2 has been approved by |
commented
Oct 9, 2019
|
Failed in #65227 (comment), @bors r- |
commented
Oct 9, 2019
|
Maybe we should normalise the printing of pointers to |
commented
Oct 9, 2019
|
I changed the printing of point to |
commented
Oct 9, 2019
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
commented
Oct 10, 2019
|
@bors r+ |
commented
Oct 10, 2019
|
📌 Commit 8569dd1 has been approved by |
commented
Oct 12, 2019
If there wasn't an issue opened for fixing this, there should be, so we won't forget about it. |
Makes function pointers as const generic arguments usable.
Fixes #62395
r? @varkor