Skip to content

#![test] on a crate has an... interesting effect #28134

Closed

Description

@jonas-schievink
<anon>:1:1: 1:4 error: unresolved import `std::prelude::v1::*`. Maybe a missing `extern crate std`?
<anon>:1 #![test]
         ^~~
error: aborting due to previous error

Activity

  1. Mark-Simulacrum commented on Nov 12, 2016

    @Mark-Simulacrum
    Member

    This appears to now be fixed.

    rustc 1.14.0-nightly (cae6ab1c4 2016-11-05)
    error: only functions may be used as tests
     --> <anon>:1:1
      |
    1 | #![test]
      | ^
    
    error: aborting due to previous error
    
  2. jonas-schievink commented on Nov 12, 2016

    @jonas-schievink
    ContributorAuthor

    Neat! Just needs a test if there isn't one already.

  3. Mark-Simulacrum commented on Nov 12, 2016

    @Mark-Simulacrum
    Member

    There's https://github.com/rust-lang/rust/blob/master/src/test/compile-fail/issue-14772.rs, but I'm not sure if that qualifies as testing this in particular. If not, I can add one.

  4. Mark-Simulacrum commented on May 16, 2017

    @Mark-Simulacrum
    Member

    Marking as E-needstest. I don't think the test I linked previously really fits this case.

  5. added
    E-needs-test
    on May 16, 2017
  6. added
    C-bug
    and removed on Jul 22, 2017
  7. added a commit that references this issue on Oct 4, 2018
  8. added a commit that references this issue on Oct 7, 2018
    987a50b
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

    C-bugE-needs-test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions