Skip to content

It is currently not possible to tell if a function or method is a const fn by reading documentation, as rustdoc does not retain the const keyword in const fn declarations #76478

@slightlyoutofphase

Description

@slightlyoutofphase

Basically, a function written for example like this:

pub const fn add(a: i32, b: i32) -> i32 {
    a + b
}

is currently documented like this:

pub fn add(a: i32, b: i32) -> i32

but it would be nice if was instead documented like this:

pub const fn add(a: i32, b: i32) -> i32

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions