File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ impl Ctx {
211211 fn lower_record_field ( & mut self , field : & ast:: RecordFieldDef ) -> Option < Field > {
212212 let name = field. name ( ) ?. as_name ( ) ;
213213 let visibility = self . lower_visibility ( field) ;
214- let type_ref = self . lower_type_ref ( & field. ascribed_type ( ) ? ) ;
214+ let type_ref = self . lower_type_ref_opt ( field. ascribed_type ( ) ) ;
215215 let res = Field { name, type_ref, visibility } ;
216216 Some ( res)
217217 }
Original file line number Diff line number Diff line change @@ -507,6 +507,30 @@ fn no_such_field_with_feature_flag_diagnostics_on_struct_fields() {
507507 assert_snapshot ! ( diagnostics, @r###""### ) ;
508508}
509509
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+
510534#[ test]
511535fn missing_record_pat_field_diagnostic ( ) {
512536 let diagnostics = TestDB :: with_files (
You can’t perform that action at this time.
0 commit comments