Add missing case for pointer -> int when translating constant cast expressions
Closes issue #17458
This commit is contained in:
parent
0c66796525
commit
293b57701b
1 changed files with 3 additions and 0 deletions
|
|
@ -547,6 +547,9 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
|
|||
(expr::cast_integral, expr::cast_pointer) => {
|
||||
llvm::LLVMConstIntToPtr(v, llty.to_ref())
|
||||
}
|
||||
(expr::cast_pointer, expr::cast_integral) => {
|
||||
llvm::LLVMConstPtrToInt(v, llty.to_ref())
|
||||
}
|
||||
_ => {
|
||||
cx.sess().impossible_case(e.span,
|
||||
"bad combination of types for cast")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue