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
proc_macro types Display impls don’t respect the input layout #56474
Comments
IMO we should, at least, provide some functionality, on |
If you’re interested, here’s my implementation for reference. |
This seems fine to me to add an an unstable basis to the |
I'm a bit worried changing |
In discussions in the past @dtolnay and I have felt that any changes to In that sense if we update displayed output and parsers break we'd consider it bugs in the parsers rather than the compiler, although we would of course work with the crates if there's enough fallout. |
This is an alternative, I suppose: #55780. |
Hey there,
I’m not sure whether it’s the expected behavior of the
Display
implementations for token types inproc_macro
, but theDisplay
implementations lose positional information. I made a blog post about it and release a crate to fix that problem, proc-macro-faithful-display.I posted that on Discord and @eddyb advised me to open an issue here. So here it is. Not sure whether:
Display
implementors have never meant to provide positional correctness.Display
correct and instead provide another type to perform the faithful display (like the.display()
function for&Path
).Display
.\o/
The text was updated successfully, but these errors were encountered: