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

rustdoc: tracking issue for pointer and reference in intra-doc links #80896

Open
camelid opened this issue Jan 11, 2021 · 5 comments
Open

rustdoc: tracking issue for pointer and reference in intra-doc links #80896

camelid opened this issue Jan 11, 2021 · 5 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Jan 11, 2021

We may want to put other targets behind the feature gate too, but we at least
want to get pointer behind one before #80181 hits beta.

See the discussion on Zulip for more.

cc @jyn514

@camelid camelid added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 11, 2021
@jyn514 jyn514 changed the title rustdoc: Put pointer intra-doc target behind a feature gate rustdoc: tracking issue for pointer and reference in intra-doc links Jan 14, 2021
@jyn514 jyn514 added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jan 14, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 18, 2021
Feature-gate `pointer` and `reference` in intra-doc links

r? `@camelid`

Addresses (but does not close) rust-lang#80896.
@jhpratt
Copy link
Member

jhpratt commented Feb 19, 2021

Getting an error on nightly from this that originates in stdlib.

Not sure if this needs special-casing, a feature gate added to core, or just the removal of the link. But something certainly isn't correct.

error[E0658]: linking to associated items of raw pointers is experimental
  --> /home/jhpratt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/metadata.rs:51:23
   |
51 | /// [`to_raw_parts`]: *const::to_raw_parts
   |                       ^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #80896 <https://github.com/rust-lang/rust/issues/80896> for more information
   = help: add `#![feature(intra_doc_pointers)]` to the crate attributes to enable
   = note: rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does

This is the line that the error traces to.

@jhpratt
Copy link
Member

jhpratt commented Feb 19, 2021

cc @jyn514 see above. It looks like you're the one that gated this.

@jhpratt
Copy link
Member

jhpratt commented Feb 19, 2021

Looks like this was noticed before I commented. The issue for it is #82284.

@Nemo157
Copy link
Member

Nemo157 commented May 8, 2021

Given that #62834 allowed the applied type Vec<T> to link to the type constructor Vec, it feels like *const T/&T and similar syntax should also be supported to link to the pages for the type constructors pointer/reference.

@camelid
Copy link
Member Author

camelid commented May 8, 2021

Perhaps, but I imagine that linking to *const T is not that common, and if it's not that common then it doesn't seem that bad to have people use [*const T](pointer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. 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

5 participants