Skip to content

Commit

Permalink
Updates to tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed May 11, 2021
1 parent 75d6293 commit 8ce761d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/test/pretty/ast-stmt-expr-attr.rs
Expand Up @@ -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;
Expand Down
17 changes: 14 additions & 3 deletions src/test/pretty/stmt_expr_attributes.rs
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 _ =
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/stmt_expr_attrs_placement.rs
Expand Up @@ -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 };
Expand Down
10 changes: 1 addition & 9 deletions src/test/ui/parser/stmt_expr_attrs_placement.stderr
Expand Up @@ -46,14 +46,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
|
Expand All @@ -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

0 comments on commit 8ce761d

Please sign in to comment.