about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/rust-analyzer/crates/test-utils/src/minicore.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/test-utils/src/minicore.rs b/src/tools/rust-analyzer/crates/test-utils/src/minicore.rs
index 7b719b5dec7..c1f2b08be94 100644
--- a/src/tools/rust-analyzer/crates/test-utils/src/minicore.rs
+++ b/src/tools/rust-analyzer/crates/test-utils/src/minicore.rs
@@ -70,6 +70,7 @@
 //!     tuple:
 //!     unpin: sized
 //!     unsize: sized
+//!     write: fmt
 //!     todo: panic
 //!     unimplemented: panic
 //!     column:
@@ -1769,6 +1770,26 @@ mod macros {
     }
     // endregion:panic
 
+    // region:write
+    #[macro_export]
+    macro_rules! write {
+        ($dst:expr, $($arg:tt)*) => {
+            $dst.write_fmt($crate::format_args!($($arg)*))
+        };
+    }
+
+    #[macro_export]
+    #[allow_internal_unstable(format_args_nl)]
+    macro_rules! writeln {
+        ($dst:expr $(,)?) => {
+            $crate::write!($dst, "\n")
+        };
+        ($dst:expr, $($arg:tt)*) => {
+            $dst.write_fmt($crate::format_args_nl!($($arg)*))
+        };
+    }
+    // endregion:write
+
     // region:assert
     #[macro_export]
     #[rustc_builtin_macro]