Skip to content

Document that extern crate test is still required for benchmarks with 2018 edition #121

Closed
@dekellum

Description

@dekellum

Originally reported in rust-lang/rust#55133, and of late it seems I'm not the only one surprised by the continued need to use extern crate test in each benchmark as a special case (and with edition="2018")

Currently the guide's Path clarity section doesn't seem to indicate there are any exceptions:

https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html

Here's a brief summary:

  • extern crate is no longer needed

Wouldn't it be helpful to add this or other exceptional cases as a footnote or under the More details: No more extern crate section, with some rationale as indicated in rust-lang/rust#55133? My attempt at a user-centric elaboration:

#![feature(test)] is unstable and doesn't by itself import the test pseudo-crate for benchmarks.

Cc @Mark-Simulacrum (not sure if you also disagree with documenting this discrepancy)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions