Skip to content

HIR printing of existential type is broken #60662

Closed

Description

@oli-obk
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 :

Activity

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    A-prettyArea: Pretty printing (including `-Z unpretty`)
    A-HIRArea: The high-level intermediate representation (HIR)
    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
    on May 9, 2019
  2. Pulkit07 commented on May 9, 2019

    @Pulkit07
    Contributor

    Hi, I will like to work on this issue.

  3. oli-obk commented on May 9, 2019

    @oli-obk
    ContributorAuthor

    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 ;)

  4. alexreg commented on May 9, 2019

    @alexreg
    Contributor

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

  5. Pulkit07 commented on May 10, 2019

    @Pulkit07
    Contributor

    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

  6. oli-obk commented on May 10, 2019

    @oli-obk
    ContributorAuthor

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

  7. Pulkit07 commented on May 10, 2019

    @Pulkit07
    Contributor

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

    Added that, many thanks!

  8. added a commit that references this issue on May 12, 2019
  9. added a commit that references this issue on May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-HIRArea: The high-level intermediate representation (HIR)A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-prettyArea: Pretty printing (including `-Z unpretty`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions