rustc-host 0.1.7

Get host target triplet of rustc.
Documentation

rustc-host

crates.io crates.io

Combined crate (library + binary) for getting the so-called "host triple" of rustc.

Usage as a library

Add this to your Cargo.toml:

[dependencies]
rustc-host = "0.1"

after that you can use it like this:

extern crate rustc_host;

fn main() {
    let host_triple = rustc_host::from_cli()
        .expect("failed to get host triple from rustc");
    println!("host triple: {}", host_triple);
}

Usage as a binary

Installation

cargo install rustc-host

Usage

rustc-host

Example output

x86_64-pc-windows-msvc

Features

  • unsafe - disabled by default, enables unsafe code that reuses the String buffer obtained from rustc -Vv instead of allocating a new one.

License