Uh oh!
There was an error while loading. Please reload this page.
Fix ICE and report a human readable error - #55071
Hidden character warning
Conversation
| } | ||
| Rvalue::Cast(_, _, _) => Err(( | ||
| span, | ||
| "only int casts are allowed in const fn".into(), |
There was a problem hiding this comment.
"int casts" doesn't seem like the right description here, not all Misc casts involved integers -- do they?
There are not so many kinds of casts, so depending on that you could make it say "unsizing casts" or "function pointer casts".
There was a problem hiding this comment.
Also, can you add a test case for this code branch?
There was a problem hiding this comment.
I'm not sure if I can, but I'll try
There was a problem hiding this comment.
Don't let it be a blocker, but it'd be nice to have error cases so that later we can give them all their own error code and a good extended description.
There was a problem hiding this comment.
I managed to get to the unsizing errors. Everything else errors out early due to fn pointers not being allowed
This comment has been minimized.
This comment has been minimized.
estebank
commented
Oct 16, 2018
lgtm++ |
| )), | ||
| Rvalue::Cast(CastKind::ClosureFnPointer, _, _) => Err(( | ||
| span, | ||
| "closures are not allowed in const fn".into(), |
There was a problem hiding this comment.
This is not just having a closure, but then casting it to fn() (I think). The message should contain the word "cast" one way or another.
I would have just grouped it with the other two fn ptr casts.
RalfJung
commented
Oct 17, 2018
r=me with that nit fixed. |
oli-obk
commented
Oct 17, 2018
@bors r=RalfJung |
bors
commented
Oct 17, 2018
📌 Commit 38f3ad4 has been approved by |
Fix ICE and report a human readable error fixesrust-lang#55063 r? @RalfJung
Fix ICE and report a human readable error fixesrust-lang#55063 r? @RalfJung
Rollup of 7 pull requests Successful merges: - #54300 (Updated RELEASES.md for 1.30.0) - #55013 ([NLL] Propagate bounds from generators) - #55071 (Fix ICE and report a human readable error) - #55144 (Cleanup resolve) - #55166 (Don't warn about parentheses on `match (return)`) - #55169 (Add a `copysign` function to f32 and f64) - #55178 (Stabilize slice::chunks_exact(), chunks_exact_mut(), rchunks(), rchunks_mut(), rchunks_exact(), rchunks_exact_mut())
fixes#55063
r? @RalfJung