Skip to content

Rustdoc missing where-clause for <*const T>::offset #45389

@dtolnay

Description

@dtolnay

https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset

The implementation looks like:

pub unsafe fn offset(self, count: isize) -> *const T where T: Sized

But rustdoc only shows:

unsafe fn offset(self, count: isize) -> *const T

I tried to reproduce this with a struct type, but rustdoc seemed to do the right thing for this case.

pub struct Ptr<T: ?Sized>(*const T);

impl<T: ?Sized> Ptr<T> {
    pub fn offset(self, count: isize) -> Ptr<T> where T: Sized {
        unimplemented!()
    }
}

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