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

Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links #75855

Merged
merged 2 commits into from
Aug 24, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 23, 2020

This prevents links from breaking when items are re-exported in a
different crate and the original isn't being documented.

Spotted in #75832 (comment) (thanks ollie!)

r? @ollie27

This prevents links from breaking when items are re-exported in a
different crate and the original isn't being documented.
@jyn514 jyn514 added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Aug 23, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2020
@jyn514 jyn514 changed the title Use allow(unused_imports) instead of cfg(doc) Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links Aug 23, 2020
@ollie27
Copy link
Member

ollie27 commented Aug 23, 2020

Yeah, there are currently broken links on https://doc.rust-lang.org/nightly/std/intrinsics/fn.atomic_xchg.html which this should fix.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 23, 2020

📌 Commit 602dd14 has been approved by ollie27

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 23, 2020
@jyn514
Copy link
Member Author

jyn514 commented Aug 23, 2020

I'm a little confused how this slipped through CI ... the place where this breaks is when documenting a re-export in std, right? So it seems strange it wasn't caught by x.py doc library/std :/

@ollie27
Copy link
Member

ollie27 commented Aug 23, 2020

We're explicitly ignoring warnings from other crates:

// If non-local, no need to check anything.
info!("ignoring warning from parent crate: {}", msg);
return;

@jyn514
Copy link
Member Author

jyn514 commented Aug 23, 2020

Yup, that would do it. We should probably close #56922 as fixed, then. I'll make a PR with a test case.

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 24, 2020
Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links

This prevents links from breaking when items are re-exported in a
different crate and the original isn't being documented.

Spotted in rust-lang#75832 (comment) (thanks ollie!)

r? @ollie27
@JohnTitor
Copy link
Member

Failed in rollup: #75862 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 24, 2020
@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2020

@JohnTitor I pushed a commit which I hope will fix it, but I'm not sure how to test thumb targets locally ... x.py doc library/std --target thumbv8m.main-none-eabihf panics at couldn't find required command: "arm-none-eabi-gcc". Do you have any suggestions?

@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2020

well, I'll ask bors to test in the meantime and if it fails, it fails.

@bors r=ollie27 rollup=iffy

@bors
Copy link
Contributor

bors commented Aug 24, 2020

📌 Commit 5aac94a has been approved by ollie27

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2020
@JohnTitor
Copy link
Member

@jyn514 I don't familiar with that target so let's ask bors :)

@bors
Copy link
Contributor

bors commented Aug 24, 2020

⌛ Testing commit 5aac94a with merge d795eb4...

@bors
Copy link
Contributor

bors commented Aug 24, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: ollie27
Pushing d795eb4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants