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

Add missing checks for #[doc(alias = "")] #73721

Closed
GuillaumeGomez opened this issue Jun 25, 2020 · 6 comments · Fixed by #75888
Closed

Add missing checks for #[doc(alias = "")] #73721

GuillaumeGomez opened this issue Jun 25, 2020 · 6 comments · Fixed by #75888
Assignees
Labels
A-doc-alias Area: `#[doc(alias)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jun 25, 2020

Now that #72780 has been merged, only a few checks remain to be added in order to stabilize this feature.

First, we need to actually perform those checks in the compiler directly instead of rustdoc.

You mentioned other checks too @ollie27 ?

This issue is part of #50146.

@GuillaumeGomez GuillaumeGomez self-assigned this Jun 25, 2020
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 25, 2020
@ollie27
Copy link
Member

ollie27 commented Jul 6, 2020

You mentioned other checks too @ollie27 ?

We should reject #[doc(alias = "")] on items that don't actually appear in the search index such as extern blocks and impls.

@GuillaumeGomez
Copy link
Member Author

Ok, makes sense! Last question: I remember you telling that you'd prefer this check in rustc directly instead of rustdoc. I can move things there, just wanted to check one last time before doing it.

@ollie27
Copy link
Member

ollie27 commented Jul 7, 2020

I remember you telling that you'd prefer this check in rustc directly instead of rustdoc. I can move things there, just wanted to check one last time before doing it.

Yeah, rustc validates some attributes in https://github.com/rust-lang/rust/blob/master/src/librustc_passes/check_attr.rs and it might make sense to validate the #[doc] attribute there as well.

Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
…anishearth

Move #[doc(alias)] check in rustc

Part of rust-lang#73721.

r? @ollie27
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
…anishearth

Move #[doc(alias)] check in rustc

Part of rust-lang#73721.

r? @ollie27
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
…anishearth

Move #[doc(alias)] check in rustc

Part of rust-lang#73721.

r? @ollie27
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 19, 2020
…lie27

Doc alias checks: ensure only items appearing in search index can use it

Following the discussion in rust-lang#73721, I added checks to ensure that only items appearing in the search are allowed to have doc alias.

r? @ollie27
@GuillaumeGomez
Copy link
Member Author

Since #74148 has been merged, we can close this issue.

@ollie27
Copy link
Member

ollie27 commented Aug 23, 2020

We're still not rejecting #[doc(alias)] on associated consts in trait impls like:

pub struct Foo;
pub trait Bar {
    const BAZ: u8;
}
impl Bar for Foo {
    #[doc(alias = "thing")]
    const BAZ: u8 = 0;
}

@ollie27 ollie27 reopened this Aug 23, 2020
@GuillaumeGomez
Copy link
Member Author

Ok! Putting #75740 on hold then!

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 4, 2020
…st-doc-alias, r=ollie27

Add check for doc alias on assoc const in trait impl

Fixes rust-lang#73721.

r? @ollie27
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 4, 2020
…st-doc-alias, r=ollie27

Add check for doc alias on assoc const in trait impl

Fixes rust-lang#73721.

r? @ollie27
@bors bors closed this as completed in 02fe309 Sep 5, 2020
@jyn514 jyn514 added the A-doc-alias Area: `#[doc(alias)]` label Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doc-alias Area: `#[doc(alias)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants