@@ -41,7 +41,7 @@ use either::Either;
41
41
use hir_def:: {
42
42
adt:: VariantData ,
43
43
body:: { BodyDiagnostic , SyntheticSyntax } ,
44
- expr:: { BindingAnnotation , LabelId , Pat , PatId } ,
44
+ expr:: { BindingAnnotation , ExprOrPatId , LabelId , Pat , PatId } ,
45
45
generics:: { TypeOrConstParamData , TypeParamProvenance } ,
46
46
item_tree:: ItemTreeNode ,
47
47
lang_item:: LangItemTarget ,
@@ -85,9 +85,10 @@ pub use crate::{
85
85
diagnostics:: {
86
86
AnyDiagnostic , BreakOutsideOfLoop , InactiveCode , IncorrectCase , InvalidDeriveTarget ,
87
87
MacroError , MalformedDerive , MismatchedArgCount , MissingFields , MissingMatchArms ,
88
- MissingUnsafe , NoSuchField , PrivateField , ReplaceFilterMapNextWithFindMap , TypeMismatch ,
89
- UnimplementedBuiltinMacro , UnresolvedExternCrate , UnresolvedImport , UnresolvedMacroCall ,
90
- UnresolvedModule , UnresolvedProcMacro ,
88
+ MissingUnsafe , NoSuchField , PrivateAssocItem , PrivateField ,
89
+ ReplaceFilterMapNextWithFindMap , TypeMismatch , UnimplementedBuiltinMacro ,
90
+ UnresolvedExternCrate , UnresolvedImport , UnresolvedMacroCall , UnresolvedModule ,
91
+ UnresolvedProcMacro ,
91
92
} ,
92
93
has_source:: HasSource ,
93
94
semantics:: { PathResolution , Semantics , SemanticsScope , TypeInfo , VisibleTraits } ,
@@ -1358,6 +1359,20 @@ impl DefWithBody {
1358
1359
let field = field. into ( ) ;
1359
1360
acc. push ( PrivateField { expr, field } . into ( ) )
1360
1361
}
1362
+ & hir_ty:: InferenceDiagnostic :: PrivateAssocItem { id, item } => {
1363
+ let expr_or_pat = match id {
1364
+ ExprOrPatId :: ExprId ( expr) => source_map
1365
+ . expr_syntax ( expr)
1366
+ . expect ( "unexpected synthetic" )
1367
+ . map ( Either :: Left ) ,
1368
+ ExprOrPatId :: PatId ( pat) => source_map
1369
+ . pat_syntax ( pat)
1370
+ . expect ( "unexpected synthetic" )
1371
+ . map ( Either :: Right ) ,
1372
+ } ;
1373
+ let item = item. into ( ) ;
1374
+ acc. push ( PrivateAssocItem { expr_or_pat, item } . into ( ) )
1375
+ }
1361
1376
}
1362
1377
}
1363
1378
for ( expr, mismatch) in infer. expr_type_mismatches ( ) {
0 commit comments