gcc/testsuite/rust/compile/torture/intrinsics-7.rs
raw| 1 | #![feature(intrinsics)] |
| 2 | |
| 3 | #[lang = "sized"] |
| 4 | pub trait Sized {} |
| 5 | |
| 6 | extern "rust-intrinsic" { |
| 7 | pub fn unchecked_add<T>(x: T, y: T) -> T; |
| 8 | // { dg-error "unchecked operation intrinsics can only be used with basic integer types .got .NotAdd.." "" { target *-*-* } .-1 } |
| 9 | } |
| 10 | |
| 11 | fn main() { |
| 12 | struct NotAdd; |
| 13 | |
| 14 | unsafe { unchecked_add(NotAdd, NotAdd) }; |
| 15 | } |