test for more SIMD monomorphization errors
build-fail test for simd type with an element type that's a wide pointer test for SIMD element type of optional nonnull ptr to extern type test that wide ptr simd element type of *mut [u8] fails
This commit is contained in:
parent
3d738b0594
commit
d9a5df669c
5 changed files with 55 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
// run-pass
|
||||
// ignore-emscripten
|
||||
|
||||
#![feature(extern_types)]
|
||||
#![feature(repr_simd)]
|
||||
|
||||
use std::ptr::NonNull;
|
||||
|
||||
extern {
|
||||
type Extern;
|
||||
}
|
||||
|
||||
#[repr(simd)]
|
||||
struct S<T>(T);
|
||||
|
||||
#[inline(never)]
|
||||
fn identity<T>(v: T) -> T {
|
||||
v
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _v: S<[Option<NonNull<Extern>>; 4]> = identity(S([None; 4]));
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
// build-fail
|
||||
|
||||
#![feature(repr_simd)]
|
||||
|
||||
// error-pattern:monomorphising SIMD type `S<[*mut [u8]; 4]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
|
||||
|
||||
#[repr(simd)]
|
||||
struct S<T>(T);
|
||||
|
||||
fn main() {
|
||||
let _v: Option<S<[*mut [u8]; 4]>> = None;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
error: monomorphising SIMD type `S<[*mut [u8]; 4]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
12
src/test/ui/simd/simd-type-wide-ptr.rs
Normal file
12
src/test/ui/simd/simd-type-wide-ptr.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// build-fail
|
||||
|
||||
#![feature(repr_simd)]
|
||||
|
||||
// error-pattern:monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
|
||||
|
||||
#[repr(simd)]
|
||||
struct S([*mut [u8]; 4]);
|
||||
|
||||
fn main() {
|
||||
let _v: Option<S> = None;
|
||||
}
|
||||
4
src/test/ui/simd/simd-type-wide-ptr.stderr
Normal file
4
src/test/ui/simd/simd-type-wide-ptr.stderr
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
error: monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue