about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKelvin Ly <kelvin.ly1618@gmail.com>2015-07-31 08:22:07 -0400
committerKelvin Ly <kelvin.ly1618@gmail.com>2015-07-31 08:22:51 -0400
commit412366fe36ea5c44803c3a9bf9943684a5068d63 (patch)
tree8bf85db21f9eb8063d16cd2c3786821d04b7e0cb
parenta7b8f5bc47966bc995004f5905f831be4b68d026 (diff)
downloadrust-412366fe36ea5c44803c3a9bf9943684a5068d63.tar.gz
rust-412366fe36ea5c44803c3a9bf9943684a5068d63.zip
Add diagnostic messages for E0074-E0077
-rw-r--r--src/librustc_typeck/diagnostics.rs61
1 files changed, 57 insertions, 4 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index d94870c68bd..4526ee98962 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -826,6 +826,63 @@ struct Foo { x: Option<Box<Foo>> }
 Now it's possible to create at least one instance of `Foo`: `Foo { x: None }`.
 "##,
 
+E0074: r##"
+When using the `#[simd]` attribute on a tuple struct, the components of the
+tuple struct must all be of a concrete, nongeneric type so the compiler can
+reason about how to use SIMD with them. This error will occur if the types
+are generic.
+
+```
+#[simd]
+struct Bad<T>(T, T, T); // This will cause an error
+
+#[simd]
+struct Good(u32, u32, u32); // This will not
+```
+"##,
+
+E0075: r##"
+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.
+
+```
+#[simd]
+struct Bad; // This will cause an error
+
+#[simd]
+struct Good(u32); // This will not
+```
+"##,
+
+E0076: r##"
+When using the `#[simd]` attribute to automatically use SIMD operations in tuple
+struct, the types in the struct must all be of the same type, or the compiler
+will trigger this error.
+
+```
+#[simd]
+struct Bad(u16, u32, u32); // This will cause an error
+
+#[simd]
+struct Good(u32, u32, u32); // This will not
+```
+
+"##,
+
+E0077: r##"
+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.
+
+```
+#[simd]
+struct Bad(String); // This will cause an error
+
+#[simd]
+struct Good(u32, u32, u32); // This will not
+```
+"##,
+
 E0081: r##"
 Enum discriminants are used to differentiate enum variants stored in memory.
 This error indicates that the same value was used for two or more variants,
@@ -2299,10 +2356,6 @@ https://doc.rust-lang.org/std/marker/struct.PhantomData.html
 
 register_diagnostics! {
     E0068,
-    E0074,
-    E0075,
-    E0076,
-    E0077,
     E0085,
     E0086,
     E0090,