about summary refs log tree commit diff
path: root/library/std/src/io/error
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-03-21 20:20:58 +0100
committerMara Bos <m-ou.se@m-ou.se>2021-03-21 20:20:58 +0100
commitf398a49829e837ffc62f2242e549248b7541e430 (patch)
tree382a5246ee440e551e81a3def3334da8cd235743 /library/std/src/io/error
parentf293f70dd848ae2371b6fad2eb9f4081e920da88 (diff)
Add test for io::Error's size.
Diffstat (limited to 'library/std/src/io/error')
-rw-r--r--library/std/src/io/error/tests.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/std/src/io/error/tests.rs b/library/std/src/io/error/tests.rs
index 0cce9368c80..eb051c33f09 100644
--- a/library/std/src/io/error/tests.rs
+++ b/library/std/src/io/error/tests.rs
@@ -1,10 +1,16 @@
 use super::{Custom, Error, ErrorKind, Repr};
 use crate::error;
 use crate::fmt;
+use crate::mem::size_of;
 use crate::sys::decode_error_kind;
 use crate::sys::os::error_string;
 
 #[test]
+fn test_size() {
+    assert!(size_of::<Error>() <= size_of::<[usize; 2]>());
+}
+
+#[test]
 fn test_debug_error() {
     let code = 6;
     let msg = error_string(code);