diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-22 16:07:37 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-22 16:07:37 +0000 |
commit | 506131e3e01a81546ab218e1764073061875ea2e (patch) | |
tree | d9f4f83de92e8b4a38ceb9ad6003f55d544373e1 /crates/ra_hir | |
parent | 404493e9df8cc34fab5ff0c605eef7700e687e80 (diff) | |
parent | 786544f022418ed7813e401aded31e4bd5451391 (diff) |
Merge #2357
2357: Expand file! to dummy "" r=edwin0cheng a=kjeremy
See https://github.com/rust-analyzer/rust-analyzer/pull/2355#issuecomment-557541873
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-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 74c12a0a2..b4bdd81f6 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -4857,3 +4857,22 @@ 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 | } | ||