Skip to content

Commit

Permalink
Bless all pretty printer tests and ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 3, 2022
1 parent 40fcbba commit ca3057f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/test/pretty/ast-stmt-expr-attr.rs
Expand Up @@ -119,9 +119,9 @@ fn syntax() {
let _ = #[attr] foo![#! [attr]];
let _ = #[attr] foo! {};
let _ = #[attr] foo! { #! [attr] };
let _ = #[attr] Foo{bar: baz,};
let _ = #[attr] Foo{..foo};
let _ = #[attr] Foo{bar: baz, ..foo};
let _ = #[attr] Foo { bar: baz };
let _ = #[attr] Foo { ..foo };
let _ = #[attr] Foo { bar: baz, ..foo };
let _ = #[attr] (0);

{
Expand Down
5 changes: 3 additions & 2 deletions src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
Expand Up @@ -8,9 +8,10 @@ struct C {

#[allow()]
const C: C =
C{
C {
#[cfg(debug_assertions)]
field: 0,

#[cfg(not(debug_assertions))]
field: 1,};
field: 1,
};
12 changes: 6 additions & 6 deletions src/test/pretty/stmt_expr_attributes.rs
Expand Up @@ -90,9 +90,9 @@ struct Bar(());
fn _7() {

#[rustc_dummy]
Foo{data: (),};
Foo { data: () };

let _ = #[rustc_dummy] Foo{data: (),};
let _ = #[rustc_dummy] Foo { data: () };
}

fn _8() {
Expand Down Expand Up @@ -209,7 +209,7 @@ fn _11() {
let mut x = 0;
let _ = #[rustc_dummy] x = 15;
let _ = #[rustc_dummy] x += 15;
let s = Foo{data: (),};
let s = Foo { data: () };
let _ = #[rustc_dummy] s.data;
let _ = (#[rustc_dummy] s).data;
let t = Bar(());
Expand All @@ -235,9 +235,9 @@ fn _11() {
let _ = #[rustc_dummy] expr_mac!();
let _ = #[rustc_dummy] expr_mac![];
let _ = #[rustc_dummy] expr_mac! {};
let _ = #[rustc_dummy] Foo{data: (),};
let _ = #[rustc_dummy] Foo{..s};
let _ = #[rustc_dummy] Foo{data: (), ..s};
let _ = #[rustc_dummy] Foo { data: () };
let _ = #[rustc_dummy] Foo { ..s };
let _ = #[rustc_dummy] Foo { data: (), ..s };
let _ = #[rustc_dummy] (0);
}

Expand Down
20 changes: 10 additions & 10 deletions src/test/ui/macros/stringify.rs
Expand Up @@ -315,17 +315,17 @@ fn test_expr() {
assert_eq!(stringify_expr!(mac! { ... }), "mac! { ... }");

// ExprKind::Struct
assert_eq!(stringify_expr!(Struct {}), "Struct{}"); // FIXME
assert_eq!(stringify_expr!(Struct {}), "Struct {}");
#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5151
assert_eq!(stringify_expr!(<Struct as Trait>::Type {}), "<Struct as Trait>::Type{}");
assert_eq!(stringify_expr!(Struct { .. }), "Struct{..}"); // FIXME
assert_eq!(stringify_expr!(Struct { ..base }), "Struct{..base}"); // FIXME
assert_eq!(stringify_expr!(Struct { x }), "Struct{x,}");
assert_eq!(stringify_expr!(Struct { x, .. }), "Struct{x, ..}");
assert_eq!(stringify_expr!(Struct { x, ..base }), "Struct{x, ..base}");
assert_eq!(stringify_expr!(Struct { x: true }), "Struct{x: true,}");
assert_eq!(stringify_expr!(Struct { x: true, .. }), "Struct{x: true, ..}");
assert_eq!(stringify_expr!(Struct { x: true, ..base }), "Struct{x: true, ..base}");
assert_eq!(stringify_expr!(<Struct as Trait>::Type {}), "<Struct as Trait>::Type {}");
assert_eq!(stringify_expr!(Struct { .. }), "Struct { .. }");
assert_eq!(stringify_expr!(Struct { ..base }), "Struct { ..base }");
assert_eq!(stringify_expr!(Struct { x }), "Struct { x }");
assert_eq!(stringify_expr!(Struct { x, .. }), "Struct { x, .. }");
assert_eq!(stringify_expr!(Struct { x, ..base }), "Struct { x, ..base }");
assert_eq!(stringify_expr!(Struct { x: true }), "Struct { x: true }");
assert_eq!(stringify_expr!(Struct { x: true, .. }), "Struct { x: true, .. }");
assert_eq!(stringify_expr!(Struct { x: true, ..base }), "Struct { x: true, ..base }");

// ExprKind::Repeat
assert_eq!(stringify_expr!([(); 0]), "[(); 0]");
Expand Down
@@ -1,6 +1,6 @@
[$DIR/dbg-macro-expected-behavior.rs:20] Unit = Unit
[$DIR/dbg-macro-expected-behavior.rs:21] a = Unit
[$DIR/dbg-macro-expected-behavior.rs:27] Point{x: 42, y: 24,} = Point {
[$DIR/dbg-macro-expected-behavior.rs:27] Point { x: 42, y: 24 } = Point {
x: 42,
y: 24,
}
Expand Down

0 comments on commit ca3057f

Please sign in to comment.