aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-05-17 16:37:30 +0100
committerEdwin Cheng <[email protected]>2020-05-17 16:37:30 +0100
commit12a3bf3c31d4c9a6d9ee110db174604f688ca0f0 (patch)
tree951a9cffac26108963a42f31c44739aa3700d8c2 /crates/ra_hir_ty/src/tests
parentebaa05a4478096aaf3bc2a48d0d171a287422c7c (diff)
Create LowerCtx on the fly
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/regression.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs
index 115ad8328..c2168222e 100644
--- a/crates/ra_hir_ty/src/tests/regression.rs
+++ b/crates/ra_hir_ty/src/tests/regression.rs
@@ -564,6 +564,37 @@ fn main() {
564} 564}
565 565
566#[test] 566#[test]
567fn issue_4465_dollar_crate_at_type() {
568 assert_snapshot!(
569 infer(r#"
570pub struct Foo {}
571pub fn anything<T>() -> T {
572 loop {}
573}
574macro_rules! foo {
575 () => {{
576 let r: $crate::Foo = anything();
577 r
578 }};
579}
580fn main() {
581 let _a = foo!();
582}
583"#), @r###"
584 45..60 '{ loop {} }': T
585 51..58 'loop {}': !
586 56..58 '{}': ()
587 !0..31 '{letr:...g();r}': Foo
588 !4..5 'r': Foo
589 !18..26 'anything': fn anything<Foo>() -> Foo
590 !18..28 'anything()': Foo
591 !29..30 'r': Foo
592 164..188 '{ ...!(); }': ()
593 174..176 '_a': Foo
594"###);
595}
596
597#[test]
567fn issue_4053_diesel_where_clauses() { 598fn issue_4053_diesel_where_clauses() {
568 assert_snapshot!( 599 assert_snapshot!(
569 infer(r#" 600 infer(r#"