fix ice where unsafe fn was incorrectly handled #150213
Open
+57
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? WaffleLapkin (it seems that the fixme in wildcard branch is yours, and i partially resolved it, at least as far as i understand, you might have different vision and/or feel free to reroll in case you are busy with irl things)
i don't quite fully understand this part of code, but it somewhat working, at least i don't fully understand the part why cases like
is already correctly rejected by compiler, but this snippet from issue with match isn't
second unsureness is from i dont really understand if this is correct to emit error like this
so the problem is that this gets into wildcard where it get replace with
*entry.get_mut() = adj;(also after this gets replaced it breaks mir) and just hoping for best, but then this closure gets intofn_sig()and icesaccording to what i said above, the best approach i came up with is add the special case for this and emit error
in case i do
span_delayed_buginstead of hard error i still get thisalso not sure about error message itself if everything else is fine, maybe just using "match arms have incompatible types"
fixes #150128