--- a/tests/cxx_string.rs
+++ b/tests/cxx_string.rs
@@ -45,6 +45,7 @@
 }
 
 #[test]
+#[cfg(feature = "std")]
 fn test_io_write() {
     let_cxx_string!(s = "");
     let mut reader: &[u8] = b"Hello, world!";
