aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-02 14:16:26 +0000
committerGitHub <[email protected]>2021-01-02 14:16:26 +0000
commit3b347eaa4eae6d15921bd618471576b48c81afef (patch)
treed924c3b69514b97faf55c5a743a43df339453b50 /crates/hir_ty/src/tests
parentaa3ce16f2641b7eb562a8eae67738b0ff0c0b7b0 (diff)
parent63e330f402136a3a447f497f800752314bdb5a50 (diff)
Merge #7134
7134: Fix infer error of macro invocation in array expr r=edwin0cheng a=edwin0cheng Fixed following infer error: ```rust macro_rules! bar { () => {0u32} } fn test() { let a = [bar!()]; // a : [unknown] } ``` bors r+ Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/tests')
-rw-r--r--crates/hir_ty/src/tests/regression.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index 307a257b1..cffe8630b 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -326,6 +326,24 @@ fn infer_paren_macro_call() {
326} 326}
327 327
328#[test] 328#[test]
329fn infer_array_macro_call() {
330 check_infer(
331 r#"
332 macro_rules! bar { () => {0u32} }
333 fn test() {
334 let a = [bar!()];
335 }
336 "#,
337 expect![[r#"
338 !0..4 '0u32': u32
339 44..69 '{ ...()]; }': ()
340 54..55 'a': [u32; _]
341 58..66 '[bar!()]': [u32; _]
342 "#]],
343 );
344}
345
346#[test]
329fn bug_1030() { 347fn bug_1030() {
330 check_infer( 348 check_infer(
331 r#" 349 r#"