1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![allow(non_snake_case)]
13 register_long_diagnostics! {
16 Invalid monomorphization of an intrinsic function was used. Erroneous code
19 ```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail)
20 #![feature(platform_intrinsics)]
22 extern "platform-intrinsic" {
23 fn simd_add<T>(a: T, b: T) -> T;
27 unsafe { simd_add(0, 1); }
28 // error: invalid monomorphization of `simd_add` intrinsic
32 The generic type has to be a SIMD type. Example:
35 #![feature(repr_simd)]
36 #![feature(platform_intrinsics)]
39 #[derive(Copy, Clone)]
42 extern "platform-intrinsic" {
43 fn simd_add<T>(a: T, b: T) -> T;
46 unsafe { simd_add(i32x1(0), i32x1(1)); } // ok!