Skip to content

Tracking issue for internal syntax #110680

Open

Description

@est31

This is a tracking issue for the internal feature internal syntax.

It's gated behind #![feature(internal_syntax)] and hosts an assortment of syntaxes that conventionally follow the scheme k#IDENT($( $tt )*) where IDENT is the name of the construct and k# (from MCP 945) forces IDENT to be interpreted as a keyword.

This feature once used to be called builtin_syntax and the individual constructs used to be prefixed with builtin # instead of k#. It was originally proposed in MCP 580.

Usually, these internal syntactic constructs are then wrapped by & exposed via a non-internal macro in the library core. The macro is usually a decl macro 2.0 that's annotated with #[diagnostic::opaque] & bears the same name as the internal construct.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

  • Implement the scaffolding for the builtin # syntax
  • Replace builtin # with k#
  • Migrate all built-in macros that qualify to wrapper macros containing internal syntax
    • asm (ast::ExprKind::InlineAsm)
    • format_args (ast::ExprKind::FormatArgs)
    • gca (ast::{Expr,Type}Kind::GcaMacro (needs renaming))
    • global_asm (ast::ItemKind::GlobalAsm)
    • include_bytes (ast::ExprKind::IncludedBytes)
    • naked_asm (ast::ExprKind::InlineAsm)
    • offset_of (ast::ExprKind::OffsetOf)
    • pattern_type (ast::TyKind::Pat)
    • type_ascribe (ast::ExprKind::Type)
    • view_type (ast::TypeKind::View)
  • Maybe migrate certain (unstable) temporary syntactic constructs to internal syntax unless it's considered too churn-y for users of the language
    • do yeet (ast::ExprKind::Yeet)

Reference

For reference, here's a list of all current internal syntactic constructs:

  • deref (ast::PatKind::Deref)
  • field_of (ast::TyKind::FieldOf)
  • offset_of (ast::ExprKind::OffsetOf)
  • type_ascribe (ast::ExprKind::Type)
  • unwrap_binder (ast::ExprKind::UnsafeBinderCast(Unwrap))
  • wrap_binder (ast::ExprKind::UnsafeBinderCast(Wrap))

Unresolved questions

None so far.

Implementation history

Pinned by fmease

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Apr 22, 2023
  2. added a commit that references this issue on May 9, 2023
  3. changed the title [-]Tracking Issue for builtin# syntax[/-] [+]Tracking Issue for builtin # syntax[/+] on May 17, 2023
  4. added a commit that references this issue on Jul 12, 2024
  5. added a commit that references this issue on Jul 12, 2024
  6. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 20, 2026
  7. added 6 commits that reference this issue on Nov 3, 2026
  8. added a commit that references this issue on Nov 4, 2026
  9. changed the title [-]Tracking Issue for builtin # syntax[/-] [+]Tracking issue for internal syntax[/+] on Nov 4, 2026
  10. added
    B-MCP-approvedBlocker: Approved by an accepted MCP but not yet fully implemented.
    on Nov 4, 2026
  11. self-assigned this
    on Nov 4, 2026
  12. fmease commented on Nov 4, 2026

    @fmease
    Member

    PSA: The feature has been renamed from builtin_syntax to internal_syntax (without tombstoning) and the overarching syntax has been changed from builtin # IDENT(TTS) to k#IDENT(TTS) where k# is a Rust>=2021 identifier prefix that turns the identifier into a so-called forced keyword meaning k#IDENT is a single lexical element unlike builtin # (see also MCP 945).

    The change will be effective with the upcoming release of nightly-2026-11-05 (v1.101.0).

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

Metadata

Metadata

Assignees

Labels

B-MCP-approvedBlocker: Approved by an accepted MCP but not yet fully implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-impl-incompleteStatus: The implementation is incomplete.S-tracking-perma-unstableStatus: The feature will stay unstable indefinitely.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions