Skip to content

[[bin]] stanza of Cargo.toml not documented well #6913

Closed
@jweinst1

Description

@jweinst1

Problem

In various crates on github, i have seen that the [[bin]] stanza in Cargo.toml can be used to specify executables that will be installed upon installing the crate, such as

[[bin]]
bench = false
path = "src/main.rs"
name = "rg"

Except, that stanza is not documented well on https://doc.rust-lang.org/cargo/reference/manifest.html it mentions it as specifying an executable, but not anything about where that executable is installed, or that it's even put on the PATH. I think this would be an important knowledge point because it's relevant to how executables can be used after installing a crate, instead of doing cargo build and cargo run.

Steps

  1. Go to https://doc.rust-lang.org/cargo/reference/manifest.html

Possible Solution(s)

Document the following

  1. More info on how executables are installed, should be similar in explanation to make install from cmake.
  2. What the [bin] stanza means and how it relates to executables getting put on the PATH.

Notes

Output of cargo version: Not applicable , docs related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions