3

use `Span::find_ancestor_inside` to get right span in CastCheck by compiler-erro...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/95920
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.
neoserver,ios ssh client

Copy link

Contributor

@compiler-errors compiler-errors commented 12 days ago

This is a quick fix. This bad suggestion likely lives in other places... but thought it would be useful to fix all of the CastCheck ones first.

Let me know if reviewer would prefer I add more tests for each of the diagnostics in CastCheck, or would like to do a more thorough review of other suggestions that use spans in typeck. I would also be open to further suggestions on how to better expose an API that gives us the "best" span for a diagnostic suggestion.

Fixed #95919


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK