diff options
author | Jonas Schievink <[email protected]> | 2020-07-01 18:24:39 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-07-01 18:24:39 +0100 |
commit | 4ef1d533bd26876125199208349701c2369c965c (patch) | |
tree | e1aa1cd96ce1fa068e20c8f87a8ad0bf71e266bd /crates/ra_hir_ty/src | |
parent | ad1a0e626b725cbd34dc0f290e5878264ab28b85 (diff) |
ItemTree: Lower fields despite invalid type
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 9084c3bed..eeac34d14 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -508,6 +508,30 @@ fn no_such_field_with_feature_flag_diagnostics_on_struct_fields() { | |||
508 | } | 508 | } |
509 | 509 | ||
510 | #[test] | 510 | #[test] |
511 | fn no_such_field_with_type_macro() { | ||
512 | let diagnostics = TestDB::with_files( | ||
513 | r" | ||
514 | macro_rules! Type { | ||
515 | () => { u32 }; | ||
516 | } | ||
517 | |||
518 | struct Foo { | ||
519 | bar: Type![], | ||
520 | } | ||
521 | impl Foo { | ||
522 | fn new() -> Self { | ||
523 | Foo { bar: 0 } | ||
524 | } | ||
525 | } | ||
526 | ", | ||
527 | ) | ||
528 | .diagnostics() | ||
529 | .0; | ||
530 | |||
531 | assert_snapshot!(diagnostics, @r###""###); | ||
532 | } | ||
533 | |||
534 | #[test] | ||
511 | fn missing_record_pat_field_diagnostic() { | 535 | fn missing_record_pat_field_diagnostic() { |
512 | let diagnostics = TestDB::with_files( | 536 | let diagnostics = TestDB::with_files( |
513 | r" | 537 | r" |