-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unboxed closure types look weird in error messages #19939
Comments
Since unboxed closure types are anonymous this seems like the only reasonable way to identify them, even if it's a bit noisy. |
I think it’d be better if it just gave the input/return types in the type string, like |
How about |
Triage: this error has not changed. Updated code: fn main() {
let x: () = || {};
} |
@rust-lang/compiler: Any thoughts here? It looks like changing this might not be all that hard; if I'm following the code correctly the type information is there if we wanted to print it. It could help with debugging closure inference, too, I guess. |
We used to print the type information and removed it. It was sort of confusing, since it's not part of the type. There are also times when the type information is not available (i.e., we may not have inferred all the types yet). I'm not super-keen on how we print now, but I don't know what my preferred option is. cc @eddyb, who I think removed the type information from the print-outs and might be able to elaborate on why? |
@nikomatsakis I don't recall that. Was it ever printed?! How would one even go about that? |
I am 99.5% sure that we used to print the type signature for a closure; I think we went and peeked in various tables to try and extract it. I am not especially keen on doing that again, but I do feel like we have not yet found a "satisfactory" way to print closure types -- I agree that people would probably expect a closure type as something like Ye Olde |
Just Use Greek (TM): λ |
Some output options:
|
It looks like d258d68 might have changed this for debugging purposes, but forgot to change it back.
The text was updated successfully, but these errors were encountered: