4

Simpler diagnostic when passing arg to closure and missing borrow by Akida31 · P...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/102813
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

@Akida31 Akida31 commented Oct 8, 2022

fixes #64915

I followed roughly the instructions and the older PR #76362.
The number of references for the expected and the found types will be compared and depending on which has more the diagnostic will be emitted.

I'm not quite sure if my approach with the many span_bug!s is good, it could lead to some ICEs. Would it be better if those errors are ignored?

As far as I know the following code works similarly but in a different context. Is this probably reusable since it looks like it would emit better diagnostics?

When running the tests locally, a codegen test failed. Is there something I can/ should do about that?

If you have some improvements/ corrections please say so and I will happily include them.

r? @estebank (as you added the mentoring instructions to the issue)

estebank reacted with heart emoji

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK