]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide/src/syntax_highlighting/tests.rs
Work around tidy check
[rust.git] / crates / ide / src / syntax_highlighting / tests.rs
index 91d29a96bfcbf5de14abc5cdc7abaae778cbf8ce..f5f7d8fe95166be533bcf619f3daf003a0d34cee 100644 (file)
@@ -441,10 +441,14 @@ macro_rules! println {
     })
 }
 #[rustc_builtin_macro]
-macro_rules! format_args_nl {
-    ($fmt:expr) => {{ /* compiler built-in */ }};
-    ($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }};
-}
+#[macro_export]
+macro_rules! format_args {}
+#[rustc_builtin_macro]
+#[macro_export]
+macro_rules! const_format_args {}
+#[rustc_builtin_macro]
+#[macro_export]
+macro_rules! format_args_nl {}
 
 mod panic {
     pub macro panic_2015 {
@@ -469,7 +473,15 @@ mod panic {
 }
 
 #[rustc_builtin_macro(std_panic)]
+#[macro_export]
 macro_rules! panic {}
+#[rustc_builtin_macro]
+macro_rules! assert {}
+
+macro_rules! toho {
+    () => ($crate::panic!("not yet implemented"));
+    ($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
+}
 
 fn main() {
     // from https://doc.rust-lang.org/std/fmt/index.html
@@ -522,6 +534,9 @@ fn main() {
     println!("{:x?} {} ", thingy, n2);
     panic!("{}", 0);
     panic!("more {}", 1);
+    assert!(true, "{}", 1);
+    assert!(true, "{} asdasd", 1);
+    toho!("{}fmt", 0);
 }"#
         .trim(),
         expect_file!["./test_data/highlight_strings.html"],