]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #48018 - alexcrichton:require-const-arg, r=eddyb
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 7 Feb 2018 16:30:56 +0000 (08:30 -0800)
committerGitHub <noreply@github.com>
Wed, 7 Feb 2018 16:30:56 +0000 (08:30 -0800)
rustc: Add `#[rustc_args_required_const]`

This commit adds a new unstable attribute to the compiler which requires that
arguments to a function are always provided as constants. The primary use case
for this is SIMD intrinsics where arguments are defined by vendors to be
constant and in LLVM they indeed must be constant as well.

For now this is mostly just a semantic guarantee in rustc that an argument is a
constant when invoked, phases like trans don't actually take advantage of it
yet. This means that we'll be able to use this in stdsimd but we won't be able
to remove the `constify_*` macros just yet. Hopefully soon though!


Trivial merge