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

Mark attributes consumed by check_mod_attrs as normal #69412

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Feb 23, 2020

Take advantage of the fact that check_mod_attrs marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.

Take advantage of the fact that `check_mod_attrs` marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-02-23T22:20:54.7074819Z ========================== Starting Command Output ===========================
2020-02-23T22:20:54.7077606Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/2f30868a-1a1b-4308-a747-4e655eb6383f.sh
2020-02-23T22:20:54.7077905Z 
2020-02-23T22:20:54.7081478Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-23T22:20:54.7102256Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69412/merge to s
2020-02-23T22:20:54.7105743Z Task         : Get sources
2020-02-23T22:20:54.7106092Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-23T22:20:54.7106403Z Version      : 1.0.0
2020-02-23T22:20:54.7106614Z Author       : Microsoft
---
2020-02-23T22:20:55.7188805Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-23T22:20:55.7194464Z ##[command]git config gc.auto 0
2020-02-23T22:20:55.7198172Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-23T22:20:55.7201639Z ##[command]git config --get-all http.proxy
2020-02-23T22:20:55.7212978Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69412/merge:refs/remotes/pull/69412/merge
---
2020-02-23T22:57:30.5829132Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-02-23T22:57:46.4009667Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-02-23T22:57:51.8220480Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-02-23T22:58:15.4674001Z error: unused attribute
2020-02-23T22:58:15.4676144Z    --> src/librustc/ty/query/plumbing.rs:254:5
2020-02-23T22:58:15.4677525Z 254 |     #[cold]
2020-02-23T22:58:15.4678222Z     |     ^^^^^^^
2020-02-23T22:58:15.4678813Z     |
2020-02-23T22:58:15.4679558Z     = note: `-D unused-attributes` implied by `-D warnings`
---
2020-02-23T22:58:30.1032931Z   local time: Sun Feb 23 22:58:30 UTC 2020
2020-02-23T22:58:30.3999003Z   network time: Sun, 23 Feb 2020 22:58:30 GMT
2020-02-23T22:58:30.3999340Z == end clock drift check ==
2020-02-23T22:58:30.8098915Z 
2020-02-23T22:58:30.8196907Z ##[error]Bash exited with code '1'.
2020-02-23T22:58:30.8213875Z ##[section]Finishing: Run build
2020-02-23T22:58:30.8303192Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69412/merge to s
2020-02-23T22:58:30.8309121Z Task         : Get sources
2020-02-23T22:58:30.8309514Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-23T22:58:30.8309892Z Version      : 1.0.0
2020-02-23T22:58:30.8310143Z Author       : Microsoft
2020-02-23T22:58:30.8310143Z Author       : Microsoft
2020-02-23T22:58:30.8310551Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-23T22:58:30.8311034Z ==============================================================================
2020-02-23T22:58:31.1670444Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-23T22:58:31.1714420Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69412/merge to s
2020-02-23T22:58:31.1803763Z Cleaning up task key
2020-02-23T22:58:31.1805107Z Start cleaning up orphan processes.
2020-02-23T22:58:31.1961479Z Terminate orphan process: pid (4777) (python)
2020-02-23T22:58:31.2109603Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj
Copy link
Member

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned cramertj Feb 24, 2020
@Centril
Copy link
Contributor

Centril commented Feb 24, 2020

r? @Mark-Simulacrum @petrochenkov

@Mark-Simulacrum
Copy link
Member

I guess this feels fine to me, but I don't know why this wasn't already the case? Are we in a transition period or something like that? Without that knowledge (and I don't have time to hunt it down), I can't confidently approve this. r? @petrochenkov, I guess, though I'm not sure why @Centril thought that'd be reasonable.

@tmiasko
Copy link
Contributor Author

tmiasko commented Feb 25, 2020

The codegen attributes are generally consumed too late for the unused attribute
lint, hence they tend to be whitelisted. But since some of them, in particular
those changed here, are also validated by check_mod_attrs, it is possible to
make them normal. This is useful, since validity checks currently miss
inner crate attributes, and those are never valid there.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2020

📌 Commit d78b22f has been approved by petrochenkov

@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 Feb 25, 2020
bors added a commit that referenced this pull request Feb 26, 2020
Rollup of 7 pull requests

Successful merges:

 - #67637 (Add primitive module to libcore)
 - #69387 (Deduplicate identifier printing a bit)
 - #69412 (Mark attributes consumed by `check_mod_attrs` as normal)
 - #69423 (syntax: Remove `Nt(Impl,Trait,Foreign)Item`)
 - #69429 (remove redundant clones and import)
 - #69457 (Clean up e0370 e0371)
 - #69468 ([master] Backport release notes of 1.41.1)

Failed merges:

r? @ghost
@bors bors merged commit d050b00 into rust-lang:master Feb 26, 2020
@tmiasko tmiasko deleted the checked-unused branch February 27, 2020 11:37
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants