Skip to content

Type ascription builtin is silently replaced by rustfmt(?) #6159

Description

@Mark-Simulacrum

rustfmt complains about the type_ascribe macro asking for the builtin to be replaced with the ... : ... syntax:

Error: Diff in /checkout/library/core/src/macros/mod.rs at line 1712:
         reason = "placeholder syntax for type ascription"
     )]
     pub macro type_ascribe($expr:expr, $ty:ty) {
-        builtin # type_ascribe($expr, $ty)
+        $expr: $ty
     }

I've worked around this with #[rustfmt::skip] on the macro which seems to work, but filing an issue since it seems like somewhat odd behavior as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions