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

Move doc(primitive) future incompat warning to invalid_doc_attributes #109443

Merged
merged 7 commits into from
Mar 31, 2023

Conversation

GuillaumeGomez
Copy link
Member

Fixes #88070.

It's been a while since this was turned into a "future incompatible lint" so I think we can now turn it into a hard error without problem.

r? @jyn514

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 21, 2023
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 21, 2023
@jyn514
Copy link
Member

jyn514 commented Mar 21, 2023

Can you make this part of the rustc_attrs feature gate so we don't have to maintain a separate error message and feature gate?

@GuillaumeGomez
Copy link
Member Author

Good idea!

@GuillaumeGomez GuillaumeGomez force-pushed the doc-primitive-hard-error branch from 0b35a1b to 496c0e4 Compare March 21, 2023 15:55
@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label Mar 21, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2023

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@GuillaumeGomez
Copy link
Member Author

To make it work, I needed to update how it's handled in rustdoc and to put it behind a cfg in the std.

@bors
Copy link
Contributor

bors commented Mar 23, 2023

☔ The latest upstream changes (presumably #109503) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez force-pushed the doc-primitive-hard-error branch from 95be665 to 7cdbc8e Compare March 23, 2023 10:29
@GuillaumeGomez
Copy link
Member Author

Rebased.

@jyn514
Copy link
Member

jyn514 commented Mar 24, 2023

I don't have time for reviews right now.

r? rustdoc cc @petrochenkov

@rustbot rustbot assigned notriddle and unassigned jyn514 Mar 24, 2023
@GuillaumeGomez
Copy link
Member Author

cc @petrochenkov since they worked on something similar in #109534.

@GuillaumeGomez
Copy link
Member Author

r? @notriddle

@rustbot
Copy link
Collaborator

rustbot commented Mar 30, 2023

Could not assign reviewer from: notriddle.
User(s) notriddle are either the PR author or are already assigned, and there are no other candidates.
Use r? to specify someone else to assign.

@bors
Copy link
Contributor

bors commented Mar 30, 2023

☔ The latest upstream changes (presumably #109769) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez force-pushed the doc-primitive-hard-error branch from 7cdbc8e to 63c85e7 Compare March 30, 2023 15:28
@@ -264,18 +264,13 @@ impl ExternalCrate {
let as_primitive = |res: Res<!>| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let as_primitive = |res: Res<!>| {
    let Res::Def(DefKind::Mod, def_id) = res else { return None };
    tcx.get_attrs(def_id, sym::rustc_doc_primitive).find_map(|attr| {
        Some((def_id, PrimitiveType::from_symbol(attr.value_str()?)?))
    })
};

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's much better, thanks!

@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 30, 2023

📌 Commit 7167054be4f13814e6ea0d6d2735174eaf2e3f4d has been approved by notriddle

It is now in the queue for this repository.

@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 Mar 30, 2023
@notriddle
Copy link
Contributor

@bors r-

Broken intra-doc links.

@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 Mar 30, 2023
@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Mar 30, 2023

Shouldn't we do a crater run for this change?

@notriddle
Copy link
Contributor

I wasn't planning to, since

@jyn514 jyn514 changed the title Turn doc(primitive) future incompat warning into error Move doc(primitive) future incompat warning to invalid_doc_attributes Mar 30, 2023
@jyn514
Copy link
Member

jyn514 commented Mar 30, 2023

Ok, please update the PR description to reflect what the PR now does.

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Mar 30, 2023

@jyn514 Considering we have a warning that have been around for quite a while, I think it's ok. But do you see a reason where it could a be a problem maybe?

EDIT: sorry, the page wasn't updated. notriddle already answered. :)

@GuillaumeGomez GuillaumeGomez force-pushed the doc-primitive-hard-error branch from 7167054 to f6035fb Compare March 30, 2023 22:04
@GuillaumeGomez
Copy link
Member Author

Found the problem: since some parts of intra-doc link generation was moved into rustc_resolve, it used doc(primitive) in there too but wasn't updated.

@GuillaumeGomez
Copy link
Member Author

@bors r=notriddle

@bors
Copy link
Contributor

bors commented Mar 31, 2023

📌 Commit f6035fb has been approved by notriddle

It is now in the queue for this repository.

@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 Mar 31, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2023
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#109104 (rustdoc: Fix invalid suggestions on ambiguous intra doc links v2)
 - rust-lang#109443 (Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`)
 - rust-lang#109680 (Fix subslice capture in closure)
 - rust-lang#109798 (fluent_messages macro: don't emit the OS error in a note)
 - rust-lang#109805 (Source map cleanups)
 - rust-lang#109818 (rustdoc: Add GUI test for jump to collapsed item)
 - rust-lang#109820 (rustdoc-search: update docs for comma in `?` help popover)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6c93c63 into rust-lang:master Mar 31, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 31, 2023
@GuillaumeGomez GuillaumeGomez deleted the doc-primitive-hard-error branch April 1, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, 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

Successfully merging this pull request may close these issues.

Tracking Issue for #![feature(doc_primitive)]
6 participants