diff --git a/example/std_example.rs b/example/std_example.rs index 2f1fba590fd..fcc4ed3aa80 100644 --- a/example/std_example.rs +++ b/example/std_example.rs @@ -1,3 +1,5 @@ +#![feature(core_intrinsics)] + use std::io::Write; fn main() { @@ -7,5 +9,7 @@ fn main() { writeln!(stderr, "some {} text", "").unwrap(); - std::process::Command::new("true").env("c", "d").spawn(); + let _ = std::process::Command::new("true").env("c", "d").spawn(); + + println!("cargo:rustc-link-lib=z"); } diff --git a/src/intrinsics.rs b/src/intrinsics.rs index 3eaa7c06a76..624a929326b 100644 --- a/src/intrinsics.rs +++ b/src/intrinsics.rs @@ -330,7 +330,7 @@ pub fn codegen_intrinsic_call<'a, 'tcx: 'a>( ret.write_cvalue(fx, res); }; cttz | cttz_nonzero, (v arg) { - let res = CValue::ByVal(fx.bcx.ins().clz(arg), fx.layout_of(T)); + let res = CValue::ByVal(fx.bcx.ins().ctz(arg), fx.layout_of(T)); ret.write_cvalue(fx, res); }; ctpop, (v arg) {