From 2af8cd2de87322858084bfc2598e766116178b5a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 26 Nov 2019 13:42:19 +0100 Subject: [PATCH] Clean up E0075 long explanation --- src/librustc_error_codes/error_codes/E0075.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0075.md b/src/librustc_error_codes/error_codes/E0075.md index f15af8150baa..969c1ee71313 100644 --- a/src/librustc_error_codes/error_codes/E0075.md +++ b/src/librustc_error_codes/error_codes/E0075.md @@ -1,21 +1,23 @@ -The `#[simd]` attribute can only be applied to non empty tuple structs, because -it doesn't make sense to try to use SIMD operations when there are no values to -operate on. +A `#[simd]` attribute was applied to an empty tuple struct. -This will cause an error: +Erroneous code example: ```compile_fail,E0075 #![feature(repr_simd)] #[repr(simd)] -struct Bad; +struct Bad; // error! ``` -This will not: +The `#[simd]` attribute can only be applied to non empty tuple structs, because +it doesn't make sense to try to use SIMD operations when there are no values to +operate on. + +Fixed example: ``` #![feature(repr_simd)] #[repr(simd)] -struct Good(u32); +struct Good(u32); // ok! ```