Stream: t-compiler/major changes

Topic: rustdoc is using rustc_ast_pretty, would … compiler-team#403


triagebot (Jan 28 2021 at 21:18, on Zulip):

A new proposal has been announced: rustdoc is using rustc_ast_pretty, would it be possible to make it somewhat "stable"? #403. It will be announced at the next meeting to try and draw attention to it, but usually MCPs are not discussed during triage meetings. If you think this would benefit from discussion amongst the team, consider proposing a design meeting.

Jonas Schievink (Jan 28 2021 at 21:28, on Zulip):

What's meant by "stabilize" here? Why can't we update rustdoc when something changes, like we do for other compiler parts?

oli (Jan 29 2021 at 14:59, on Zulip):

this will still happen, the idea is to make sure everyone is aware that touching the pretty printer can aversely affect rustdoc output.

oli (Jan 29 2021 at 15:00, on Zulip):

I felt uneasy just using the "pretty" printer to generate user-visible text in rustdoc (and thus also adjusting pretty printing to be prettier in some cases so that users don't get weird documentation)

Wesley Wiser (Jan 29 2021 at 15:00, on Zulip):

Would part of this stabilization involve writing some kind of pretty-print tests so that we can easily validate that part of the compiler isn't changed? Or easily track when it does change?

oli (Jan 29 2021 at 15:00, on Zulip):

ideally rustdoc tests will catch it

oli (Jan 29 2021 at 15:01, on Zulip):

if we start using pprint more extensively in rustdoc, that may not always be the case

oli (Jan 29 2021 at 15:01, on Zulip):

which is fine

oli (Jan 29 2021 at 15:02, on Zulip):

but I still think we should make a concious decision about using pprint in rustdoc and not just silently do that and suddenly start making changes to pprint that make no sense if looking at it just from the pprint perspective

oli (Jan 29 2021 at 15:02, on Zulip):

we previously turned down PRs making pprint prettier iirc

nikomatsakis (Feb 04 2021 at 15:11, on Zulip):

How related is the pretty printer to rustfmt

nikomatsakis (Feb 04 2021 at 15:11, on Zulip):

Doesn't rustfmt use the rust AST?

nikomatsakis (Feb 04 2021 at 15:11, on Zulip):

I feel like ideally we'd have one unified thing that produces output visible to end users

nagisa (Feb 04 2021 at 15:15, on Zulip):

the pretty printer output is not at all readable AFAIR

nikomatsakis (Feb 08 2021 at 09:46, on Zulip):

so what is rustdoc using the pretty printer for?

Léo Lanteri Thauvin (Feb 08 2021 at 10:54, on Zulip):

I tried to read the code, to me it looks like it's using pprust to:

GuillaumeGomez (Feb 11 2021 at 12:03, on Zulip):

nikomatsakis said:

so what is rustdoc using the pretty printer for?

Currently, to display attributes

Last update: May 07 2021 at 06:30UTC