MCPcopy Create free account
hub / github.com/bytecodealliance/system-interface / has_feature

Function has_feature

build.rs:36–41  ·  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

34
35/// Test whether the rustc at `var("RUSTC")` supports the given feature.
36fn has_feature(feature: &str) -> bool {
37 can_compile(format!(
38 "#![allow(stable_features)]\n#![feature({})]",
39 feature
40 ))
41}
42
43/// Test whether the rustc at `var("RUSTC")` can compile the given code.
44fn 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