Skip to content
Permalink
Browse files

Function arguments should never get promoted

  • Loading branch information...
oli-obk committed Apr 5, 2019
1 parent dec0a98 commit 1f40580f626f71cdb6bdd7ca888c0d12941662d1
@@ -639,7 +639,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
per_local.insert(local);
}
}
cx.per_local[IsNotPromotable].insert(local);
cx.per_local[IsNotConst].insert(local);
}

LocalKind::Var if mode == Mode::Fn => {
@@ -0,0 +1,10 @@
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;

unsafe fn pclmul(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
_mm_clmulepi64_si128(a, b, imm8) //~ ERROR argument 3 is required to be a constant
}

fn main() {}
@@ -0,0 +1,8 @@
error: argument 3 is required to be a constant
--> $DIR/const_arg_wrapper.rs:7:5
|
LL | _mm_clmulepi64_si128(a, b, imm8)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit 1f40580

Please sign in to comment.
You can’t perform that action at this time.