Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs don't show that pointer::is_null() is defined only where T: Sized #36952

Closed
Ms2ger opened this issue Oct 4, 2016 · 5 comments
Closed

Docs don't show that pointer::is_null() is defined only where T: Sized #36952

Ms2ger opened this issue Oct 4, 2016 · 5 comments
Labels
T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 4, 2016

No description provided.

@KamilaBorowska
Copy link
Contributor

To clarify the issue, documentation says (there is also similar implementation for mut pointers):

impl<T> *const T where T: ?Sized

But that doesn't match the actual implementation where T has to be Sized.

@durka
Copy link
Contributor

durka commented Oct 4, 2016

There's a T: ?Sized on the impl, but the actual function puts back T: Sized and the docs don't reflect this.

This doesn't seem to happen in a normal project with a similar impl: where T: Sized is correctly shown on the fn.

@bluss
Copy link
Member

bluss commented Oct 4, 2016

Looks like the usual cross crate doc inclusion issue. The methods are defined in core.

@apasel422 apasel422 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 4, 2016
@Kixunil
Copy link
Contributor

Kixunil commented Jan 19, 2017

I've just encountered this issue. Example.

Any explanation why T must impl Sized? What's the correct approach to null-check in case of unsized types?

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum
Copy link
Member

Closing as a duplicate of #24183.

@Mark-Simulacrum Mark-Simulacrum marked this as a duplicate of #24183 Jul 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants