diff options
author | Edwin Cheng <[email protected]> | 2019-11-11 06:15:09 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-11 06:15:09 +0000 |
commit | c4aa8b63bcea5faa23da56b679cafbdbad6892f1 (patch) | |
tree | 759950e504bb0fa8115c85ea7e606e20c609f40c /crates/ra_hir/src | |
parent | 1637a8a59071d8c7976ffc8d04edc5b7f54ae40b (diff) |
Add line macro and tests
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index e56b9356e..896bf2924 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -4810,3 +4810,22 @@ fn no_such_field_diagnostics() { | |||
4810 | "### | 4810 | "### |
4811 | ); | 4811 | ); |
4812 | } | 4812 | } |
4813 | |||
4814 | #[test] | ||
4815 | fn infer_builtin_macros_line() { | ||
4816 | assert_snapshot!( | ||
4817 | infer(r#" | ||
4818 | #[rustc_builtin_macro] | ||
4819 | macro_rules! line {() => {}} | ||
4820 | |||
4821 | fn main() { | ||
4822 | let x = line!(); | ||
4823 | } | ||
4824 | "#), | ||
4825 | @r###" | ||
4826 | ![0; 1) '6': i32 | ||
4827 | [64; 88) '{ ...!(); }': () | ||
4828 | [74; 75) 'x': i32 | ||
4829 | "### | ||
4830 | ); | ||
4831 | } | ||