32 bit platforms don't have 64 bit pointers
This commit is contained in:
parent
eac309984f
commit
ed7a4adeb3
1 changed files with 3 additions and 2 deletions
|
@ -14,7 +14,7 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||||
use rustc_middle::ty::{self, subst::Subst, TyCtxt};
|
use rustc_middle::ty::{self, subst::Subst, TyCtxt};
|
||||||
use rustc_span::source_map::Span;
|
use rustc_span::source_map::Span;
|
||||||
use rustc_target::abi::{Abi, LayoutOf};
|
use rustc_target::abi::{Abi, LayoutOf};
|
||||||
use std::convert::{TryFrom, TryInto};
|
use std::convert::TryInto;
|
||||||
|
|
||||||
pub fn note_on_undefined_behavior_error() -> &'static str {
|
pub fn note_on_undefined_behavior_error() -> &'static str {
|
||||||
"The rules on what exactly is undefined behavior aren't clear, \
|
"The rules on what exactly is undefined behavior aren't clear, \
|
||||||
|
@ -140,7 +140,8 @@ pub(super) fn op_to_const<'tcx>(
|
||||||
Scalar::Raw(int) => {
|
Scalar::Raw(int) => {
|
||||||
assert!(mplace.layout.is_zst());
|
assert!(mplace.layout.is_zst());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
u64::try_from(int).unwrap() % mplace.layout.align.abi.bytes(),
|
int.assert_bits(ecx.tcx.data_layout.pointer_size)
|
||||||
|
% u128::from(mplace.layout.align.abi.bytes()),
|
||||||
0,
|
0,
|
||||||
"this MPlaceTy must come from a validated constant, thus we can assume the \
|
"this MPlaceTy must come from a validated constant, thus we can assume the \
|
||||||
alignment is correct",
|
alignment is correct",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue