comment
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
This commit is contained in:
parent
fafccdced3
commit
d5a590f537
2 changed files with 4 additions and 1 deletions
|
@ -270,6 +270,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||||
PointerCast::MutToConstPointer | PointerCast::ArrayToPointer,
|
PointerCast::MutToConstPointer | PointerCast::ArrayToPointer,
|
||||||
)
|
)
|
||||||
| mir::CastKind::Misc
|
| mir::CastKind::Misc
|
||||||
|
// Since int2ptr can have arbitrary integer types as input (so we have to do
|
||||||
|
// sign extension and all that), it is currently best handled in the same code
|
||||||
|
// path as the other integer-to-X casts.
|
||||||
| mir::CastKind::PointerFromExposedAddress => {
|
| mir::CastKind::PointerFromExposedAddress => {
|
||||||
assert!(bx.cx().is_backend_immediate(cast));
|
assert!(bx.cx().is_backend_immediate(cast));
|
||||||
let ll_t_out = bx.cx().immediate_backend_type(cast);
|
let ll_t_out = bx.cx().immediate_backend_type(cast);
|
||||||
|
|
|
@ -504,7 +504,7 @@ impl<'tcx> Validator<'_, 'tcx> {
|
||||||
// ptr-to-int casts are not possible in consts and thus not promotable
|
// ptr-to-int casts are not possible in consts and thus not promotable
|
||||||
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => return Err(Unpromotable),
|
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => return Err(Unpromotable),
|
||||||
|
|
||||||
// all ohter casts including int-to-ptr casts are fine, they just use the integer value
|
// all other casts including int-to-ptr casts are fine, they just use the integer value
|
||||||
// at pointer type.
|
// at pointer type.
|
||||||
Rvalue::Cast(_, operand, _) => {
|
Rvalue::Cast(_, operand, _) => {
|
||||||
self.validate_operand(operand)?;
|
self.validate_operand(operand)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue