about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Lamparski <diagonaldevice@gmail.com>2017-11-13 20:13:26 -0500
committerMichael Lamparski <diagonaldevice@gmail.com>2017-11-14 08:24:28 -0500
commitdcbedf78a08f5ecb86d2e2816657b28f6eb4b83d (patch)
treedd3e4e3643b5de93ad581807564689134d546b97 /src/test
parent24840dab0bef0047beb428e1c15e9a851f732dcc (diff)
downloadrust-dcbedf78a08f5ecb86d2e2816657b28f6eb4b83d.tar.gz
rust-dcbedf78a08f5ecb86d2e2816657b28f6eb4b83d.zip
Add context to E0084, E00517, E0518
Show both the attribute and the item
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/E0084.rs6
-rw-r--r--src/test/compile-fail/E0517.rs12
-rw-r--r--src/test/compile-fail/E0518.rs6
-rw-r--r--src/test/compile-fail/attr-usage-inline.rs2
-rw-r--r--src/test/compile-fail/attr-usage-repr.rs10
-rw-r--r--src/test/compile-fail/feature-gate/issue-43106-gating-of-inline.rs23
6 files changed, 31 insertions, 28 deletions
diff --git a/src/test/compile-fail/E0084.rs b/src/test/compile-fail/E0084.rs
index c7c5662f1fe..8d0cf20008c 100644
--- a/src/test/compile-fail/E0084.rs
+++ b/src/test/compile-fail/E0084.rs
@@ -8,10 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[repr(i32)]
-enum Foo {}
-//~^ ERROR E0084
-//~| unsupported enum representation
+#[repr(i32)] //~ ERROR E0084
+enum Foo {} //~ zero-variant enum
 
 fn main() {
 }
diff --git a/src/test/compile-fail/E0517.rs b/src/test/compile-fail/E0517.rs
index b79cb2c44af..0de2ec12fa3 100644
--- a/src/test/compile-fail/E0517.rs
+++ b/src/test/compile-fail/E0517.rs
@@ -9,20 +9,16 @@
 // except according to those terms.
 
 #[repr(C)] //~ ERROR E0517
-           //~| requires a struct, enum or union
-type Foo = u8;
+type Foo = u8; //~ not a struct, enum or union
 
 #[repr(packed)] //~ ERROR E0517
-                //~| requires a struct
-enum Foo2 {Bar, Baz}
+enum Foo2 {Bar, Baz} //~ not a struct
 
 #[repr(u8)] //~ ERROR E0517
-            //~| requires an enum
-struct Foo3 {bar: bool, baz: bool}
+struct Foo3 {bar: bool, baz: bool} //~ not an enum
 
 #[repr(C)] //~ ERROR E0517
-           //~| requires a struct, enum or union
-impl Foo3 {
+impl Foo3 { //~ not a struct, enum or union
 }
 
 fn main() {
diff --git a/src/test/compile-fail/E0518.rs b/src/test/compile-fail/E0518.rs
index f9494e0bcb5..8de32bd3b77 100644
--- a/src/test/compile-fail/E0518.rs
+++ b/src/test/compile-fail/E0518.rs
@@ -9,12 +9,10 @@
 // except according to those terms.
 
 #[inline(always)] //~ ERROR E0518
-                  //~| requires a function
-struct Foo;
+struct Foo;       //~ not a function
 
 #[inline(never)] //~ ERROR E0518
-                 //~| requires a function
-impl Foo {
+impl Foo {       //~ not a function
 }
 
 fn main() {
diff --git a/src/test/compile-fail/attr-usage-inline.rs b/src/test/compile-fail/attr-usage-inline.rs
index c6b9b016331..40edbe86c7b 100644
--- a/src/test/compile-fail/attr-usage-inline.rs
+++ b/src/test/compile-fail/attr-usage-inline.rs
@@ -14,6 +14,6 @@
 fn f() {}
 
 #[inline] //~ ERROR: attribute should be applied to function
-struct S;
+struct S; //~ not a function
 
 fn main() {}
diff --git a/src/test/compile-fail/attr-usage-repr.rs b/src/test/compile-fail/attr-usage-repr.rs
index c0bfd3690c8..5e0259cb229 100644
--- a/src/test/compile-fail/attr-usage-repr.rs
+++ b/src/test/compile-fail/attr-usage-repr.rs
@@ -13,7 +13,7 @@
 #![feature(repr_simd)]
 
 #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
-fn f() {}
+fn f() {}  //~ not a struct, enum or union
 
 #[repr(C)]
 struct SExtern(f64, f64);
@@ -25,19 +25,19 @@ struct SPacked(f64, f64);
 struct SSimd(f64, f64);
 
 #[repr(i8)] //~ ERROR: attribute should be applied to enum
-struct SInt(f64, f64);
+struct SInt(f64, f64); //~ not an enum
 
 #[repr(C)]
 enum EExtern { A, B }
 
 #[repr(align(8))] //~ ERROR: attribute should be applied to struct
-enum EAlign { A, B }
+enum EAlign { A, B } // not a struct
 
 #[repr(packed)] //~ ERROR: attribute should be applied to struct
-enum EPacked { A, B }
+enum EPacked { A, B } // not a struct
 
 #[repr(simd)] //~ ERROR: attribute should be applied to struct
-enum ESimd { A, B }
+enum ESimd { A, B } // not a struct
 
 #[repr(i8)]
 enum EInt { A, B }
diff --git a/src/test/compile-fail/feature-gate/issue-43106-gating-of-inline.rs b/src/test/compile-fail/feature-gate/issue-43106-gating-of-inline.rs
index 24e77bf60a8..d86eb50c4ae 100644
--- a/src/test/compile-fail/feature-gate/issue-43106-gating-of-inline.rs
+++ b/src/test/compile-fail/feature-gate/issue-43106-gating-of-inline.rs
@@ -21,17 +21,28 @@
 #[inline = "2100"]
 //~^ ERROR attribute should be applied to function
 mod inline {
-    mod inner { #![inline="2100"] }
-    //~^ ERROR attribute should be applied to function
+//~^ not a function
+    mod inner {
+    //~^ not a function
+        #![inline="2100"]
+        //~^ ERROR attribute should be applied to function
+    }
 
-    #[inline = "2100"] fn f() { }
+    #[inline = "2100"]
+    fn f() { }
 
-    #[inline = "2100"] struct S;
+    #[inline = "2100"]
     //~^ ERROR attribute should be applied to function
+    struct S;
+    //~^ not a function
 
-    #[inline = "2100"] type T = S;
+    #[inline = "2100"]
     //~^ ERROR attribute should be applied to function
+    type T = S;
+    //~^ not a function
 
-    #[inline = "2100"] impl S { }
+    #[inline = "2100"]
     //~^ ERROR attribute should be applied to function
+    impl S { }
+    //~^ not a function
 }