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

HIR printing of existential type is broken #60662

Closed
oli-obk opened this issue May 9, 2019 · 6 comments
Closed

HIR printing of existential type is broken #60662

oli-obk opened this issue May 9, 2019 · 6 comments

Comments

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 9, 2019

pub existential type ServeFut: Future<Output = ()>;

expanded with rustc --edition 2018 -Z unpretty=hir yields

pub existential type ServeFut : : Future<Output = ()>;

we should not print that extra :

@Pulkit07
Copy link
Contributor

@Pulkit07 Pulkit07 commented May 9, 2019

Hi, I will like to work on this issue.

@oli-obk
Copy link
Contributor Author

@oli-obk oli-obk commented May 9, 2019

awesome!

Most likely all that is required is to remove

self.word_space(":")?;

you can check if there's a test in src/tests/ui that has a // compile-flags comment with -Z unpretty=hir in it. If there is, just add the above test line to it and run tests with ./x.py test --stage 1 src/test/ui --test-args name-of-the-test --bless.

If there is no such test, add such a test ;)

@alexreg
Copy link
Contributor

@alexreg alexreg commented May 9, 2019

I think I fixed this in one of my PRs, but not sure when it will merge, so go for it. :-)

@Pulkit07
Copy link
Contributor

@Pulkit07 Pulkit07 commented May 10, 2019

While adding test, I am getting following error message:

unexpected error: '8:5: 8:43: existential types are unstable [E0658]'

The existing test can be seen here: https://github.com/rust-lang/rust/pull/60694/files#diff-b122eeedc759d82eab86eafd6445ce8e

@oli-obk
Copy link
Contributor Author

@oli-obk oli-obk commented May 10, 2019

you need to add #![feature(existential_types)] to the test

@Pulkit07
Copy link
Contributor

@Pulkit07 Pulkit07 commented May 10, 2019

you need to add #![feature(existential_types)] to the test

Added that, many thanks!

Pulkit07 added a commit to Pulkit07/rust that referenced this issue May 11, 2019
Centril added a commit to Centril/rust that referenced this issue May 12, 2019
Fix HIR printing of existential type rust-lang#60662

This fixes rust-lang#60662
bors added a commit that referenced this issue May 12, 2019
Rollup of 4 pull requests

Successful merges:

 - #60694 (Fix HIR printing of existential type #60662)
 - #60750 (syntax: Remove some legacy nonterminal tokens)
 - #60751 (Assorted cleanup in parser & AST validation)
 - #60752 (Fix minor typos for ItemLocalId)

Failed merges:

r? @ghost
@bors bors closed this in #60694 May 12, 2019
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants