diff options
author | cynecx <[email protected]> | 2021-04-18 18:56:13 +0100 |
---|---|---|
committer | cynecx <[email protected]> | 2021-04-18 18:56:13 +0100 |
commit | 6ed2fd233b569d01169fc888f30c358dd289d260 (patch) | |
tree | d5ff73fef371ac596e7c98db1c39c9dd3112f571 /crates/hir_ty/src/tests | |
parent | 3d39e77003c5fe5ed9f8f3ac00a170f3804f8337 (diff) |
hir_ty: keep body::Expander in TyLoweringContext
Diffstat (limited to 'crates/hir_ty/src/tests')
-rw-r--r-- | crates/hir_ty/src/tests/macros.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index cbe05a5c1..8de1e229f 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs | |||
@@ -1243,3 +1243,29 @@ fn macros_in_type_generics() { | |||
1243 | "#]], | 1243 | "#]], |
1244 | ); | 1244 | ); |
1245 | } | 1245 | } |
1246 | |||
1247 | #[test] | ||
1248 | fn infinitely_recursive_macro_type() { | ||
1249 | check_infer( | ||
1250 | r#" | ||
1251 | struct Bar<T>(T); | ||
1252 | |||
1253 | macro_rules! Foo { | ||
1254 | () => { Foo!() } | ||
1255 | } | ||
1256 | |||
1257 | type A = Foo!(); | ||
1258 | type B = Bar<Foo!()>; | ||
1259 | |||
1260 | fn main() { | ||
1261 | let a: A; | ||
1262 | let b: B; | ||
1263 | } | ||
1264 | "#, | ||
1265 | expect![[r#" | ||
1266 | 112..143 '{ ...: B; }': () | ||
1267 | 122..123 'a': {unknown} | ||
1268 | 136..137 'b': Bar<{unknown}> | ||
1269 | "#]], | ||
1270 | ); | ||
1271 | } | ||