-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityPG-const-genericsProject group: Const genericsProject group: Const genericsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
I tried this code:
use std::arch::x86_64::*;
struct Test<const X: u8>;
impl<const X: u8> Test<X> {
const Y: i32 = (X | (X << 2) | (X << 4) | (X << 6)) as i32;
unsafe fn f(v: __m128i) -> __m128i {
_mm_shufflelo_epi16(v, Self::Y)
}
}
I expected to see this happen:
This code was accepted in Rust 1.53, so newer versions should also accept it.
Instead, this happened:
error: generic `Self` types are currently not permitted in anonymous constants
--> <source>:9:32
|
9 | _mm_shufflelo_epi16(v, Self::Y)
| ^^^^
|
note: not a concrete type
--> <source>:5:19
|
5 | impl<const X: u8> Test<X> {
| ^^^^^^^
error: aborting due to previous error
Meta
Tested using rustc 1.53 and 1.54 (and newer) from Compiler Explorer.
rodrimati1992
Metadata
Metadata
Assignees
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityPG-const-genericsProject group: Const genericsProject group: Const genericsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.