Skip to content

All fixed-size array impls show up as <unevaluated[]> #49208

Closed

Description

@eira-fransham

After #46882, when a trait bound fails and the trait was implemented by fixed-size arrays, the compiler will display an error like:

   = help: the following implementations were found:
             <[T; <unevaluated[]>] as Trait>
             <[T; <unevaluated[]>] as Trait>
             <[T; <unevaluated[]>] as Trait>
             <[T; <unevaluated[]>] as Trait>
           and 31 others

Which is pretty unhelpful. A solution would be to evaluate these and/or to show evaluated bounds preferably.

Activity

  1. oli-obk commented on Mar 20, 2018

    @oli-obk
    Contributor

    I can't reproduce triggering an error with these messages, do you have an example? I need it for a regression test, the fix was indeed as simple

    to evaluate these and/or to show evaluated bounds preferably.

  2. eira-fransham commented on Mar 21, 2018

    @eira-fransham
    ContributorAuthor

    It only appears if you explicitly disambiguate the trait, like <[T; N] as Foo>::foo(). Playground link here.

  3. estebank commented on Mar 21, 2018

    @estebank
    Contributor

    @oli-obk are you displaying these as <[(); _] as Foo>? I feel that'd be a reasonable output for this.

  4. oli-obk commented on Mar 22, 2018

    @oli-obk
    Contributor

    @estebank that would be a better fallback than <unevaluated[]>, but I'm currently trying to get at the actual value (though that triggers cycle errors atm when building libcore's array impls ^^)

  5. eira-fransham commented on Mar 22, 2018

    @eira-fransham
    ContributorAuthor

    @estebank That's better in some ways, but kinda implies that for<const T> [(); T]: Foo

  6. added 2 commits that reference this issue on Mar 23, 2018
    759ebda
    7936d7d
  7. added
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    on Dec 1, 2024
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-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions