diff options
author | Edwin Cheng <[email protected]> | 2020-03-03 18:41:33 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-03-03 18:41:33 +0000 |
commit | e04c0f42227b2c72aa8ea40d6aea873669428267 (patch) | |
tree | 64c9f715cf4c9170617cfbd372ff9ed926957ccb /crates/ra_hir_ty/src/tests/macros.rs | |
parent | 074474fe00a08d394cbdcac2a136bca825d93377 (diff) |
Fix panic on eager expansion
Diffstat (limited to 'crates/ra_hir_ty/src/tests/macros.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/macros.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 55386c030..5d0efa0f4 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs | |||
@@ -439,6 +439,27 @@ fn main() { | |||
439 | } | 439 | } |
440 | 440 | ||
441 | #[test] | 441 | #[test] |
442 | fn infer_builtin_macros_concat_with_lazy() { | ||
443 | assert_snapshot!( | ||
444 | infer(r#" | ||
445 | macro_rules! hello {() => {"hello"}} | ||
446 | |||
447 | #[rustc_builtin_macro] | ||
448 | macro_rules! concat {() => {}} | ||
449 | |||
450 | fn main() { | ||
451 | let x = concat!(hello!(), concat!("world", "!")); | ||
452 | } | ||
453 | "#), | ||
454 | @r###" | ||
455 | ![0; 13) '"helloworld!"': &str | ||
456 | [104; 161) '{ ...")); }': () | ||
457 | [114; 115) 'x': &str | ||
458 | "### | ||
459 | ); | ||
460 | } | ||
461 | |||
462 | #[test] | ||
442 | fn infer_derive_clone_simple() { | 463 | fn infer_derive_clone_simple() { |
443 | let (db, pos) = TestDB::with_position( | 464 | let (db, pos) = TestDB::with_position( |
444 | r#" | 465 | r#" |