Commit 504973d
authored
Rollup merge of #154867 - chenyukang:yukang-fix-151408-private-fields-diagnostic, r=Kivooeo
Fix private fields diagnostics and improve error messages
Fixes rust-lang/rust#151408
while the best solution may be check whether the code is under user's control, e.g. in the same workspace. but if user does not provide some fields, mention other private fields seems weird, see the test case:
```console
LL | let _ = std::collections::HashMap {};
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: private field `base` that was not provided
```
since we already suggested to use associated function to construct, it's better to remove the note.
this fix only provide note on private fields when `did.is_local()` or user have already provide some fields.0 file changed
0 commit comments