]> git.lizzy.rs Git - rust.git/commit
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)
commit993322e886139457f063a79f4182da736db181df
treef5d8fd48019aa26b8f9281d4004e96ea02483e0c
parent6908fb762d5f7952ed7d31cf34405b9149a51e02
parent27a4e73ca54f454d16cab7942ef9b27d5c942a32
Rollup merge of #48018 - alexcrichton:require-const-arg, r=eddyb

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!