Test null pointer optimization of Result<(), Error>

This commit is contained in:
David Tolnay 2019-10-08 13:02:09 -07:00
parent 63f14dbd49
commit 95e25cf787
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -13,6 +13,11 @@ fn test_error_size() {
assert_eq!(mem::size_of::<Error>(), mem::size_of::<usize>());
}
#[test]
fn test_null_pointer_optimization() {
assert_eq!(mem::size_of::<Result<(), Error>>(), mem::size_of::<usize>());
}
#[test]
fn test_autotraits() {
fn assert<E: Unpin + Send + Sync + 'static>() {}