MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / has_feature

Function has_feature

build.rs:227–232  ·  view source on GitHub ↗

Test whether the rustc at `var("RUSTC")` supports the given feature.

(feature: &str)

Source from the content-addressed store, hash-verified

225
226/// Test whether the rustc at `var("RUSTC")` supports the given feature.
227fn has_feature(feature: &str) -> bool {
228 can_compile(format!(
229 "#![allow(stable_features)]\n#![feature({})]",
230 feature
231 ))
232}
233
234/// Test whether the rustc at `var("RUSTC")` can compile the given code.
235fn can_compile<T: AsRef<str>>(test: T) -> bool {

Callers 1

use_feature_or_nothingFunction · 0.85

Calls 1

can_compileFunction · 0.85

Tested by

no test coverage detected