diff options
| -rw-r--r-- | compiler/rustc_macros/src/print_attribute.rs | 3 | ||||
| -rw-r--r-- | tests/ui/unpretty/deprecated-attr.stdout | 12 | ||||
| -rw-r--r-- | tests/ui/unpretty/exhaustive.hir.stdout | 3 |
3 files changed, 8 insertions, 10 deletions
diff --git a/compiler/rustc_macros/src/print_attribute.rs b/compiler/rustc_macros/src/print_attribute.rs index 42d94e72ee9..9023520c750 100644 --- a/compiler/rustc_macros/src/print_attribute.rs +++ b/compiler/rustc_macros/src/print_attribute.rs @@ -21,7 +21,8 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok __p.word_space(","); } __p.word(#string_name); - __p.word_space(":"); + __p.word(":"); + __p.nbsp(); __printed_anything = true; } #name.print_attribute(__p); diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index a2b645d00d0..042c2f61bd4 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -9,12 +9,12 @@ extern crate std; #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] struct PlainDeprecated; -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, note: -"here's why this is deprecated"}}] +#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, +note: "here's why this is deprecated"}}] struct DirectNote; -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, note: -"here's why this is deprecated"}}] +#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, +note: "here's why this is deprecated"}}] struct ExplicitNote; #[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"), @@ -28,8 +28,6 @@ struct FlippedOrder; fn f() { // Attribute is ignored here (with a warning), but still preserved in HIR - #[attr = Deprecation {deprecation: - Deprecation {since: - Unspecified}}] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] 0 } diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index 0a983b41ef3..a559d51ed5d 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -64,8 +64,7 @@ mod attributes { #[doc = "outer doc attribute"] #[doc = "macro"] #[allow()] - #[attr = Repr {reprs: - [ReprC]}] + #[attr = Repr {reprs: [ReprC]}] struct Struct; } |
