-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consistently elide/don't elide types in diagnostics #118731
Comments
Hello, I would like to look at this. Is there something I need to be aware of? |
@Liewyec take a look at the conversation in the linked PR. The main thing to be careful with here is taking a look at the changes to the |
all right it seems simple enough, I will do this |
Be aware that by the nature of this part of the codebase (free-form tree comparisons), the logic can be daunting. Try to understand each chunk independently, particularly by getting a high level understanding first and then digging in, to avoid getting overwhelmed. It's not hard, just a lot of state to hold in your head and can take some time to build up that context. |
right now, the decision of whether to fully elide the type as
_
is inconsistent - it never happens for functions, fn pointers, tuples, refs where the pointee types are equal, or adts, but it does happen for primitives and ADTs behind a raw pointer. that is probably not intended? might be worth moving thet1 == t2
comparison up above the big match for consistency.rust/compiler/rustc_infer/src/infer/error_reporting/mod.rs
Lines 1510 to 1512 in eb53721
here is an example of it being inconsistent:
rust/tests/ui/issues/issue-17905-2.stderr
Lines 23 to 26 in cf2dff2
isize
is elided butstr
is not.i originally changed this to almost always elide the type, but @estebank is worried that will be confusing:
he suggested instead eliding if the type has either type params or projection types ("looks complicated", basically).
Originally posted by @jyn514 in #118730 (comment)
@rustbot label +A-diagnostics +E-medium
The text was updated successfully, but these errors were encountered: