-
Notifications
You must be signed in to change notification settings - Fork 7
Propose updates to closure pretty print #17
base: master
Are you sure you want to change the base?
Conversation
2497280
to
a4c43a3
Compare
update_closure_printing.md
Outdated
{ | ||
let x = 20; | ||
|
||
// pretty print: mod1::f::{{closure}}#0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered the possible notation mod1::f::{{closure@src/main.rs:8:14: 10:6}}
instead? A nice property of the current output is the embedded textual span. I prefer to use labels for spans except for closures, as they are types that might appear very nested in their parent type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like that can be done with/after rust-lang/rust#70334.
From rust-lang/rust#70334 (comment) on that issue
For the user-facing stuff we might want to (but not for this issue, it should probably be separate) replace the #N disambiguator with @ file.rs:line:column instead (which would neatly fit in the {...}) - this could allow us to replace the odd [closure ...] type syntax with "just" a path (IIRC, @arora-aman has been looking at this for a different reason).
Because of rust-lang/rust@07e7823, So the last example would really print If this feels acceptable, I'll update the proposal. |
…tsakis pretty.rs: Update Closure and Generator print More detailed outline: rust-lang/project-rfc-2229#17 Closes: rust-lang/project-rfc-2229#11 r? `@nikomatsakis` cc `@eddyb` `@davidtwco` `@estebank`
Rendered
r? @rust-lang/wg-diagnostics @davidtwco