Skip to content

Fix cfgs in rustdoc #1055

Closed
Closed
@joshlf

Description

@joshlf

FromZeros::new_vec_zeroed has the wrong cfg rendered on docs.rs:

image

We emit the wrong doc_cfg attribute:

zerocopy/src/lib.rs

Lines 1943 to 1946 in 2bec60b

#[cfg(feature = "alloc")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
#[inline(always)]
fn new_vec_zeroed(len: usize) -> Vec<Self>

We should fix this and also figure out whether there are other incorrect doc_cfg items to fix while we're here.

Mentoring instructions

Find and fix any instance of doc_cfg that doesn't match the corresponding cfg attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    experience-easyThis issue is easy, and shouldn't require much experiencehelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions