Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r--crates/hir_expand/src/builtin_macro.rs82
1 files changed, 0 insertions, 82 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 55dc665c5d..f988ffff09 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -670,88 +670,6 @@ mod tests {
}
#[test]
- fn test_assert_expand() {
- check_expansion(
- r#"
- #[rustc_builtin_macro]
- macro_rules! assert {
- ($cond:expr) => ({ /* compiler built-in */ });
- ($cond:expr, $($args:tt)*) => ({ /* compiler built-in */ })
- }
- assert!(true, "{} {:?}", arg1(a, b, c), arg2);
- "#,
- expect![[r#"{if!true{$crate::panic!("{} {:?}",arg1(a,b,c),arg2);}}"#]],
- );
- }
-
- #[test]
- fn test_compile_error_expand() {
- check_expansion(
- r#"
- #[rustc_builtin_macro]
- macro_rules! compile_error {
- ($msg:expr) => ({ /* compiler built-in */ });
- ($msg:expr,) => ({ /* compiler built-in */ })
- }
- compile_error!("error!");
- "#,
- // This expands to nothing (since it's in item position), but emits an error.
- expect![[""]],
- );
- }
-
- #[test]
- fn test_format_args_expand() {
- check_expansion(
- r#"
- #[rustc_builtin_macro]
- macro_rules! format_args {
- ($fmt:expr) => ({ /* compiler built-in */ });
- ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
- }
- format_args!("{} {:?}", arg1(a, b, c), arg2);
- "#,
- expect![[
- r#"unsafe{std::fmt::Arguments::new_v1(&[], &[std::fmt::ArgumentV1::new(&(arg1(a,b,c)),std::fmt::Display::fmt),std::fmt::ArgumentV1::new(&(arg2),std::fmt::Display::fmt),])}"#
- ]],
- );
- }
-
- #[test]
- fn test_format_args_expand_with_comma_exprs() {
- check_expansion(
- r#"
- #[rustc_builtin_macro]
- macro_rules! format_args {
- ($fmt:expr) => ({ /* compiler built-in */ });
- ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
- }
- format_args!("{} {:?}", a::<A,B>(), b);
- "#,
- expect![[
- r#"unsafe{std::fmt::Arguments::new_v1(&[], &[std::fmt::ArgumentV1::new(&(a::<A,B>()),std::fmt::Display::fmt),std::fmt::ArgumentV1::new(&(b),std::fmt::Display::fmt),])}"#
- ]],
- );
- }
-
- #[test]
- fn test_format_args_expand_with_broken_member_access() {
- check_expansion(
- r#"
- #[rustc_builtin_macro]
- macro_rules! format_args {
- ($fmt:expr) => ({ /* compiler built-in */ });
- ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
- }
- format_args!("{} {:?}", a.);
- "#,
- expect![[
- r#"unsafe{std::fmt::Arguments::new_v1(&[], &[std::fmt::ArgumentV1::new(&(a.),std::fmt::Display::fmt),])}"#
- ]],
- );
- }
-
- #[test]
fn test_include_bytes_expand() {
check_expansion(
r#"