aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-21 10:12:18 +0000
committerGitHub <[email protected]>2019-12-21 10:12:18 +0000
commit3ebf15c9b29b1fed6319d04f540ad48cd4bd6995 (patch)
treec2fae7b1124bbbbde3cc9c9658997b9a22720efa /crates/ra_hir_ty/src/tests
parentb902d4403a791265fa38ef6ba33554ad28350519 (diff)
parentc1166697a74bca690443525ced8cd8bc08894779 (diff)
Merge #2626
2626: Recursive collect macros in impl items r=matklad a=edwin0cheng Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs
index 7fdbf996f..69c695cc8 100644
--- a/crates/ra_hir_ty/src/tests/macros.rs
+++ b/crates/ra_hir_ty/src/tests/macros.rs
@@ -202,6 +202,29 @@ fn test() { S.foo()<|>; }
202} 202}
203 203
204#[test] 204#[test]
205fn infer_impl_items_generated_by_macros_chain() {
206 let t = type_at(
207 r#"
208//- /main.rs
209macro_rules! m_inner {
210 () => {fn foo(&self) -> u128 {0}}
211}
212macro_rules! m {
213 () => {m_inner!();}
214}
215
216struct S;
217impl S {
218 m!();
219}
220
221fn test() { S.foo()<|>; }
222"#,
223 );
224 assert_eq!(t, "u128");
225}
226
227#[test]
205fn infer_macro_with_dollar_crate_is_correct_in_expr() { 228fn infer_macro_with_dollar_crate_is_correct_in_expr() {
206 let (db, pos) = TestDB::with_position( 229 let (db, pos) = TestDB::with_position(
207 r#" 230 r#"