Skip to content

#![feature(const_fn)] causes rustdoc to drop the const keyword when documenting instances of const fn #76501

Closed
@slightlyoutofphase

Description

@slightlyoutofphase

This is a follow-up on the now-closed issue I opened earlier, with the requested minimal reproduction in the form of a simple lib.rs.

// If the feature flag below is commented out, the code is documented correctly.
// With it enabled, the two `pub const fn`s are documented as just `pub fn`.
#![feature(const_fn)]

/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
    1
}

/// A struct.
pub struct Struct {}

impl Struct {
    /// A useless function that always returns 1.
    pub const fn bloop() -> i32 {
        1
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions