rustc-targets 0.1.0

Get the list of targets supported by rustc.
Documentation

rustc-targets

crates.io crates.io

Library for getting the list of targets supported by rustc.

Usage

Add this to your Cargo.toml:

[dependencies]
rustc-targets = "0.1"

after that you can use it like this:

fn main() {
    let targets = rustc_targets::from_cli().unwrap();
    for (i,target) in targets.iter().unwrap().enumerate() {
        println!("{i}. {target}");
    }
}

Running example

cargo run --example targets

License