Remove assert_matches users
This commit is contained in:
parent
1406d06104
commit
aa3e8d3e78
|
@ -45,11 +45,7 @@ impl<'ctx> rustc_ast::HashStableContext for StableHashingContext<'ctx> {
|
||||||
item.hash_stable(self, hasher);
|
item.hash_stable(self, hasher);
|
||||||
style.hash_stable(self, hasher);
|
style.hash_stable(self, hasher);
|
||||||
span.hash_stable(self, hasher);
|
span.hash_stable(self, hasher);
|
||||||
assert_matches!(
|
assert!(tokens.as_ref().is_none(), "Tokens should have been removed during lowering!");
|
||||||
tokens.as_ref(),
|
|
||||||
None,
|
|
||||||
"Tokens should have been removed during lowering!"
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
unreachable!();
|
unreachable!();
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,7 +339,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
|
||||||
for dest in bytes {
|
for dest in bytes {
|
||||||
*dest = src.next().expect("iterator was shorter than it said it would be");
|
*dest = src.next().expect("iterator was shorter than it said it would be");
|
||||||
}
|
}
|
||||||
assert_matches!(src.next(), None, "iterator was longer than it said it would be");
|
assert!(src.next().is_none(), "iterator was longer than it said it would be");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -854,11 +854,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
|
||||||
Some(ptr) => ptr,
|
Some(ptr) => ptr,
|
||||||
None => {
|
None => {
|
||||||
// zero-sized access
|
// zero-sized access
|
||||||
assert_matches!(
|
assert!(src.next().is_none(), "iterator said it was empty but returned an element");
|
||||||
src.next(),
|
|
||||||
None,
|
|
||||||
"iterator said it was empty but returned an element"
|
|
||||||
);
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -884,11 +880,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
|
||||||
Some(ptr) => ptr,
|
Some(ptr) => ptr,
|
||||||
None => {
|
None => {
|
||||||
// zero-sized access
|
// zero-sized access
|
||||||
assert_matches!(
|
assert!(src.next().is_none(), "iterator said it was empty but returned an element");
|
||||||
src.next(),
|
|
||||||
None,
|
|
||||||
"iterator said it was empty but returned an element"
|
|
||||||
);
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -902,7 +894,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
|
||||||
let offset_ptr = ptr.offset(Size::from_bytes(idx) * 2, &tcx)?; // `Size` multiplication
|
let offset_ptr = ptr.offset(Size::from_bytes(idx) * 2, &tcx)?; // `Size` multiplication
|
||||||
allocation.write_scalar(&tcx, offset_ptr, val.into(), Size::from_bytes(2))?;
|
allocation.write_scalar(&tcx, offset_ptr, val.into(), Size::from_bytes(2))?;
|
||||||
}
|
}
|
||||||
assert_matches!(src.next(), None, "iterator was longer than it said it would be");
|
assert!(src.next().is_none(), "iterator was longer than it said it would be");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// run-fail
|
|
||||||
// error-pattern:panicked at 'assertion failed: `(left matches right)`
|
|
||||||
// error-pattern: left: `2`
|
|
||||||
// error-pattern:right: `3`: 1 + 1 definitely should be 3'
|
|
||||||
// ignore-emscripten no processes
|
|
||||||
|
|
||||||
#![feature(assert_matches)]
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
assert_matches!(1 + 1, 3, "1 + 1 definitely should be 3");
|
|
||||||
}
|
|
Loading…
Reference in New Issue