Skip to content
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

Pretty printing loses associated type generics and where clauses #67509

Closed
Tracked by #44265
matthewjasper opened this issue Dec 22, 2019 · 1 comment · Fixed by #68913
Closed
Tracked by #44265

Pretty printing loses associated type generics and where clauses #67509

matthewjasper opened this issue Dec 22, 2019 · 1 comment · Fixed by #68913
Labels
A-GATs Area: Generic associated types (GATs) A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthewjasper
Copy link
Contributor

The following code:

#![feature(generic_associated_types)]

trait X {
    type Y<T>: i32 where Self: Sized;
}

impl X for () {
    type Y<T> where Self: Sized = u32;
}

is pretty printed as

#![feature(generic_associated_types)]

trait X {
    type
    Y: i32;
}

impl X for () {
    type
    Y
    =
    u32;
}

This presumably also affects procedural macros.

@matthewjasper matthewjasper added A-pretty Area: Pretty printing (including `-Z unpretty`) E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. C-bug Category: This is a bug. F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs labels Dec 22, 2019
@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 22, 2019
@basil-cow
Copy link
Contributor

Are there tests intended for pretty printing? I got the impression that pretty folder only tests specific features and bugs, not the form

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 8, 2020
Pretty-print generic params and where clauses on associated types

closes rust-lang#67509
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 8, 2020
Pretty-print generic params and where clauses on associated types

closes rust-lang#67509
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 8, 2020
Pretty-print generic params and where clauses on associated types

closes rust-lang#67509
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 9, 2020
Pretty-print generic params and where clauses on associated types

closes rust-lang#67509
@bors bors closed this as completed in da00582 Feb 9, 2020
@fmease fmease added the A-GATs Area: Generic associated types (GATs) label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-GATs Area: Generic associated types (GATs) A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants