diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-08-10 01:39:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 01:39:58 +0000 |
| commit | eca31528356d9721d9f4dc727da1bda20dfee932 (patch) | |
| tree | 45a2686e2eca2e96cbbfed3a351488e5274a5d52 | |
| parent | 840d8130a13a1123886922fa1d581be3e5717a01 (diff) | |
| parent | 5b9e6f1b75f14d916bc3d43c21e1e845cc049dbf (diff) | |
Merge pull request #20409 from A4-Tacks/minicore-write
Add write! and writeln! to minicore
| -rw-r--r-- | src/tools/rust-analyzer/crates/test-utils/src/minicore.rs | 21 |
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] |
