From a9907a1dd14c8fbed0f1b46f2cdddde7c2c15bbe Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 26 Aug 2016 00:14:01 +0200 Subject: [PATCH] Small error code explanations improvements --- src/librustc_lint/types.rs | 1 - src/librustc_trans/diagnostics.rs | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 99df5c6e5f9..b0b5947145d 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -56,7 +56,6 @@ let Wrapping(x) = x; let y: usize = 1.wrapping_neg(); assert_eq!(x, y); ``` - "## } diff --git a/src/librustc_trans/diagnostics.rs b/src/librustc_trans/diagnostics.rs index f7f065a3562..18d31448b1a 100644 --- a/src/librustc_trans/diagnostics.rs +++ b/src/librustc_trans/diagnostics.rs @@ -23,8 +23,10 @@ extern "platform-intrinsic" { fn simd_add(a: T, b: T) -> T; } -unsafe { simd_add(0, 1); } -// error: invalid monomorphization of `simd_add` intrinsic +fn main() { + unsafe { simd_add(0, 1); } + // error: invalid monomorphization of `simd_add` intrinsic +} ``` The generic type has to be a SIMD type. Example: