diff options
| author | A4-Tacks <wdsjxhno1001@163.com> | 2025-08-08 23:48:12 +0800 |
|---|---|---|
| committer | A4-Tacks <wdsjxhno1001@163.com> | 2025-08-09 00:09:56 +0800 |
| commit | 5b9e6f1b75f14d916bc3d43c21e1e845cc049dbf (patch) | |
| tree | cc919b02d5929318dc259912ada0fd1004116c0f /src/tools/rust-analyzer | |
| parent | bc5df9b057a1ab9f8d9c387cde9a7dbab0e1462b (diff) | |
| download | rust-5b9e6f1b75f14d916bc3d43c21e1e845cc049dbf.tar.gz rust-5b9e6f1b75f14d916bc3d43c21e1e845cc049dbf.zip | |
Add write! and writeln! to minicore
Diffstat (limited to 'src/tools/rust-analyzer')
| -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] |
