aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-01 18:28:12 +0100
committerGitHub <[email protected]>2020-07-01 18:28:12 +0100
commitec1d1a1b709a6eafff07077cdf75291d01cda3b6 (patch)
treec5a3b33cb40cc4141c19c7ad2271c65a90abf0b4 /crates/ra_hir_ty
parent43dfd29d8db8acc13efa1da3ddaa4cad2363dea9 (diff)
parent4ef1d533bd26876125199208349701c2369c965c (diff)
Merge #5179
5179: ItemTree: Lower fields despite invalid type r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5147 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/tests.rs24
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]
511fn 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]
511fn missing_record_pat_field_diagnostic() { 535fn missing_record_pat_field_diagnostic() {
512 let diagnostics = TestDB::with_files( 536 let diagnostics = TestDB::with_files(
513 r" 537 r"