about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2021-05-11 15:21:54 -0400
committerFelix S. Klock II <pnkfelix@pnkfx.org>2021-05-11 15:21:54 -0400
commit8ce761d75ed5132c90bfe28e983d83007b8ce7c3 (patch)
tree391380376353d3af844d75086843ac0be38b5210
parent75d62931280ae8f2ad26b2812e151f8f49de407a (diff)
downloadrust-8ce761d75ed5132c90bfe28e983d83007b8ce7c3.tar.gz
rust-8ce761d75ed5132c90bfe28e983d83007b8ce7c3.zip
Updates to tests.
-rw-r--r--src/test/pretty/ast-stmt-expr-attr.rs8
-rw-r--r--src/test/pretty/stmt_expr_attributes.rs17
-rw-r--r--src/test/ui/parser/stmt_expr_attrs_placement.rs2
-rw-r--r--src/test/ui/parser/stmt_expr_attrs_placement.stderr10
4 files changed, 20 insertions, 17 deletions
diff --git a/src/test/pretty/ast-stmt-expr-attr.rs b/src/test/pretty/ast-stmt-expr-attr.rs
index de42a8c4ed5..833cb26c1e5 100644
--- a/src/test/pretty/ast-stmt-expr-attr.rs
+++ b/src/test/pretty/ast-stmt-expr-attr.rs
@@ -43,10 +43,10 @@ fn syntax() {
                     #![attr]
                 };
     let _ =
-        #[attr] match true
-                    {
-                     #[attr]
-                     _ => false,
+        #[attr] match true {
+                    #![attr]
+                            #[attr]
+                            _ => false,
                 };
     let _ = #[attr] || #[attr] foo;
     let _ = #[attr] move || #[attr] foo;
diff --git a/src/test/pretty/stmt_expr_attributes.rs b/src/test/pretty/stmt_expr_attributes.rs
index 54a8438f1d0..231351433c8 100644
--- a/src/test/pretty/stmt_expr_attributes.rs
+++ b/src/test/pretty/stmt_expr_attributes.rs
@@ -41,9 +41,16 @@ fn _3() {
 fn _4() {
 
     #[rustc_dummy]
-    match () { _ => (), }
+    match () {
+        #![rustc_dummy]
+        _ => (),
+    }
 
-    let _ = #[rustc_dummy] match () { () => (), };
+    let _ =
+        #[rustc_dummy] match () {
+                           #![rustc_dummy]
+                           () => (),
+                       };
 }
 
 fn _5() {
@@ -164,7 +171,11 @@ fn _11() {
         #[rustc_dummy] loop  {
                            #![rustc_dummy]
                        };
-    let _ = #[rustc_dummy] match false { _ => (), };
+    let _ =
+        #[rustc_dummy] match false {
+                           #![rustc_dummy]
+                           _ => (),
+                       };
     let _ = #[rustc_dummy] || #[rustc_dummy] ();
     let _ = #[rustc_dummy] move || #[rustc_dummy] ();
     let _ =
diff --git a/src/test/ui/parser/stmt_expr_attrs_placement.rs b/src/test/ui/parser/stmt_expr_attrs_placement.rs
index d488cd0c2d3..5e9d29a152f 100644
--- a/src/test/ui/parser/stmt_expr_attrs_placement.rs
+++ b/src/test/ui/parser/stmt_expr_attrs_placement.rs
@@ -30,7 +30,7 @@ fn main() {
     //~^ ERROR an inner attribute is not permitted in this context
 
     let g = match true { #![allow(warnings)] _ => {} };
-    //~^ ERROR an inner attribute is not permitted in this context
+
 
     struct MyStruct { field: u8 }
     let h = MyStruct { #![allow(warnings)] field: 0 };
diff --git a/src/test/ui/parser/stmt_expr_attrs_placement.stderr b/src/test/ui/parser/stmt_expr_attrs_placement.stderr
index 185cc009640..808903d9c62 100644
--- a/src/test/ui/parser/stmt_expr_attrs_placement.stderr
+++ b/src/test/ui/parser/stmt_expr_attrs_placement.stderr
@@ -47,14 +47,6 @@ LL |     let f = [#![allow(warnings)] 1; 0];
    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
 
 error: an inner attribute is not permitted in this context
-  --> $DIR/stmt_expr_attrs_placement.rs:32:26
-   |
-LL |     let g = match true { #![allow(warnings)] _ => {} };
-   |                          ^^^^^^^^^^^^^^^^^^^
-   |
-   = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
-
-error: an inner attribute is not permitted in this context
   --> $DIR/stmt_expr_attrs_placement.rs:36:24
    |
 LL |     let h = MyStruct { #![allow(warnings)] field: 0 };
@@ -62,5 +54,5 @@ LL |     let h = MyStruct { #![allow(warnings)] field: 0 };
    |
    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
 
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors