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

Warn about unknown doc attributes #82662

Merged
merged 2 commits into from
Mar 2, 2021
Merged

Conversation

GuillaumeGomez
Copy link
Member

Fixes #82652.

For the text error, I decided to go for "invalid" instead of "unknown". What do you think?

r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 1, 2021
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 1, 2021
@rust-log-analyzer

This comment has been minimized.

compiler/rustc_passes/src/check_attr.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/check_attr.rs Show resolved Hide resolved
compiler/rustc_passes/src/check_attr.rs Show resolved Hide resolved
compiler/rustc_passes/src/check_attr.rs Show resolved Hide resolved
@jyn514 jyn514 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2021
@GuillaumeGomez GuillaumeGomez force-pushed the doc-attr-check branch 2 times, most recently from 18bd10e to d089510 Compare March 1, 2021 18:32
@jyn514 jyn514 changed the title Doc attr check Warn about unknown doc attributes Mar 1, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 1, 2021

Looks good to me with #82662 (comment) addressed, but I want to double check it's fine to add this in rustc_attr instead of rustdoc. My reasoning is I think this should warn when running rustc, not just when rustdoc runs.

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned jyn514 Mar 1, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

but I want to double check it's fine to add this in rustc_attr instead of rustdoc.

Seems fine.
r? @jyn514

@rust-highfive rust-highfive assigned jyn514 and unassigned petrochenkov Mar 1, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 1, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Mar 1, 2021

📌 Commit f6de130 has been approved by jyn514

@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 1, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 2, 2021
…laumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#80734 (check that first arg to `panic!()` in const is `&str`)
 - rust-lang#81932 (Always compile rustdoc with debug logging enabled when `download-rustc` is set)
 - rust-lang#82018 (Remove the dummy cache in `DocContext`; delete RenderInfo)
 - rust-lang#82598 (Check stability and feature attributes in rustdoc)
 - rust-lang#82655 (Highlight identifier span instead of whole pattern span in `unused` lint)
 - rust-lang#82662 (Warn about unknown doc attributes)
 - rust-lang#82676 (Change twice used large const table to static)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0c6b69a into rust-lang:master Mar 2, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 2, 2021
@GuillaumeGomez GuillaumeGomez deleted the doc-attr-check branch March 2, 2021 08:51
@Manishearth
Copy link
Member

This is a breaking change, please revert this

@Manishearth
Copy link
Member

Ah I see, it's done in #82702

@GuillaumeGomez
Copy link
Member Author

It wasn't working in the first place, so it's just enforcing something broken by emitting an error instead of doing nothing. The discussion is now in #82702 though.

@Manishearth
Copy link
Member

It wasn't working in the first place, so it's just enforcing something broken by emitting an error instead of doing nothing. The discussion is now in #82702 though.

I know, that does not matter, this is a breaking change, regardless of whether stuff was broken previously. Stuff was previously broken in a way that did not break compiles.

Now tons of projects fail to compile because of their dependencies -- something which they can't easily fix and are forced to just wait for a nightly for.

@GuillaumeGomez
Copy link
Member Author

I agree that it shouldn't break, but here is a bit of a special case since it was a "runtime" issue that I brought back to compile-time. Tricky problem. I guess that it might be worth it to put it back as hard error in the 2021 edition. Well, to be discussed. At least since #82702, it won't go unnoticed anymore.

@Manishearth
Copy link
Member

I agree that it shouldn't break, but here is a bit of a special case since it was a "runtime" issue that I brought back to compile-time. Tricky problem. I guess that it might be worth it to put it back as hard error in the 2021 edition. Well, to be discussed. At least since #82702, it won't go unnoticed anymore.

I disagree that this is special, this is like 90% of the future incompat work that rustc does. "Stuff that used to compile but was wrong". Yes, it was wrong, but it was wrong in a way that users of the crate did not have to worry about much.

I'm being a bit pointed here, and I hope you don't take it personally, but we all really need to be on the same page when it comes to breaking changes.

@GuillaumeGomez
Copy link
Member Author

No, I see your point, which is why I'm happy that #82702 was created so quickly afterwards. I mostly wanted it to not go unnoticed, so wether it's a hard error or a warning is both good for me.

@Manishearth
Copy link
Member

Yeah, I understand, thanks!

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2021
Change error about unknown attributes to a warning

Hard errors should go through a future-compatibility phase first, especially since these attributes only have no effect and don't actively cause bugs.

Follow-up to rust-lang#82662. Fixes ecosystem breakage like rust-lang/rust-clippy#6832.

r? `@GuillaumeGomez`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Rustdoc should report unknown doc(...) attributes
8 participants