Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.
This repository was archived by the owner on Nov 9, 2025. It is now read-only.

Const async functions #9

@dtolnay

Description

@dtolnay

The ungrammar for Fn suggests async and const are mutually exclusive, but Rust's parser allows functions that are both.

ungrammar/rust.ungram

Lines 126 to 130 in 07d5806

Fn =
Attr* Visibility?
'default'? ('async' | 'const')? 'unsafe'? Abi?
'fn' Name GenericParamList? ParamList RetType? WhereClause?
(body:BlockExpr | ';')

const async fn f();

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b5513b0a15747aa6f864d4b3f2a415af

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions