Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 990d8aa

Browse files
committedMay 25, 2018
Auto merge of #50967 - oli-obk:miri_api_refactor, r=eddyb
Miri api refactor r? @eddyb cc @Zoxc based on #50916
2 parents 9823cb9 + 5f599bb commit 990d8aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1068
-988
lines changed
 

‎src/librustc/ich/impls_ty.rs

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ for ::mir::interpret::ConstValue<'gcx> {
394394
mem::discriminant(self).hash_stable(hcx, hasher);
395395

396396
match *self {
397-
ByVal(val) => {
397+
Scalar(val) => {
398398
val.hash_stable(hcx, hasher);
399399
}
400-
ByValPair(a, b) => {
400+
ScalarPair(a, b) => {
401401
a.hash_stable(hcx, hasher);
402402
b.hash_stable(hcx, hasher);
403403
}
@@ -410,12 +410,12 @@ for ::mir::interpret::ConstValue<'gcx> {
410410
}
411411

412412
impl_stable_hash_for!(enum mir::interpret::Value {
413-
ByVal(v),
414-
ByValPair(a, b),
413+
Scalar(v),
414+
ScalarPair(a, b),
415415
ByRef(ptr, align)
416416
});
417417

418-
impl_stable_hash_for!(struct mir::interpret::MemoryPointer {
418+
impl_stable_hash_for!(struct mir::interpret::Pointer {
419419
alloc_id,
420420
offset
421421
});
@@ -473,13 +473,24 @@ impl_stable_hash_for!(enum ::syntax::ast::Mutability {
473473
Mutable
474474
});
475475

476-
impl_stable_hash_for!(struct mir::interpret::Pointer{primval});
477476

478-
impl_stable_hash_for!(enum mir::interpret::PrimVal {
479-
Bytes(b),
480-
Ptr(p),
481-
Undef
482-
});
477+
impl<'a> HashStable<StableHashingContext<'a>>
478+
for ::mir::interpret::Scalar {
479+
fn hash_stable<W: StableHasherResult>(&self,
480+
hcx: &mut StableHashingContext<'a>,
481+
hasher: &mut StableHasher<W>) {
482+
use mir::interpret::Scalar::*;
483+
484+
mem::discriminant(self).hash_stable(hcx, hasher);
485+
match *self {
486+
Bits { bits, defined } => {
487+
bits.hash_stable(hcx, hasher);
488+
defined.hash_stable(hcx, hasher);
489+
},
490+
Ptr(ptr) => ptr.hash_stable(hcx, hasher),
491+
}
492+
}
493+
}
483494

484495
impl_stable_hash_for!(struct ty::Const<'tcx> {
485496
ty,

‎src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#![feature(trusted_len)]
6969
#![feature(catch_expr)]
7070
#![feature(test)]
71+
#![feature(in_band_lifetimes)]
7172

7273
#![recursion_limit="512"]
7374

0 commit comments

Comments
 (0)
Please sign in to comment.