Skip to content

rustdoc: section methods from Deref hidden when no_std is set #95325

Closed
@marcospb19

Description

@marcospb19

If no_std is set, section "methods from Deref" does not appear for struct.

I tried this code:

// Comment the line below to make it work as expected.
#![no_std]

use core::ops::Deref;

pub struct MyArray<T> {
    array: [T; 10],
}

impl<T> Deref for MyArray<T> {
    type Target = [T];

    fn deref(&self) -> &Self::Target {
        &self.array
    }
}

Then ran:

cargo doc --open

I expected this to show up:

image

Instead, it did not show up:

image

Meta

rustdoc --version --verbose:

rustdoc 1.61.0-nightly (d53246fed 2022-03-25)
binary: rustdoc
commit-hash: d53246fedde4c193eae8a003546a8f0f9f85d223
commit-date: 2022-03-25
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc 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