Fix line break after ":" in unpretty attribute print

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer
2025-07-05 22:21:28 +02:00
parent 3fa0ec91d8
commit 33f2cc7eda
3 changed files with 8 additions and 10 deletions

View File

@@ -21,7 +21,8 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok
__p.word_space(","); __p.word_space(",");
} }
__p.word(#string_name); __p.word(#string_name);
__p.word_space(":"); __p.word(":");
__p.nbsp();
__printed_anything = true; __printed_anything = true;
} }
#name.print_attribute(__p); #name.print_attribute(__p);

View File

@@ -9,12 +9,12 @@ extern crate std;
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
struct PlainDeprecated; struct PlainDeprecated;
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, note: #[attr = Deprecation {deprecation: Deprecation {since: Unspecified,
"here's why this is deprecated"}}] note: "here's why this is deprecated"}}]
struct DirectNote; struct DirectNote;
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, note: #[attr = Deprecation {deprecation: Deprecation {since: Unspecified,
"here's why this is deprecated"}}] note: "here's why this is deprecated"}}]
struct ExplicitNote; struct ExplicitNote;
#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"), #[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"),
@@ -28,8 +28,6 @@ struct FlippedOrder;
fn f() { fn f() {
// Attribute is ignored here (with a warning), but still preserved in HIR // Attribute is ignored here (with a warning), but still preserved in HIR
#[attr = Deprecation {deprecation: #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
Deprecation {since:
Unspecified}}]
0 0
} }

View File

@@ -64,8 +64,7 @@ mod attributes {
#[doc = "outer doc attribute"] #[doc = "outer doc attribute"]
#[doc = "macro"] #[doc = "macro"]
#[allow()] #[allow()]
#[attr = Repr {reprs: #[attr = Repr {reprs: [ReprC]}]
[ReprC]}]
struct Struct; struct Struct;
} }