diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 74c12a0a2..3209c66bd 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -2550,8 +2550,6 @@ fn test() { | |||
2550 | [233; 246) 'GLOBAL_STATIC': u32 | 2550 | [233; 246) 'GLOBAL_STATIC': u32 |
2551 | [256; 257) 'w': u32 | 2551 | [256; 257) 'w': u32 |
2552 | [260; 277) 'GLOBAL...IC_MUT': u32 | 2552 | [260; 277) 'GLOBAL...IC_MUT': u32 |
2553 | [118; 120) '99': u32 | ||
2554 | [161; 163) '99': u32 | ||
2555 | "### | 2553 | "### |
2556 | ); | 2554 | ); |
2557 | } | 2555 | } |
@@ -4857,3 +4855,41 @@ fn main() { | |||
4857 | "### | 4855 | "### |
4858 | ); | 4856 | ); |
4859 | } | 4857 | } |
4858 | |||
4859 | #[test] | ||
4860 | fn infer_builtin_macros_file() { | ||
4861 | assert_snapshot!( | ||
4862 | infer(r#" | ||
4863 | #[rustc_builtin_macro] | ||
4864 | macro_rules! file {() => {}} | ||
4865 | |||
4866 | fn main() { | ||
4867 | let x = file!(); | ||
4868 | } | ||
4869 | "#), | ||
4870 | @r###" | ||
4871 | ![0; 2) '""': &str | ||
4872 | [64; 88) '{ ...!(); }': () | ||
4873 | [74; 75) 'x': &str | ||
4874 | "### | ||
4875 | ); | ||
4876 | } | ||
4877 | |||
4878 | #[test] | ||
4879 | fn infer_builtin_macros_column() { | ||
4880 | assert_snapshot!( | ||
4881 | infer(r#" | ||
4882 | #[rustc_builtin_macro] | ||
4883 | macro_rules! column {() => {}} | ||
4884 | |||
4885 | fn main() { | ||
4886 | let x = column!(); | ||
4887 | } | ||
4888 | "#), | ||
4889 | @r###" | ||
4890 | ![0; 2) '13': i32 | ||
4891 | [66; 92) '{ ...!(); }': () | ||
4892 | [76; 77) 'x': i32 | ||
4893 | "### | ||
4894 | ); | ||
4895 | } | ||