Skip to content

Disallow uses of unwrap in constellation.rs, compositor.rs, and pipeline.rs #10446

Closed

Description

@jdm

Three options:

  • shell script that greps for unwrap in those files and runs on travis
  • rustc lint that disallows calling any method named unwrap in files marked #[disallow(unwrap)]
  • a warning from highfive if any line in those files contains unwrap

Activity

  1. matthiaskrgr commented on Apr 6, 2016

    @matthiaskrgr
    Contributor

    - sh -c "! grep "\.unwrap(" components/compositing/compositor.rs components/compositing/pipeline.rs components/compositing/constellation.rs"
    could be directly written into travis.yml as a job.

    If that is sufficient, feel free to assign to me.

  2. matthiaskrgr commented on Apr 6, 2016

    @matthiaskrgr
    Contributor

    Or do you really want ".*unwrap.*"?
    There is also .unwrap_or_else([...]), I was not sure if that should match or not.

  3. jdm commented on Apr 6, 2016

    @jdm
    MemberAuthor

    Unwrap_or_else is fine, since it doesn't actually panic like unwrap does. And yes, I would be ok with using shell scripts for this, but we should make a separate script in etc/ci/ and invoke that from .travis.yml as well as places like https://github.com/servo/saltfs/blob/45a0596d2e7470187121b529d49796fd2668e850/buildbot/master/master.cfg#L112 .

  4. added
    C-assigned
    on Apr 6, 2016
  5. notriddle commented on Apr 6, 2016

    @notriddle
    Contributor

    Could we add it to tidy?

  6. added a commit that references this issue on Apr 7, 2016
    b7257e1
  7. added a commit that references this issue on Apr 7, 2016
    9a1a9e6
  8. jdm commented on Apr 7, 2016

    @jdm
    MemberAuthor

    I guess it seemed so specifically targeted (three files) that it seemed like the wrong tool to reach for.

  9. asajeffrey commented on Apr 8, 2016

    @asajeffrey
    Contributor

    I would be very happy to see this, for stopping regressions to #10124 and friends.

  10. added 4 commits that reference this issue on Apr 8, 2016
    1b0c181
    1015a00
    8731a73
    dc4fe7e
  11. added a commit that references this issue on Apr 8, 2016
    c56eb65
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-infrastructureC-assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions