Support examples with their own Cargo.toml files #15324
Labels
A-examples
Area: example targets
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
The official package layout says that there can be an
examples
folder in a cargo package. Thisexamples
folder currently supportsexamples/foo.rs
standalone filesexamples/foo/main.rs
files in subfolders with supporting modulesI can compile and run these examples with
However, some examples require a more complex setup. The examples folder of the axum project contains many subfolders and each subfolder contains a cargo package with a
Cargo.toml
.It would be nice if
cargo run --example foo
supported a third case:examples/foo/Cargo.toml
should run the default binary from the cargo example package.Proposed Solution
Cargo.toml
files inside theexamples
foldercargo run
subprocess.Notes
No response
The text was updated successfully, but these errors were encountered: