Library for getting the list of targets supported by rustc.
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}"); } }
cargo run --example targets