From 97a1653f09e17d36cbac6e3455a48abfd6cc2ed7 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 26 Nov 2019 13:47:06 +0100 Subject: [PATCH] Clean up E0077 long explanation --- src/librustc_error_codes/error_codes/E0077.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0077.md b/src/librustc_error_codes/error_codes/E0077.md index 6ae35a6aa17f..b14513c6ccf1 100644 --- a/src/librustc_error_codes/error_codes/E0077.md +++ b/src/librustc_error_codes/error_codes/E0077.md @@ -1,20 +1,23 @@ -When using the `#[simd]` attribute on a tuple struct, the elements in the tuple -must be machine types so SIMD operations can be applied to them. +A tuple struct's element isn't a machine type when using the `#[simd]` +attribute. -This will cause an error: +Erroneous code example: ```compile_fail,E0077 #![feature(repr_simd)] #[repr(simd)] -struct Bad(String); +struct Bad(String); // error! ``` -This will not: +When using the `#[simd]` attribute on a tuple struct, the elements in the tuple +must be machine types so SIMD operations can be applied to them. + +Fixed example: ``` #![feature(repr_simd)] #[repr(simd)] -struct Good(u32, u32, u32); +struct Good(u32, u32, u32); // ok! ```