Skip to content

Better error message needed when user creates a bench rather than a benches dir #9014

@gilescope

Description

@gilescope

A common error with benchmarking is to call the dir bench rather than benches.

This is the error message a user currently gets:

error: failed to parse manifest at `<snip>/Cargo.toml`

Caused by:
  can't find `my_benchmark` bench, specify bench.path

It fails the esteban test as it doesn't hint as to what we've done wrong.

At a minimum can we change it to this please?

Caused by:
  can't find `benches/my_benchmark` bench, specify bench.path

That way they stand a chance of spotting there's an issue. Personally I think it's worth testing for a bench dir and having an explicit message because so many people must do this and then kick themselves when the penny drops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions