diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 74c12a0a2..17a50cf74 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -4857,3 +4857,41 @@ fn main() { | |||
4857 | "### | 4857 | "### |
4858 | ); | 4858 | ); |
4859 | } | 4859 | } |
4860 | |||
4861 | #[test] | ||
4862 | fn infer_builtin_macros_file() { | ||
4863 | assert_snapshot!( | ||
4864 | infer(r#" | ||
4865 | #[rustc_builtin_macro] | ||
4866 | macro_rules! file {() => {}} | ||
4867 | |||
4868 | fn main() { | ||
4869 | let x = file!(); | ||
4870 | } | ||
4871 | "#), | ||
4872 | @r###" | ||
4873 | ![0; 2) '""': &str | ||
4874 | [64; 88) '{ ...!(); }': () | ||
4875 | [74; 75) 'x': &str | ||
4876 | "### | ||
4877 | ); | ||
4878 | } | ||
4879 | |||
4880 | #[test] | ||
4881 | fn infer_builtin_macros_column() { | ||
4882 | assert_snapshot!( | ||
4883 | infer(r#" | ||
4884 | #[rustc_builtin_macro] | ||
4885 | macro_rules! column {() => {}} | ||
4886 | |||
4887 | fn main() { | ||
4888 | let x = column!(); | ||
4889 | } | ||
4890 | "#), | ||
4891 | @r###" | ||
4892 | ![0; 2) '13': i32 | ||
4893 | [66; 92) '{ ...!(); }': () | ||
4894 | [76; 77) 'x': i32 | ||
4895 | "### | ||
4896 | ); | ||
4897 | } | ||